From: Alexander Graf <agraf@suse.de>
To: Alexey Kardashevskiy <aik@ozlabs.ru>, qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3 9/9] KVM: PPC: Enable compatibility mode
Date: Fri, 23 May 2014 14:34:35 +0200 [thread overview]
Message-ID: <537F405B.6070200@suse.de> (raw)
In-Reply-To: <1400812018-23430-10-git-send-email-aik@ozlabs.ru>
On 23.05.14 04:26, Alexey Kardashevskiy wrote:
> The host kernel implements a KVM_REG_PPC_ARCH_COMPAT register which
> this uses to enable a compatibility mode if any chosen.
>
> This sets the KVM_REG_PPC_ARCH_COMPAT register in KVM. ppc_set_compat()
> signals the caller if the mode cannot be enabled by the host kernel.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
> target-ppc/kvm.c | 5 +++++
> target-ppc/kvm_ppc.h | 6 ++++++
> target-ppc/translate_init.c | 5 +++++
> 3 files changed, 16 insertions(+)
>
> diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
> index ca31027..05952d0 100644
> --- a/target-ppc/kvm.c
> +++ b/target-ppc/kvm.c
> @@ -1514,6 +1514,11 @@ void kvmppc_set_papr(PowerPCCPU *cpu)
> cap_papr = 1;
> }
>
> +int kvmppc_set_compat(PowerPCCPU *cpu, uint32_t cpu_version)
> +{
> + return kvm_set_one_reg(CPU(cpu), KVM_REG_PPC_ARCH_COMPAT, &cpu_version);
> +}
> +
> void kvmppc_set_mpic_proxy(PowerPCCPU *cpu, int mpic_proxy)
> {
> CPUState *cs = CPU(cpu);
> diff --git a/target-ppc/kvm_ppc.h b/target-ppc/kvm_ppc.h
> index ff077ec..716c33d 100644
> --- a/target-ppc/kvm_ppc.h
> +++ b/target-ppc/kvm_ppc.h
> @@ -23,6 +23,7 @@ int kvmppc_get_hasidle(CPUPPCState *env);
> int kvmppc_get_hypercall(CPUPPCState *env, uint8_t *buf, int buf_len);
> int kvmppc_set_interrupt(PowerPCCPU *cpu, int irq, int level);
> void kvmppc_set_papr(PowerPCCPU *cpu);
> +int kvmppc_set_compat(PowerPCCPU *cpu, uint32_t cpu_version);
> void kvmppc_set_mpic_proxy(PowerPCCPU *cpu, int mpic_proxy);
> int kvmppc_smt_threads(void);
> int kvmppc_clear_tsr_bits(PowerPCCPU *cpu, uint32_t tsr_bits);
> @@ -95,6 +96,11 @@ static inline void kvmppc_set_papr(PowerPCCPU *cpu)
> {
> }
>
> +static inline int kvmppc_set_compat(PowerPCCPU *cpu, uint32_t cpu_version)
> +{
> + return 0;
> +}
> +
> static inline void kvmppc_set_mpic_proxy(PowerPCCPU *cpu, int mpic_proxy)
> {
> }
> diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
> index 56d3b97..ad5c27d 100644
> --- a/target-ppc/translate_init.c
> +++ b/target-ppc/translate_init.c
> @@ -8970,6 +8970,11 @@ int ppc_set_compat(PowerPCCPU *cpu, uint32_t cpu_version)
> break;
> }
>
> + if (kvmppc_set_compat(cpu, cpu->max_compat) < 0) {
This breaks with TCG. I've added a kvm_enabled() && check to make it work.
Alex
next prev parent reply other threads:[~2014-05-23 12:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-23 2:26 [Qemu-devel] [PATCH v3 0/9] spapr: Enable ibm, client-architecture-support Alexey Kardashevskiy
2014-05-23 2:26 ` [Qemu-devel] [PATCH v3 1/9] target-ppc: Add "compat" CPU option Alexey Kardashevskiy
2014-05-23 2:26 ` [Qemu-devel] [PATCH v3 2/9] spapr: Move SMT-related properties out of skeleton fdt Alexey Kardashevskiy
2014-05-23 2:26 ` [Qemu-devel] [PATCH v3 3/9] target-ppc: Implement "compat" CPU option Alexey Kardashevskiy
2014-05-23 2:26 ` [Qemu-devel] [PATCH v3 4/9] target-ppc: Define Processor Compatibility Masks Alexey Kardashevskiy
2014-05-23 2:26 ` [Qemu-devel] [PATCH v3 5/9] spapr: Add ibm, client-architecture-support call Alexey Kardashevskiy
2014-05-23 2:26 ` [Qemu-devel] [PATCH v3 6/9] spapr: Rework spapr_fixup_cpu_dt() Alexey Kardashevskiy
2014-05-23 2:26 ` [Qemu-devel] [PATCH v3 7/9] spapr: Limit threads per core according to current compatibility mode Alexey Kardashevskiy
2014-05-23 2:26 ` [Qemu-devel] [PATCH v3 8/9] spapr: Implement processor compatibility in ibm, client-architecture-support Alexey Kardashevskiy
2014-05-23 2:26 ` [Qemu-devel] [PATCH v3 9/9] KVM: PPC: Enable compatibility mode Alexey Kardashevskiy
2014-05-23 12:34 ` Alexander Graf [this message]
2014-05-23 11:19 ` [Qemu-devel] [PATCH v3 0/9] spapr: Enable ibm, client-architecture-support Alexander Graf
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=537F405B.6070200@suse.de \
--to=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.