History | View | Annotate | Download (29.7 kB)
pseries: Use #define for XICS base irq number
Currently the lowest "real" irq number for the XICS irq controller (asopposed to numbers reserved for IPIs and other special purposes) ishard coded as 16 in two places - in xics_system_init() and in spapr.c....
target-ppc: Pass PowerPCCPU to cpu_ppc_hypercall
Adapt emulate_spapr_hypercall() accordingly.
Needed for changing spapr_hypercall() argument type to PowerPCCPU.
Signed-off-by: Andreas Färber <afaerber@suse.de>
spapr: Pass PowerPCCPU to spapr_hypercall()
Needed for changing the hypercall handlers' argument type to PowerPCCPU.
Add USB option in machine options
When -usb option is used, global varible usb_enabled is set.And all the plaform will create one USB controller accordingto this variable. In fact, global varibles make code hardto read.
So this patch is to remove global variable usb_enabled and...
pseries: Implement qemu initiated shutdowns using EPOW events
At present, using 'system_powerdown' from the monitor or otherwiseinstructing qemu to (cleanly) shut down a pseries guest will not work,because we did not have a method of signalling the shutdown request to the...
Rename target_phys_addr_t to hwaddr
target_phys_addr_t is unwieldly, violates the C standard (_t suffixes arereserved) and its purpose doesn't match the name (most target_phys_addr_taddresses are not target specific). Replace it with a finger-friendly,...
create struct for machine initialization arguments
This should help us to:- More easily add or remove machine initialization arguments without having to change every single machine init function;- More easily make mechanical changes involving the machine init...
Merge branch 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf
ppc/pSeries: use the new pci_vga_init() function
Keep the case to prevent some vga card to be selected.
Cc: Alexander Graf <agraf@suse.de>Cc: David Gibson <david@gibson.dropbear.id.au>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
vga: rename pci_vga_init() into pci_std_vga_init()
This better explains what is this function about. Adjust all callers.
Cc: Alexander Graf <agraf@suse.de>Cc: Andreas Färber <andreas.faerber@web.de>Cc: David Gibson <david@gibson.dropbear.id.au>Cc: Anthony Liguori <aliguori@us.ibm.com>...
pseries: Don't test for MSR_PR for hypercalls under KVM
PAPR hypercalls should only be invoked from the guest kernel, not guestuser programs, that is, with MSR[PR]=0. Currently we check this inspapr_hypercall, returning H_PRIVILEGE if MSR[PR]=1.
However, under KVM the state of MSR[PR] is already checked by the host...
pseries: Remove XICS irq type enum type
Currently the XICS interrupt controller emulation uses a custom enum tospecify whether a given interrupt is level-sensitive or message-triggered.This enum makes life awkward for saving the state, and isn't particularly...
pseries: Set hash table size based on RAM size
Currently the pseries machine code always attempts to set the size of theguests's hash page table to 16MB. However, because of the way the POWERMMU works, a suitable hash page table size should really depend on memory...
pseries: Fix and cleanup CPU initialization and reset
The current pseries machine init function iterates over the CPUs at severalpoints, doing various bits of initialization. This is messy; these canand should be merged into a single iteration doing all the necessary per...
pseries: Use new method to correct reset sequence
A number of things need to occur during reset of the PAPRparavirtualized platform in a specific order. For example, the hashtable needs to be cleared before the CPUs are reset, so that theyinitialize their register state correctly, and the CPUs need to have...
pseries: Add support for new KVM hash table control call
This adds support for then new "reset htab" ioctl which allows qemuto properly cleanup the MMU hash table when the guest is reset. Withthe corresponding kernel support, reset of a guest now works properly....
spapr_pci: QOM'ify sPAPR PCI host bridge
Introduce type constant. Introduce cast macro to drop bogus busdev fieldthat would've broken SYS_BUS_DEVICE(). Avoid accessing parent fieldsdirectly.
Free the identifier phb as acronym for PCI_HOST_BRIDGE.
Updated against conflicting merge from branch 'agraf/ppc-for-upstream'...
pci: Derive PCI host bridges from TYPE_PCI_HOST_BRIDGE
Use PCIHostState and PCI_HOST_BRIDGE() where appropriate.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pseries: Instantiate USB interface when required
The pseries machine already supports the -vga std option, creating agraphics adapter. However, this is not very useful without being able toadd a keyboard and mouse as well. This patch addresses this by adding...
pseries: Rework irq assignment to avoid carrying qemu_irqs around
Currently, the interfaces in the pseries machine code for assignmentand setup of interrupts pass around qemu_irq objects. That was donein an attempt not to be too closely linked to the specific XICS...
pseries: Separate PCI RTAS setup from common from emulation specific PCI setup
Currently the RTAS functions for handling PCI are registered from theclass init code for the PCI host bridge. That sort of makes sensenow, but will break in the future when vfio gives us multiple types of...
pseries: added allocator for a block of IRQs
The patch adds a simple helper which allocates a consecutive sequenceof IRQs calling spapr_allocate_irq for each and checks that allocatedIRQs go consequently.
The patch is required for upcoming support of MSI/MSIX on POWER....
pseries: Add PCI MSI/MSI-X support
This patch implements MSI and MSI-X support for the pseries PCI hostbridge. To do this it adds:
spapr: Add support for -vga option
Also instanciate the USB keyboard and mouse when that option is used(you can still use -device to create individual devices without allthe defaults)
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com>...
PPC: spapr: Rework VGA select logic
When selecting our VGA adapter, we want to:
This patch reworks the logic so we fulfill the two conditions above....
PPC: spapr: Remove global variable
Global variables are bad. Let's move spapr_has_graphics into themachine state struct.
Signed-off-by: Alexander Graf <agraf@suse.de>
pseries: Remove extraneous prints
The pseries machine prints several messages to stderr whenever it starts upand another whenever the vm is reset. It's not normal for qemu machines todo this though, so this patch removes them. We can put them backconditional on a DEBUG symbol if we really need them in future....
pseries pci: spapr_populate_pci_devices renamed to spapr_populate_pci_dt
spapr_populate_pci_devices() populates the device tree only with busproperties and has nothing to do with the devices on it as PCI BARallocation is done by the system firmware (SLOF)....
pseries: Convert sPAPR TCEs to use generic IOMMU infrastructure
The pseries platform already contains an IOMMU implementation, since it isessential for the platform's paravirtualized VIO devices. This IOMMUsupport is currently built into the implementation of the VIO "bus" and...
pseries: Correctly create ibm,segment-page-sizes property
The core tcg/kvm code for ppc64 now has at least the outlinecapability to support pagesizes beyond the standard 4k and 16MB. TheCPUState is initialized with information advertising the available...
spapr: Add "memop" hypercall
This adds a qemu-specific hypervisor call to the pseries machinewhich allows to do what amounts to memmove, memcpy and xor overregions of physical memory such as the framebuffer.
This is the simplest way to get usable framebuffer speed from...
spapr: Use cpu_ppc_init() to obtain PowerPCCPU
Needed for spapr_cpu_reset().
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Alexander Graf <agraf@suse.de>
spapr: Pass PowerPCCPU to spapr_cpu_reset()
Allows us to use cpu_reset() in place of cpu_state_reset().
pseries: Implement automatic PAPR VIO address allocation
PAPR virtual IO (VIO) devices require a unique, but otherwise arbitrary,"address" used as a token to the hypercalls which manipulate them.
Currently the pseries machine code does an ok job of allocating these...
pseries: Add support for level interrupts to XICS
The pseries "xics" interrupt controller, like most interruptcontrollers can support both message (i.e. edge sensitive) interruptsand level sensitive interrupts, but it needs to know which are which.
When I implemented the xics emulation for qemu, the only devices we...
ppc hw/: Don't use CPUState
Scripted conversion: for file in hw/ppc*.[hc] hw/mpc8544_guts.c hw/spapr*.[hc] hw/virtex_ml507.c hw/xics.c; do sed -i "s/CPUState/CPUPPCState/g" $file done
Signed-off-by: Andreas Färber <afaerber@suse.de>Acked-by: Anthony Liguori <aliguori@us.ibm.com>
Rename cpu_reset() to cpu_state_reset()
Frees the identifier cpu_reset for QOM CPUs (manual rename).
Don't hide the parameter type behind explicit casts, use staticfunctions with strongly typed argument to indirect.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
vga: improve VGA logic
Improve VGA selection logic, push check for device availabilty to vl.c.Create the devices at board level unconditionally.
Remove now unused pci_try_create*() functions.
Make PCI VGA devices optional.
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>...
pseries: SLOF PCI flag day
Currently on the pseries machine the SLOF firmware is used normally,but we bypass it when -kernel is specified. Having these two
different boot paths can cause some confusion.
In particular at present we need to "probe" the (emulated) PCI bus and...
Merge branch 'ppc-next' of git://repo.or.cz/qemu/agraf
vmstate, memory: decouple vmstate from memory API
Currently creating a memory region automatically registers it forlive migration. This differs from other state (which is enumeratedin a VMStateDescription structure) and ties the live migration codeinto the memory core....
pseries: Populate "/chosen/linux,stdout-path" in the FDT
There is a device tree property "/chosen/linux,stdout-path" which indicateswhich device should be used as stdout - ie. "the console".
Currently we don't specify anything, which means both firmware and Linux...
pseries: FDT NUMA extensions to support multi-node guests
Add NUMA specific properties to guest's device tree to boot a multi-nodeguests. This patch adds the following properties:
ibm,associativityibm,architecture-vec-5ibm,associativity-reference-points...
pseries: Correct RAM size check for SLOF
The SLOF firmware used on the pseries machine needs a reasonable amount of(guest) RAM in order to run, so we have a check in the machine initfunction to check that this is available. However, SLOF runs in real mode...
pseries: Fix initialization of sPAPREnvironment structure
Since we added PCI support to the pseries machine, we include a qlist ofPCI host bridges in the sPAPREnvironment structure. However this listwas never properly initialized it. Somehow we got away with this until...
pseries: Add partial support for PCI
This patch adds a PCI bus to the pseries machine. This instantiatesthe qemu generic PCI bus code, advertises a PCI host bridge in theguest's device tree and implements the RTAS methods specified by PAPRto access PCI config space. It also sets up the memory regions we...
pseries: Correct vmx/dfp handling in both KVM and TCG cases
Currently, when KVM is enabled, the pseries machine checks if the hostCPU supports VMX, VSX and/or DFP instructions and advertisesaccordingly in the guest device tree. It does this regardless of what...
pseries: Under kvm use guest cpu = host cpu by default
Now that we've implemented -cpu host for ppc, this patch updates thepseries machine to use the host cpu as the guest cpu by default whenrunning under KVM. This is important because under KVM Book3S-HV the guest...
pseries: Support SMT systems for KVM Book3S-HV
Alex Graf has already made qemu support KVM for the pseries machinewhen using the Book3S-PR KVM variant (which runs the guest inusermode, emulating supervisor operations). This code allows gets usvery close to also working with KVM Book3S-HV (using the hypervisor...
pseries: Allow KVM Book3S-HV on PPC970 CPUS
At present, using the hypervisor aware Book3S-HV KVM will only workwith qemu on POWER7 CPUs. PPC970 CPUs also have hypervisorcapability, but they lack the VRMA feature which makes assigning guestmemory easier....
pseries: Add device tree properties for VMX/VSX and DFP under kvm
Sufficiently recent PAPR specifications define properties "ibm,vmx" and "ibm,dfp" on the CPU node which advertise whether the VMX vectorextensions (or the later VSX version) and/or the Decimal Floating...
spapr: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
pseries: Refactor spapr irq allocation
Paulo Bonzini changed the original spapr code, which manually assigned irqnumbers for each virtual device, to allocate them automatically from thedevice initialization. That allowed spapr virtual devices to be constructed...
pseries: use macro for firmware filename
For some time we've had a nicely defined macro with the filename for ourfirmware image. However we didn't actually use it in the place we'resupposed to. This patch fixes it.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>...
pseries: Implement hcall-bulk hypervisor interface
This patch adds support for the H_REMOVE_BULK hypercall on the pseriesmachine. Strictly speaking this isn't necessarym since the kernel willonly attempt to use this if hcall-bulk is advertised in the device tree,...
pseries: interrupt controller should not have a 'reg' property
The interrupt controller presented in the device tree for the pseriesmachine is manipulated by the guest only through hypervisor calls. Ithas no real or emulated registers for the guest to access....
pseries: More complete WIMG validation in H_ENTER code
Currently our implementation of the H_ENTER hypercall, which inserts amapping in the hash page table assumes that only ordinary memory is evermapped, and only permits mapping attribute bits accordingly (WIMG==0010)....
PPC: Enable to use PAPR with PR style KVM
When running PR style KVM, we need to tell the kernel that we wantto run in PAPR mode now. This means that we need to pass some moreregister information down and enable papr mode. We also need to alignthe HTAB to htab_size boundary....
PPC: SPAPR: Use KVM function for time info
One of the things we can't fake on PPC is the timer speed. Sowe need to extract the frequency information from the host andput it back into the guest device tree.
Luckily, we already have functions for that from the non-pseries...
pseries: Add a phandle to the xicp interrupt controller device tree node
Future devices we will be adding to the pseries machine (e.g. PCI) willneed nodes in the device tree which explicitly reference the top-levelinterrupt controller via interrupt-parent or interrupt-map properties....
spapr: proper qdevification
Right now the spapr devices cannot be instantiated with -device,because the IRQs need to be passed to the spapr_*_create functions.Do this instead in the bus's init wrapper.
This is particularly important with the conversion from scsi-disk...
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pseries: Increase maximum CPUs to 256
The original pSeries machine was limited to 32 CPUs, more or lessarbitrarily. Particularly when we get SMT KVM guests it will bepretty easy to exceed this. Therefore, raise the max number of CPUsin a pseries machine guest to 256....
Make pSeries 'model' property more closely resemble real hardware
Currently, the qemu emulated pseries machine puts"qemu,emulated-pSeries-LPAR" in the device tree's root level 'model'property. Unfortunately this confuses some installers and ybin, which...
Place pseries vty devices at addresses more similar to existing machines
Currently the qemu pseries machine numbers its virtual serial devicesfrom 0. However, existing pSeries machines running pHyp number them from0x30000000.
In theory these indices are arbitrary, since everything necessary for the...
pseries: Abolish envs array
Currently the pseries machine init code builds up an array, envs, ofCPUState pointers for all the cpus in the system. This is kind ofpointless, given the generic code already has a perfectly good linked listof the cpus.
In addition, there are a number of places which assume that the cpu's...
Delay creation of pseries device tree until reset
At present, the 'pseries' machine creates a flattened device tree in themachine->init function to pass to either the guest kernel or to firmware.
However, the machine->init function runs before processing of -device...
Implement PAPR virtual SCSI interface (ibmvscsi)
This patch implements the infrastructure and hypercalls necessary forthe PAPR specified Virtual SCSI interface. This is the normal methodfor providing (virtual) disks to PAPR partitions.
Signed-off-by: Ben Herrenschmidt <benh@kernel.crashing.org>...
Implement PAPR VPA functions for pSeries shared processor partitions
Shared-processor partitions are those where a CPU is time-sliced betweenpartitions, rather than being permanently dedicated to a singlepartition. qemu emulated partitions, since they are just scheduled with...
Add SLOF-based partition firmware for pSeries machine, allowing more boot options
Currently, the emulated pSeries machine requires the use of the-kernel parameter in order to explicitly load a guest kernel. Thismeans booting from the virtual disk, cdrom or network is not possible....
Implement hcall based RTAS for pSeries machines
On pSeries machines, operating systems can instantiate "RTAS" (Run-TimeAbstraction Services), a runtime component of the firmware which implementsa number of low-level, infrequently used operations. On logical partitions...
Implement assorted pSeries hcalls and RTAS methods
This patch adds several small utility hypercalls and RTAS methods tothe pSeries platform emulation. Specifically:
This just prints a character to the console, it's occasionally used...
Implement the PAPR (pSeries) virtualized interrupt controller (xics)
PAPR defines an interrupt control architecture which is logically dividedinto ICS (Interrupt Control Presentation, each unit is responsible forpresenting interrupts to a particular "interrupt server", i.e. CPU) and...
Add PAPR H_VIO_SIGNAL hypercall and infrastructure for VIO interrupts
This patch adds infrastructure to support interrupts from PAPR virtual IOdevices. This includes correctly advertising those interrupts in thedevice tree, and implementing the H_VIO_SIGNAL hypercall, used to...
Add (virtual) interrupt to PAPR virtual tty device
Now that we have implemented the PAPR "xics" virtualized interruptcontroller, we can add interrupts in PAPR VIO devices. This patch addsinterrupt support to the PAPR virtual tty/console device.
Signed-off-by: David Gibson <dwg@au1.ibm.com>...
Implement TCE translation for sPAPR VIO
This patch implements the necessary infrastructure and hypercalls forsPAPR's TCE (Translation Control Entry) IOMMU mechanism. This is necessaryfor all virtual IO devices which do DMA (i.e. nearly all of them).
Implement sPAPR Virtual LAN (ibmveth)
This patch implements the PAPR specified Inter Virtual Machine LogicalLAN; that is the virtual hardware used by the Linux ibmveth driver.
Signed-off-by: Paul Mackerras <paulus@samba.org>Signed-off-by: David Gibson <dwg@au1.ibm.com>...
Implement PAPR CRQ hypercalls
This patch implements the infrastructure and hypercalls necessary for thePAPR specified CRQ (Command Request Queue) mechanism. This generalrequest queueing system is used by many of the PAPR virtual IO devices,including the virtual scsi adapter....
Start implementing pSeries logical partition machine
This patch adds a "pseries" machine to qemu. This aims to emulate alogical partition on an IBM pSeries machine, compliant to the"PowerPC Architecture Platform Requirements" (PAPR) document.
This initial version is quite limited, it implements a basic machine...
Implement the bus structure for PAPR virtual IO
This extends the "pseries" (PAPR) machine to include a virtual IO bussupporting the PAPR defined hypercall based virtual IO mechanisms.
So far only one VIO device is provided, the vty / vterm, providinga full console (polled only, for now)....
Virtual hash page table handling on pSeries machine
On pSeries logical partitions, excepting the old POWER4-style full systempartitions, the guest does not have direct access to the hardware pagetable. Instead, the pagetable exists in hypervisor memory, and the guest...