From: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
To: David Gibson <david@gibson.dropbear.id.au>,
qemu-ppc@nongnu.org, aik@ozlabs.ru
Cc: qemu-devel@nongnu.org, agraf@suse.de, thuth@redhat.com,
lvivier@redhat.com, mdroth@linux.vnet.ibm.com, paulus@samba.org
Subject: Re: [Qemu-devel] [PATCH 2/6] target/ppc: Merge cpu_ppc_set_vhyp() with cpu_ppc_set_papr()
Date: Thu, 23 Feb 2017 15:27:11 +1100 [thread overview]
Message-ID: <1487824031.23895.8.camel@gmail.com> (raw)
In-Reply-To: <20170223020936.29220-3-david@gibson.dropbear.id.au>
On Thu, 2017-02-23 at 13:09 +1100, David Gibson wrote:
> cpu_ppc_set_papr() sets up various aspects of CPU state for use with
> PAPR
> paravirtualized guests. However, it doesn't set the virtual
> hypervisor,
> so callers must also call cpu_ppc_set_vhyp() so that PAPR hypercalls
> are
> handled properly. This is a bit silly, so fold setting the virtual
> hypervisor into cpu_ppc_set_papr().
>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> hw/ppc/spapr_cpu_core.c | 3 +--
> target/ppc/cpu.h | 3 +--
> target/ppc/translate_init.c | 10 +++-------
> 3 files changed, 5 insertions(+), 11 deletions(-)
>
> diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
> index 55cd045..76563c4 100644
> --- a/hw/ppc/spapr_cpu_core.c
> +++ b/hw/ppc/spapr_cpu_core.c
> @@ -57,8 +57,7 @@ static void spapr_cpu_init(sPAPRMachineState
> *spapr, PowerPCCPU *cpu,
> cpu_ppc_tb_init(env, SPAPR_TIMEBASE_FREQ);
>
> /* Enable PAPR mode in TCG or KVM */
> - cpu_ppc_set_vhyp(cpu, PPC_VIRTUAL_HYPERVISOR(spapr));
> - cpu_ppc_set_papr(cpu);
> + cpu_ppc_set_papr(cpu, PPC_VIRTUAL_HYPERVISOR(spapr));
>
> if (cpu->max_compat) {
> Error *local_err = NULL;
> diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
> index 425e79d..f99bcae 100644
> --- a/target/ppc/cpu.h
> +++ b/target/ppc/cpu.h
> @@ -1300,8 +1300,7 @@ void store_booke_tcr (CPUPPCState *env,
> target_ulong val);
> void store_booke_tsr (CPUPPCState *env, target_ulong val);
> void ppc_tlb_invalidate_all (CPUPPCState *env);
> void ppc_tlb_invalidate_one (CPUPPCState *env, target_ulong addr);
> -void cpu_ppc_set_vhyp(PowerPCCPU *cpu, PPCVirtualHypervisor *vhyp);
> -void cpu_ppc_set_papr(PowerPCCPU *cpu);
> +void cpu_ppc_set_papr(PowerPCCPU *cpu, PPCVirtualHypervisor *vhyp);
> #endif
> #endif
>
> diff --git a/target/ppc/translate_init.c
> b/target/ppc/translate_init.c
> index be35cbd..a1405e9 100644
> --- a/target/ppc/translate_init.c
> +++ b/target/ppc/translate_init.c
> @@ -8835,18 +8835,14 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void
> *data)
> }
>
> #if !defined(CONFIG_USER_ONLY)
> -
> -void cpu_ppc_set_vhyp(PowerPCCPU *cpu, PPCVirtualHypervisor *vhyp)
> -{
> - cpu->vhyp = vhyp;
> -}
> -
> -void cpu_ppc_set_papr(PowerPCCPU *cpu)
> +void cpu_ppc_set_papr(PowerPCCPU *cpu, PPCVirtualHypervisor *vhyp)
> {
> CPUPPCState *env = &cpu->env;
> ppc_spr_t *lpcr = &env->spr_cb[SPR_LPCR];
> ppc_spr_t *amor = &env->spr_cb[SPR_AMOR];
>
> + cpu->vhyp = vhyp;
> +
> /* PAPR always has exception vectors in RAM not ROM. To ensure
> this,
> * MSR[IP] should never be set.
> *
Sounds Good
Reviewed-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
next prev parent reply other threads:[~2017-02-23 4:27 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-23 2:09 [Qemu-devel] [PATCH 0/6] Cleanups to handling of hash MMU David Gibson
2017-02-23 2:09 ` [Qemu-devel] [PATCH 1/6] pseries: Minor cleanups to HPT management hypercalls David Gibson
2017-02-23 4:08 ` Suraj Jitindar Singh
2017-02-23 2:09 ` [Qemu-devel] [PATCH 2/6] target/ppc: Merge cpu_ppc_set_vhyp() with cpu_ppc_set_papr() David Gibson
2017-02-23 4:27 ` Suraj Jitindar Singh [this message]
2017-02-23 2:09 ` [Qemu-devel] [PATCH 3/6] target/ppc: SDR1 is a hypervisor resource David Gibson
2017-02-23 4:32 ` Suraj Jitindar Singh
2017-02-23 5:11 ` David Gibson
2017-02-23 2:09 ` [Qemu-devel] [PATCH 4/6] target/ppc: Cleanup HPTE accessors for 64-bit hash MMU David Gibson
2017-02-23 5:02 ` Alexey Kardashevskiy
2017-02-23 5:23 ` David Gibson
2017-02-27 5:06 ` David Gibson
2017-02-23 5:37 ` Suraj Jitindar Singh
2017-02-24 5:25 ` David Gibson
2017-02-23 2:09 ` [Qemu-devel] [PATCH 5/6] target/ppc: Eliminate htab_base and htab_mask variables David Gibson
2017-02-23 5:43 ` Alexey Kardashevskiy
2017-02-24 5:30 ` David Gibson
2017-02-23 5:52 ` Suraj Jitindar Singh
2017-02-24 3:45 ` David Gibson
2017-02-24 5:34 ` David Gibson
2017-02-23 2:09 ` [Qemu-devel] [PATCH 6/6] target/ppc: Manage external HPT via virtual hypervisor David Gibson
2017-02-23 6:20 ` Suraj Jitindar Singh
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=1487824031.23895.8.camel@gmail.com \
--to=sjitindarsingh@gmail.com \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=david@gibson.dropbear.id.au \
--cc=lvivier@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=paulus@samba.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=thuth@redhat.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 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.