Re: [PATCH 1/4 v6] powerpc: export debug registers save function for KVM

2013-07-25 Thread Alexander Graf
On 04.07.2013, at 08:57, Bharat Bhushan wrote: KVM need this function when switching from vcpu to user-space thread. My subsequent patch will use this function. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com Ben / Michael, please ack. Alex --- v5-v6 -

Re: [PATCH 1/8] KVM: PPC: Book3S PR: Load up SPRG3 register with guest value on guest entry

2013-07-25 Thread Alexander Graf
On 11.07.2013, at 13:49, Paul Mackerras wrote: Unlike the other general-purpose SPRs, SPRG3 can be read by usermode code, and is used in recent kernels to store the CPU and NUMA node numbers so that they can be read by VDSO functions. Thus we need to load the guest's SPRG3 value into the

Re: [PATCH 1/8] KVM: PPC: Book3S PR: Load up SPRG3 register with guest value on guest entry

2013-07-25 Thread Alexander Graf
On 25.07.2013, at 15:38, Alexander Graf wrote: On 11.07.2013, at 13:49, Paul Mackerras wrote: Unlike the other general-purpose SPRs, SPRG3 can be read by usermode code, and is used in recent kernels to store the CPU and NUMA node numbers so that they can be read by VDSO functions. Thus

Re: [PATCH 2/8] KVM: PPC: Book3S PR: Keep volatile reg values in vcpu rather than shadow_vcpu

2013-07-25 Thread Alexander Graf
On 11.07.2013, at 13:50, Paul Mackerras wrote: Currently PR-style KVM keeps the volatile guest register values (R0 - R13, CR, LR, CTR, XER, PC) in a shadow_vcpu struct rather than the main kvm_vcpu struct. For 64-bit, the shadow_vcpu exists in two places, a kmalloc'd struct and in the PACA,

Re: [PATCH 2/2] kvm: powerpc: set cache coherency only for kernel managed pages

2013-07-25 Thread Alexander Graf
On 25.07.2013, at 10:50, Gleb Natapov wrote: On Wed, Jul 24, 2013 at 03:32:49PM -0500, Scott Wood wrote: On 07/24/2013 04:39:59 AM, Alexander Graf wrote: On 24.07.2013, at 11:35, Gleb Natapov wrote: On Wed, Jul 24, 2013 at 11:21:11AM +0200, Alexander Graf wrote: Are not we going to use

Re: [PATCH 2/2] kvm: powerpc: set cache coherency only for kernel managed pages

2013-07-25 Thread Gleb Natapov
On Thu, Jul 25, 2013 at 06:07:55PM +0200, Alexander Graf wrote: On 25.07.2013, at 10:50, Gleb Natapov wrote: On Wed, Jul 24, 2013 at 03:32:49PM -0500, Scott Wood wrote: On 07/24/2013 04:39:59 AM, Alexander Graf wrote: On 24.07.2013, at 11:35, Gleb Natapov wrote: On Wed, Jul 24,

[PATCH 1/4] powerpc: book3e: _PAGE_LENDIAN must be _PAGE_ENDIAN

2013-07-25 Thread Bharat Bhushan
For booke3e _PAGE_ENDIAN is not defined. Infact what is defined is _PAGE_LENDIAN which is wrong and that should be _PAGE_ENDIAN. There are no compilation errors as arch/powerpc/include/asm/pte-common.h defines _PAGE_ENDIAN to 0 as it is not defined anywhere. Signed-off-by: Bharat Bhushan

[PATCH 3/4] kvm: powerpc: allow guest control G attribute in mas2

2013-07-25 Thread Bharat Bhushan
G bit in MAS2 indicates whether the page is Guarded. There is no reason to stop guest setting G, so allow him. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- arch/powerpc/kvm/e500.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kvm/e500.h

[PATCH 4/4] kvm: powerpc: set cache coherency only for RAM pages

2013-07-25 Thread Bharat Bhushan
If the page is RAM then map this as cacheable and coherent (set M bit) otherwise this page is treated as I/O and map this as cache inhibited and guarded (set I + G) This helps setting proper MMU mapping for direct assigned device. NOTE: There can be devices that require cacheable mapping, which