[Qemu-devel] [PATCH 08/26] Parse SDR1 on mtspr instead of at translate time

2011-03-15 Thread David Gibson
On ppc machines with hash table MMUs, the special purpose register SDR1 contains both the base address of the encoded size (hashed) page tables. At present, we interpret the SDR1 value within the address translation path. But because the encodings of the size for 32-bit and 64-bit are different t

[Qemu-devel] [PATCH 05/26] Implement missing parts of the logic for the POWER PURR

2011-03-15 Thread David Gibson
From: David Gibson The PURR (Processor Utilization Resource Register) is a register found on recent POWER CPUs. The guts of implementing it at least enough to get by are already present in qemu, however some of the helper functions needed to actually wire it up are missing. This patch adds the

[Qemu-devel] [PATCH 07/26] Clean up slb_lookup() function

2011-03-15 Thread David Gibson
The slb_lookup() function, used in the ppc translation path returns a number of slb entry fields in reference parameters. However, only one of the two callers of slb_lookup() actually wants this information. This patch, therefore, makes slb_lookup() return a simple pointer to the located SLB entr

[Qemu-devel] [PATCH 03/26] Add a hook to allow hypercalls to be emulated on PowerPC

2011-03-15 Thread David Gibson
From: David Gibson PowerPC and POWER chips since the POWER4 and 970 have a special hypervisor mode, and a corresponding form of the system call instruction which traps to the hypervisor. qemu currently has stub implementations of hypervisor mode. That is, the outline is there to allow qemu to r

[Qemu-devel] [PATCH 09/26] Use "hash" more consistently in ppc mmu code

2011-03-15 Thread David Gibson
Currently, get_segment() has a variable called hash. However it doesn't (quite) get the hash value for the ppc hashed page table. Instead it gets the hash shifted - effectively the offset of the hash bucket within the hash page table. As well, as being different to the normal use of plain "hash"

[Qemu-devel] [PATCH 04/26] Implement PowerPC slbmfee and slbmfev instructions

2011-03-15 Thread David Gibson
From: David Gibson For a 64-bit PowerPC target, qemu correctly implements translation through the segment lookaside buffer. Likewise it supports the slbmte instruction which is used to load entries into the SLB. However, it does not emulate the slbmfee and slbmfev instructions which read SLB en

[Qemu-devel] [PATCH 15/26] Virtual hash page table handling on pSeries machine

2011-03-15 Thread David Gibson
On pSeries logical partitions, excepting the old POWER4-style full system partitions, the guest does not have direct access to the hardware page table. Instead, the pagetable exists in hypervisor memory, and the guest must manipulate it with hypercalls. However, our current pSeries emulation more

[Qemu-devel] [PATCH 10/26] Better factor the ppc hash translation path

2011-03-15 Thread David Gibson
Currently the path handling hash page table translation in get_segment() has a mix of common and 32 or 64 bit specific code. However the division is not done terribly well which results in a lot of messy code flipping between common and divided paths. This patch improves the organization, consoli

[Qemu-devel] [PATCH 11/26] Support 1T segments on ppc

2011-03-15 Thread David Gibson
Traditionally, the "segments" used for the two-stage translation used on powerpc MMUs were 256MB in size. This was the only option on all hash page table based 32-bit powerpc cpus, and on the earlier 64-bit hash page table based cpus. However, newer 64-bit cpus also permit 1TB segments This patc

[Qemu-devel] [PATCH 26/26] Implement PAPR VPA functions for pSeries shared processor partitions

2011-03-15 Thread David Gibson
Shared-processor partitions are those where a CPU is time-sliced between partitions, rather than being permanently dedicated to a single partition. qemu emulated partitions, since they are just scheduled with the qemu user process, behave mostly like shared processor partitions. In order to bette

[Qemu-devel] [PATCH 19/26] Add PAPR H_VIO_SIGNAL hypercall and infrastructure for VIO interrupts

2011-03-15 Thread David Gibson
This patch adds infrastructure to support interrupts from PAPR virtual IO devices. This includes correctly advertising those interrupts in the device tree, and implementing the H_VIO_SIGNAL hypercall, used to enable and disable individual device interrupts. Signed-off-by: David Gibson --- hw/sp

[Qemu-devel] [PATCH 14/26] Implement the bus structure for PAPR virtual IO

2011-03-15 Thread David Gibson
This extends the "pseries" (PAPR) machine to include a virtual IO bus supporting the PAPR defined hypercall based virtual IO mechanisms. So far only one VIO device is provided, the vty / vterm, providing a full console (polled only, for now). Signed-off-by: David Gibson --- Makefile.target |

[Qemu-devel] [PATCH 12/26] Add POWER7 support for ppc

