[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH v3 06/12] target-ppc: support KVM_CAP_PPC_MMU_RADI
From: |
David Gibson |
Subject: |
Re: [Qemu-ppc] [PATCH v3 06/12] target-ppc: support KVM_CAP_PPC_MMU_RADIX, KVM_CAP_PPC_MMU_HASH_V3 |
Date: |
Fri, 3 Mar 2017 14:38:10 +1100 |
User-agent: |
Mutt/1.7.1 (2016-10-04) |
On Thu, Mar 02, 2017 at 04:39:01PM +1100, Sam Bobroff wrote:
> Query and cache the value of two new KVM capabilities that indicate
> KVM's support for new radix and hash modes of the MMU.
>
> Signed-off-by: Sam Bobroff <address@hidden>
Reviewed-by: David Gibson <address@hidden>
> ---
> target/ppc/kvm.c | 14 ++++++++++++++
> target/ppc/kvm_ppc.h | 12 ++++++++++++
> 2 files changed, 26 insertions(+)
>
> diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
> index ee330d8993..adf12da1aa 100644
> --- a/target/ppc/kvm.c
> +++ b/target/ppc/kvm.c
> @@ -83,6 +83,8 @@ static int cap_papr;
> static int cap_htab_fd;
> static int cap_fixup_hcalls;
> static int cap_htm; /* Hardware transactional memory support */
> +static int cap_mmu_radix;
> +static int cap_mmu_hash_v3;
>
> static uint32_t debug_inst_opcode;
>
> @@ -136,6 +138,8 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
> cap_htab_fd = kvm_check_extension(s, KVM_CAP_PPC_HTAB_FD);
> cap_fixup_hcalls = kvm_check_extension(s, KVM_CAP_PPC_FIXUP_HCALL);
> cap_htm = kvm_vm_check_extension(s, KVM_CAP_PPC_HTM);
> + cap_mmu_radix = kvm_vm_check_extension(s, KVM_CAP_PPC_MMU_RADIX);
> + cap_mmu_hash_v3 = kvm_vm_check_extension(s, KVM_CAP_PPC_MMU_HASH_V3);
>
> if (!cap_interrupt_level) {
> fprintf(stderr, "KVM: Couldn't find level irq capability. Expect the
> "
> @@ -2430,6 +2434,16 @@ bool kvmppc_has_cap_htm(void)
> return cap_htm;
> }
>
> +bool kvmppc_has_cap_mmu_radix(void)
> +{
> + return cap_mmu_radix;
> +}
> +
> +bool kvmppc_has_cap_mmu_hash_v3(void)
> +{
> + return cap_mmu_hash_v3;
> +}
> +
> static PowerPCCPUClass *ppc_cpu_get_family_class(PowerPCCPUClass *pcc)
> {
> ObjectClass *oc = OBJECT_CLASS(pcc);
> diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h
> index 8e9f42d0c6..0cdbe9ea0b 100644
> --- a/target/ppc/kvm_ppc.h
> +++ b/target/ppc/kvm_ppc.h
> @@ -53,6 +53,8 @@ void kvmppc_read_hptes(ppc_hash_pte64_t *hptes, hwaddr
> ptex, int n);
> void kvmppc_write_hpte(hwaddr ptex, uint64_t pte0, uint64_t pte1);
> bool kvmppc_has_cap_fixup_hcalls(void);
> bool kvmppc_has_cap_htm(void);
> +bool kvmppc_has_cap_mmu_radix(void);
> +bool kvmppc_has_cap_mmu_hash_v3(void);
> int kvmppc_enable_hwrng(void);
> int kvmppc_put_books_sregs(PowerPCCPU *cpu);
> PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void);
> @@ -252,6 +254,16 @@ static inline bool kvmppc_has_cap_htm(void)
> return false;
> }
>
> +static inline bool kvmppc_has_cap_mmu_radix(void)
> +{
> + return false;
> +}
> +
> +static inline bool kvmppc_has_cap_mmu_hash_v3(void)
> +{
> + return false;
> +}
> +
> static inline int kvmppc_enable_hwrng(void)
> {
> return -1;
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
- Re: [Qemu-ppc] [PATCH v3 05/12] spapr: Add ibm, processor-radix-AP-encodings to the device tree, (continued)
- [Qemu-ppc] [PATCH v3 06/12] target-ppc: support KVM_CAP_PPC_MMU_RADIX, KVM_CAP_PPC_MMU_HASH_V3, Sam Bobroff, 2017/03/02
- Re: [Qemu-ppc] [PATCH v3 06/12] target-ppc: support KVM_CAP_PPC_MMU_RADIX, KVM_CAP_PPC_MMU_HASH_V3,
David Gibson <=
- [Qemu-ppc] [PATCH v3 10/12] spapr: move spapr_populate_pa_features(), Sam Bobroff, 2017/03/02
- [Qemu-ppc] [PATCH v3 11/12] spapr: Enable ISA 3.0 MMU mode selection via CAS, Sam Bobroff, 2017/03/02