qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Sam Bobroff <sam.bobroff@au1.ibm.com>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, sjitindarsingh@gmail.com
Subject: Re: [Qemu-devel] [RFC PATCH v2 07/12] target-ppc: support KVM_CAP_PPC_MMU_RADIX, KVM_CAP_PPC_MMU_HASH_V3
Date: Tue, 28 Feb 2017 11:13:05 +1100	[thread overview]
Message-ID: <20170228001305.GC17615@umbus.fritz.box> (raw)
In-Reply-To: <8d7198bfc4cf9a4f9a9f135cacdedaecd7b29990.1487829585.git.sam.bobroff@au1.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 3078 bytes --]

On Thu, Feb 23, 2017 at 05:00:00PM +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 <sam.bobroff@au1.ibm.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
> v2:
> 
> * cap_mmu_hash renamed to cap_mmu_hash_v3.
> 
>  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 cf62a42c1f..8b153808fd 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 8da2ee418a..56e222dfc2 100644
> --- a/target/ppc/kvm_ppc.h
> +++ b/target/ppc/kvm_ppc.h
> @@ -56,6 +56,8 @@ void kvmppc_hash64_write_pte(CPUPPCState *env, target_ulong pte_index,
>                               target_ulong pte0, target_ulong 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);
> @@ -262,6 +264,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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2017-02-28  0:36 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-23  5:59 [Qemu-devel] [RFC PATCH v2 00/12] ISA 3.00 KVM guest support Sam Bobroff
2017-02-23  5:59 ` [Qemu-devel] [RFC PATCH v2 01/12] spapr: Small cleanup of PPC MMU enums Sam Bobroff
2017-02-27  6:22   ` David Gibson
2017-02-23  5:59 ` [Qemu-devel] [RFC PATCH v2 02/12] scripts/update-linux-headers.sh: refactor extra files Sam Bobroff
2017-02-27  6:24   ` David Gibson
2017-02-23  5:59 ` [Qemu-devel] [RFC PATCH v2 03/12] scripts/update-linux-headers.sh: add new files for ARM Sam Bobroff
2017-02-23  5:59 ` [Qemu-devel] [RFC PATCH v2 04/12] Move virtio_mmio.h to fix update-linux-headers.sh Sam Bobroff
2017-02-24 16:40   ` Michael S. Tsirkin
2017-02-24 16:47   ` Michael S. Tsirkin
2017-02-28  2:23     ` Sam Bobroff
2017-02-23  5:59 ` [Qemu-devel] [RFC PATCH v2 05/12] Update headers using update-linux-headers.sh Sam Bobroff
2017-02-23  5:59 ` [Qemu-devel] [RFC PATCH v2 06/12] spapr: Add ibm, processor-radix-AP-encodings to the device tree Sam Bobroff
2017-02-28  0:12   ` David Gibson
2017-02-28  2:27     ` Suraj Jitindar Singh
2017-02-23  6:00 ` [Qemu-devel] [RFC PATCH v2 07/12] target-ppc: support KVM_CAP_PPC_MMU_RADIX, KVM_CAP_PPC_MMU_HASH_V3 Sam Bobroff
2017-02-28  0:13   ` David Gibson [this message]
2017-02-23  6:00 ` [Qemu-devel] [RFC PATCH v2 08/12] spapr: Only setup HTP if necessary Sam Bobroff
2017-02-28  0:28   ` David Gibson
2017-02-28  2:25     ` Suraj Jitindar Singh
2017-02-28  3:19       ` David Gibson
2017-03-01  5:17         ` Suraj Jitindar Singh
2017-03-03  5:04           ` David Gibson
2017-02-23  6:00 ` [Qemu-devel] [RFC PATCH v2 09/12] spapr: Add h_register_process_table() hypercall Sam Bobroff
2017-02-23  6:00 ` [Qemu-devel] [RFC PATCH v2 10/12] spapr: move spapr_populate_pa_features() Sam Bobroff
2017-02-28  0:29   ` David Gibson
2017-02-23  6:00 ` [Qemu-devel] [RFC PATCH v2 11/12] spapr: Enable ISA 3.0 MMU mode selection via CAS Sam Bobroff
2017-02-23  6:00 ` [Qemu-devel] [RFC PATCH v2 12/12] spapr: Workaround for broken radix guests Sam Bobroff
2017-02-28  0:36   ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170228001305.GC17615@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=sam.bobroff@au1.ibm.com \
    --cc=sjitindarsingh@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).