Re: [PATCH 0/15] Hypervisor-mode KVM on POWER7 and PPC970

2011-06-18 Thread Paul Mackerras
On Sat, Jun 18, 2011 at 04:34:14PM +0200, Alexander Graf wrote: > I just applied them on top of kvm-ppc-next and started compiling for > book3s_64_pr=M: > > arch/powerpc/kernel/exceptions-64s.S: Assembler messages: > arch/powerpc/kernel/exceptions-64s.S:314: Error: undefined symbol > `PACA_KVM_

[PATCH 08/15 revised] KVM: PPC: Split host-state fields out of kvmppc_book3s_shadow_vcpu

2011-06-18 Thread Paul Mackerras
There are several fields in struct kvmppc_book3s_shadow_vcpu that temporarily store bits of host state while a guest is running, rather than anything relating to the particular guest or vcpu. This splits them out into a new kvmppc_host_state structure and modifies the definitions in asm-offsets.c t

RE: NAND BBT corruption on MPC83xx

2011-06-18 Thread Mike Hench
Scott Wood wrote: > As for the corruption, could it be degradation from repeated reads of that > one page? Read Disturb. I Did not know SLC did that. It just takes 10x as long as MLC, on the order of a million reads. Supposedly erasing the block fixes it. It is not a permanent damage thing. I was

[PATCH 2/2][v2] powerpc: Add printk companion for ppc_md.progress

2011-06-18 Thread Dave Carroll
From: Dave Carroll This patch adds a printk companion to replace the udbg progress function when initmem is freed. Suggested-by: Milton Miller Suggested-by: Benjamin Herrenschmidt Signed-off-by: Dave Carroll --- [v2] This is a rebase of the original patch to Linus' current tree arch/power

[PATCH 1/2][v2] powerpc: Move free_initmem to common code

2011-06-18 Thread Dave Carroll
From: Dave Carroll The free_initmem function is basically duplicated in mm/init_32, and init_64, and is moved to the common 32/64-bit mm/mem.c. All other sections except init were removed in v2.6.15 by 6c45ab992e4299c869fb26427944a8f8ea177024 (powerpc: Remove section free() and linker script bit

Re: [PATCH 0/15] Hypervisor-mode KVM on POWER7 and PPC970

2011-06-18 Thread Alexander Graf
On 18.06.2011, at 10:27, Paul Mackerras wrote: > The following series of patches enable KVM to exploit the hardware > hypervisor mode on 64-bit Power ISA Book3S machines. At present, > POWER7 and PPC970 processors are supported. (Note that the PPC970 > processors in Apple G5 machines don't have

[PATCH 15/15] KVM: PPC: book3s_hv: Add support for PPC970-family processors

2011-06-18 Thread Paul Mackerras
This adds support for running KVM guests in supervisor mode on those PPC970 processors that have a usable hypervisor mode. Unfortunately, Apple G5 machines have supervisor mode disabled (MSR[HV] is forced to 1), but the YDL PowerStation does have a usable hypervisor mode. There are several differ

[PATCH 14/15] powerpc, KVM: Split HVMODE_206 cpu feature bit into separate HV and architecture bits

2011-06-18 Thread Paul Mackerras
This replaces the single CPU_FTR_HVMODE_206 bit with two bits, one to indicate that we have a usable hypervisor mode, and another to indicate that the processor conforms to PowerISA version 2.06. We also add another bit to indicate that the processor conforms to ISA version 2.01 and set that for P

[PATCH 13/15] KVM: PPC: Allocate RMAs (Real Mode Areas) at boot for use by guests

2011-06-18 Thread Paul Mackerras
This adds infrastructure which will be needed to allow book3s_hv KVM to run on older POWER processors, including PPC970, which don't support the Virtual Real Mode Area (VRMA) facility, but only the Real Mode Offset (RMO) facility. These processors require a physically contiguous, aligned area of m

[PATCH 10/15] KVM: PPC: Handle some PAPR hcalls in the kernel

2011-06-18 Thread Paul Mackerras
This adds the infrastructure for handling PAPR hcalls in the kernel, either early in the guest exit path while we are still in real mode, or later once the MMU has been turned back on and we are in the full kernel context. The advantage of handling hcalls in real mode if possible is that we avoid

[PATCH 12/15] KVM: PPC: Allow book3s_hv guests to use SMT processor modes

2011-06-18 Thread Paul Mackerras
This lifts the restriction that book3s_hv guests can only run one hardware thread per core, and allows them to use up to 4 threads per core on POWER7. The host still has to run single-threaded. This capability is advertised to qemu through a new KVM_CAP_PPC_SMT capability. The return value of th

[PATCH 11/15] KVM: PPC: Accelerate H_PUT_TCE by implementing it in real mode

2011-06-18 Thread Paul Mackerras
From: David Gibson This improves I/O performance for guests using the PAPR paravirtualization interface by making the H_PUT_TCE hcall faster, by implementing it in real mode. H_PUT_TCE is used for updating virtual IOMMU tables, and is used both for virtual I/O and for real I/O in the PAPR interf

[PATCH 08/15] KVM: PPC: Split host-state fields out of kvmppc_book3s_shadow_vcpu

2011-06-18 Thread Paul Mackerras
There are several fields in struct kvmppc_book3s_shadow_vcpu that temporarily store bits of host state while a guest is running, rather than anything relating to the particular guest or vcpu. This splits them out into a new kvmppc_host_state structure and modifies the definitions in asm-offsets.c t

[PATCH 07/15] powerpc: Set up LPCR for running guest partitions

2011-06-18 Thread Paul Mackerras
In hypervisor mode, the LPCR controls several aspects of guest partitions, including virtual partition memory mode, and also controls whether the hypervisor decrementer interrupts are enabled. This sets up LPCR at boot time so that guest partitions will use a virtual real memory area (VRMA) compos

[PATCH 06/15] KVM: PPC: Move guest enter/exit down into subarch-specific code

2011-06-18 Thread Paul Mackerras
Instead of doing the kvm_guest_enter/exit() and local_irq_dis/enable() calls in powerpc.c, this moves them down into the subarch-specific book3s_pr.c and booke.c. This eliminates an extra local_irq_enable() call in book3s_pr.c, and will be needed for when we do SMT4 guest support in the book3s hyp

[PATCH 05/15] KVM: PPC: Pass init/destroy vm and prepare/commit memory region ops down

2011-06-18 Thread Paul Mackerras
This arranges for the top-level arch/powerpc/kvm/powerpc.c file to pass down some of the calls it gets to the lower-level subarchitecture specific code. The lower-level implementations (in booke.c and book3s.c) are no-ops. The coming book3s_hv.c will need this. Signed-off-by: Paul Mackerras ---

[PATCH 0/15] Hypervisor-mode KVM on POWER7 and PPC970

2011-06-18 Thread Paul Mackerras
The following series of patches enable KVM to exploit the hardware hypervisor mode on 64-bit Power ISA Book3S machines. At present, POWER7 and PPC970 processors are supported. (Note that the PPC970 processors in Apple G5 machines don't have a usable hypervisor mode and are not supported by these

[PATCH 04/15] KVM: PPC: Deliver program interrupts right away instead of queueing them

2011-06-18 Thread Paul Mackerras
Doing so means that we don't have to save the flags anywhere and gets rid of the last reference to to_book3s(vcpu) in arch/powerpc/kvm/book3s.c. Doing so is OK because a program interrupt won't be generated at the same time as any other synchronous interrupt. If a program interrupt and an asynchr

[PATCH 03/15] powerpc, KVM: Rework KVM checks in first-level interrupt handlers

2011-06-18 Thread Paul Mackerras
Instead of branching out-of-line with the DO_KVM macro to check if we are in a KVM guest at the time of an interrupt, this moves the KVM check inline in the first-level interrupt handlers. This speeds up the non-KVM case and makes sure that none of the interrupt handlers are missing the check. Be

[PATCH 01/15] KVM: PPC: Move fields between struct kvm_vcpu_arch and kvmppc_vcpu_book3s

2011-06-18 Thread Paul Mackerras
This moves the slb field, which represents the state of the emulated SLB, from the kvmppc_vcpu_book3s struct to the kvm_vcpu_arch, and the hpte_hash_[v]pte[_long] fields from kvm_vcpu_arch to kvmppc_vcpu_book3s. This is in accord with the principle that the kvm_vcpu_arch struct represents the state