From: David Gibson <david@gibson.dropbear.id.au>
To: Fabiano Rosas <farosas@linux.ibm.com>
Cc: danielhb413@gmail.com, qemu-ppc@nongnu.org,
qemu-devel@nongnu.org, npiggin@gmail.com, clg@kaod.org
Subject: Re: [PATCH 3/3] spapr: Move nested KVM hypercalls under a TCG only config.
Date: Fri, 18 Mar 2022 14:41:36 +1100 [thread overview]
Message-ID: <YjP/cHK+TQt5Rzpo@yekko> (raw)
In-Reply-To: <20220317172049.2681740-4-farosas@linux.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 2801 bytes --]
On Thu, Mar 17, 2022 at 02:20:49PM -0300, Fabiano Rosas wrote:
> These are the spapr virtual hypervisor implementation of the nested
> KVM API. They only make sense when running with TCG.
>
> Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
> ---
> hw/ppc/spapr_hcall.c | 20 +++++++++++++-------
> 1 file changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
> index c0bfc4bc9c..f2c802c155 100644
> --- a/hw/ppc/spapr_hcall.c
> +++ b/hw/ppc/spapr_hcall.c
> @@ -2,6 +2,7 @@
> #include "qemu/cutils.h"
> #include "qapi/error.h"
> #include "sysemu/hw_accel.h"
> +#include "sysemu/tcg.h"
> #include "sysemu/runstate.h"
> #include "qemu/log.h"
> #include "qemu/main-loop.h"
> @@ -1473,7 +1474,8 @@ target_ulong spapr_hypercall(PowerPCCPU *cpu, target_ulong opcode,
> return H_FUNCTION;
> }
>
> -/* TCG only */
> +#ifdef CONFIG_TCG
> +
> #define PRTS_MASK 0x1f
>
> static target_ulong h_set_ptbl(PowerPCCPU *cpu,
> @@ -1807,6 +1809,12 @@ out_restore_l1:
> g_free(spapr_cpu->nested_host_state);
> spapr_cpu->nested_host_state = NULL;
> }
> +#else
> +void spapr_exit_nested(PowerPCCPU *cpu, int excp)
> +{
> + g_assert_not_reached();
> +}
> +#endif
>
> #ifndef CONFIG_TCG
> static target_ulong h_softmmu(PowerPCCPU *cpu, SpaprMachineState *spapr,
> @@ -1829,7 +1837,10 @@ static void hypercall_register_softmmu(void)
> #else
> static void hypercall_register_softmmu(void)
> {
> - /* DO NOTHING */
> + spapr_register_hypercall(KVMPPC_H_SET_PARTITION_TABLE, h_set_ptbl);
> + spapr_register_hypercall(KVMPPC_H_ENTER_NESTED, h_enter_nested);
> + spapr_register_hypercall(KVMPPC_H_TLB_INVALIDATE, h_tlb_invalidate);
> + spapr_register_hypercall(KVMPPC_H_COPY_TOFROM_GUEST, h_copy_tofrom_guest);
This doesn't fit. This is specifically about the MMU hypercalls - if
you want to put other things in there it needs a name change at least.
> }
> #endif
>
> @@ -1888,11 +1899,6 @@ static void hypercall_register_types(void)
> spapr_register_hypercall(KVMPPC_H_CAS, h_client_architecture_support);
>
> spapr_register_hypercall(KVMPPC_H_UPDATE_DT, h_update_dt);
> -
> - spapr_register_hypercall(KVMPPC_H_SET_PARTITION_TABLE, h_set_ptbl);
> - spapr_register_hypercall(KVMPPC_H_ENTER_NESTED, h_enter_nested);
> - spapr_register_hypercall(KVMPPC_H_TLB_INVALIDATE, h_tlb_invalidate);
> - spapr_register_hypercall(KVMPPC_H_COPY_TOFROM_GUEST, h_copy_tofrom_guest);
> }
>
> type_init(hypercall_register_types)
--
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: 833 bytes --]
next prev parent reply other threads:[~2022-03-18 3:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-17 17:20 [PATCH 0/3] spapr: Nested TCG is TCG only Fabiano Rosas
2022-03-17 17:20 ` [PATCH 1/3] spapr: Ignore nested KVM hypercalls when not running TCG Fabiano Rosas
2022-03-18 3:29 ` David Gibson
2022-03-18 13:41 ` Fabiano Rosas
2022-03-21 3:57 ` David Gibson
2022-03-17 17:20 ` [PATCH 2/3] spapr: Move hypercall_register_softmmu Fabiano Rosas
2022-03-17 17:20 ` [PATCH 3/3] spapr: Move nested KVM hypercalls under a TCG only config Fabiano Rosas
2022-03-18 3:41 ` David Gibson [this message]
2022-03-18 13:46 ` Fabiano Rosas
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=YjP/cHK+TQt5Rzpo@yekko \
--to=david@gibson.dropbear.id.au \
--cc=clg@kaod.org \
--cc=danielhb413@gmail.com \
--cc=farosas@linux.ibm.com \
--cc=npiggin@gmail.com \
--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 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).