On 06.08.2013, at 06:18, Paul Mackerras wrote:

> This adds the code to interpret 64k HPTEs in the guest hashed page
> table (HPT), 64k SLB entries, and to tell the guest about 64k pages
> in kvm_vm_ioctl_get_smmu_info().  Guest 64k pages are still shadowed
> by 4k pages.
> 
> This also adds another hash table to the four we have already in
> book3s_mmu_hpte.c to allow us to find all the PTEs that we have
> instantiated that match a given 64k guest page.
> 
> The tlbie instruction changed starting with POWER6 to use a bit in
> the RB operand to indicate large page invalidations, and to use other
> RB bits to indicate the base and actual page sizes and the segment
> size.  64k pages came in slightly earlier, with POWER5++.  At present
> we use one bit in vcpu->arch.hflags to indicate that the emulated
> cpu supports 64k pages and also has the new tlbie definition.  If
> we ever want to support emulation of POWER5++, we will need to use
> another bit.
> 
> Signed-off-by: Paul Mackerras <pau...@samba.org>
> ---
> arch/powerpc/include/asm/kvm_asm.h    |  1 +
> arch/powerpc/include/asm/kvm_book3s.h |  6 +++
> arch/powerpc/include/asm/kvm_host.h   |  4 ++
> arch/powerpc/kvm/book3s_64_mmu.c      | 92 +++++++++++++++++++++++++++++++----
> arch/powerpc/kvm/book3s_mmu_hpte.c    | 50 +++++++++++++++++++
> arch/powerpc/kvm/book3s_pr.c          | 30 +++++++++++-
> 6 files changed, 173 insertions(+), 10 deletions(-)
> 
> 

[...]

> @@ -1127,8 +1144,13 @@ struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm 
> *kvm, unsigned int id)
>               goto uninit_vcpu;
> 
> #ifdef CONFIG_PPC_BOOK3S_64
> -     /* default to book3s_64 (970fx) */
> +     /*
> +      * Default to the same as the host if we're on a POWER7[+],
> +      * otherwise default to PPC970FX.
> +      */
>       vcpu->arch.pvr = 0x3C0301;
> +     if (cpu_has_feature(CPU_FTR_ARCH_206))
> +             vcpu->arch.pvr = mfspr(SPRN_PVR);

Unrelated change? Also, why? Any reasonable user space these days should set 
PVR anyways.

> #else
>       /* default to book3s_32 (750) */
>       vcpu->arch.pvr = 0x84202;
> @@ -1331,6 +1353,12 @@ int kvm_vm_ioctl_get_smmu_info(struct kvm *kvm, struct 
> kvm_ppc_smmu_info *info)
>       info->sps[1].enc[0].page_shift = 24;
>       info->sps[1].enc[0].pte_enc = 0;
> 
> +     /* 64k large page size */
> +     info->sps[2].page_shift = 16;
> +     info->sps[2].slb_enc = SLB_VSID_L | SLB_VSID_LP_01;
> +     info->sps[2].enc[0].page_shift = 16;
> +     info->sps[2].enc[0].pte_enc = 1;

We only support this with BOOK3S_HFLAG_MULTI_PGSIZE, no?


Alex

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to