2011-03-15 Thread David Gibson
This adds emulation support for the recent POWER7 cpu to qemu. It's far from perfect - it's missing a number of POWER7 features so far, including any support for VSX or decimal floating point instructions. However, it's close enough to boot a kernel with the POWER7 PVR. Signed-off-by: David Gibs

[Qemu-devel] [PATCH 20/26] Add (virtual) interrupt to PAPR virtual tty device

2011-03-15 Thread David Gibson
Now that we have implemented the PAPR "xics" virtualized interrupt controller, we can add interrupts in PAPR VIO devices. This patch adds interrupt support to the PAPR virtual tty/console device. Signed-off-by: David Gibson --- hw/spapr.c |6 -- hw/spapr_vio.h |3 ++- hw/spapr_v

[Qemu-devel] [PATCH 21/26] Implement TCE translation for sPAPR VIO

2011-03-15 Thread David Gibson
From: Ben Herrenschmidt This patch implements the necessary infrastructure and hypercalls for sPAPR's TCE (Translation Control Entry) IOMMU mechanism. This is necessary for all virtual IO devices which do DMA (i.e. nearly all of them). Signed-off-by: Ben Herrenschmidt Signed-off-by: David Gibs

[Qemu-devel] [PATCH 17/26] Implement assorted pSeries hcalls and RTAS methods

2011-03-15 Thread David Gibson
This patch adds several small utility hypercalls and RTAS methods to the pSeries platform emulation. Specifically: * 'display-character' rtas call This just prints a character to the console, it's occasionally used for early debug of the OS. The support includes a hack to make this RTAS call re

[Qemu-devel] [PATCH 13/26] Start implementing pSeries logical partition machine

2011-03-15 Thread David Gibson
This patch adds a "pseries" machine to qemu. This aims to emulate a logical 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 and PAPR hypercall emulation. So fa

[Qemu-devel] [PATCH 23/26] Implement PAPR CRQ hypercalls

2011-03-15 Thread David Gibson
From: Ben Herrenschmidt This patch implements the infrastructure and hypercalls necessary for the PAPR specified CRQ (Command Request Queue) mechanism. This general request queueing system is used by many of the PAPR virtual IO devices, including the virtual scsi adapter. Signed-off-by: Ben Her

[Qemu-devel] [PATCH 18/26] Implement the PAPR (pSeries) virtualized interrupt controller (xics)

2011-03-15 Thread David Gibson
PAPR defines an interrupt control architecture which is logically divided into ICS (Interrupt Control Presentation, each unit is responsible for presenting interrupts to a particular "interrupt server", i.e. CPU) and ICS (Interrupt Control Source, each unit responsible for one or more hardware inte

[Qemu-devel] [PATCH 16/26] Implement hcall based RTAS for pSeries machines

2011-03-15 Thread David Gibson
On pSeries machines, operating systems can instantiate "RTAS" (Run-Time Abstraction Services), a runtime component of the firmware which implements a number of low-level, infrequently used operations. On logical partitions under a hypervisor, many of the RTAS functions require hypervisor privilege

[Qemu-devel] [PATCH 25/26] Add a PAPR TCE-bypass mechanism for the pSeries machine

2011-03-15 Thread David Gibson
From: Ben Herrenschmidt Usually, PAPR virtual IO devices use a virtual IOMMU mechanism, TCEs, to mediate all DMA transfers. While this is necessary for some sorts of operation, it can be complex to program and slow for others. This patch implements a mechanism for bypassing TCE translation, tre

[Qemu-devel] [PATCH 22/26] Implement sPAPR Virtual LAN (ibmveth)

2011-03-15 Thread David Gibson
This patch implements the PAPR specified Inter Virtual Machine Logical LAN; that is the virtual hardware used by the Linux ibmveth driver. Signed-off-by: Paul Mackerras Signed-off-by: David Gibson --- Makefile.target |2 +- hw/spapr.c | 21 +++- hw/spapr_llan.c | 476 +++

[Qemu-devel] [PATCH 24/26] Implement PAPR virtual SCSI interface (ibmvscsi)

2011-03-15 Thread David Gibson
This patch implements the infrastructure and hypercalls necessary for the PAPR specified Virtual SCSI interface. This is the normal method for providing (virtual) disks to PAPR partitions. Signed-off-by: Ben Herrenschmidt Signed-off-by: David Gibson --- Makefile.target |2 +- hw/ppc-viosr

[Qemu-devel] [PATCH 06/26] Correct ppc popcntb logic, implement popcntw and popcntd

2011-03-15 Thread David Gibson
From: David Gibson qemu already includes support for the popcntb instruction introduced in POWER5 (although it doesn't actually allow you to choose POWER5). However, the logic is slightly incorrect: it will generate results truncated to 32-bits when the CPU is in 32-bit mode. This is not normal

<    1   2   3