[PATCH 6/6 v5] kvm: powerpc: use caching attributes as per linux pte

2013-09-18 Thread Bharat Bhushan
KVM uses same WIM tlb attributes as the corresponding qemu pte. For this we now search the linux pte for the requested page and get these cache caching/coherency attributes from pte. Signed-off-by: Bharat Bhushan --- v4->v5 - No change arch/powerpc/include/asm/kvm_host.h |2 +- arch/powerp

[PATCH 5/6 v5] kvm: booke: clear host tlb reference flag on guest tlb invalidation

2013-09-18 Thread Bharat Bhushan
On booke, "struct tlbe_ref" contains host tlb mapping information (pfn: for guest-pfn to pfn, flags: attribute associated with this mapping) for a guest tlb entry. So when a guest creates a TLB entry then "struct tlbe_ref" is set to point to valid "pfn" and set attributes in "flags" field of the ab

[PATCH 3/6 v5] kvm: powerpc: allow guest control "G" attribute in mas2

2013-09-18 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 --- v1->v5 - no change arch/powerpc/kvm/e500.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kvm/e500.h b/ar

[PATCH 4/6 v5] kvm: powerpc: keep only pte search logic in lookup_linux_pte

2013-09-18 Thread Bharat Bhushan
lookup_linux_pte() was searching for a pte and also sets access flags is writable. This function now searches only pte while access flag setting is done explicitly. This pte lookup is not kvm specific, so moved to common code (asm/pgtable.h) My Followup patch will use this on booke. Signed-off-by

[PATCH 0/6 v5] kvm: powerpc: use cache attributes from linux pte

2013-09-18 Thread Bharat Bhushan
From: Bharat Bhushan First patch is a typo fix where book3e define _PAGE_LENDIAN while it should be defined as _PAGE_ENDIAN. This seems to show that this is never exercised :-) Second and third patch is to allow guest controlling "G"-Guarded and "E"-Endian TLB attributes respectively. Fourth

[PATCH 2/6 v5] kvm: powerpc: allow guest control "E" attribute in mas2

2013-09-18 Thread Bharat Bhushan
"E" bit in MAS2 bit indicates whether the page is accessed in Little-Endian or Big-Endian byte order. There is no reason to stop guest setting "E", so allow him." Signed-off-by: Bharat Bhushan --- v1->v5 - no change arch/powerpc/kvm/e500.h |2 +- 1 files changed, 1 insertions(+), 1 deletio

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

2013-09-18 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 --- v1

Re: [PATCH 19/23] KVM: PPC: Book3S: Select PR vs HV separately for each guest

2013-09-18 Thread Paul Mackerras
On Thu, Sep 12, 2013 at 11:17:11PM -0500, Alexander Graf wrote: > > It means you can only choose between HV and PR machine wide, while with this > patch set you give the user the flexibility to have HV and PR guests run in > parallel. > > I know that Anthony doesn't believe it's a valid use cas