qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Henrique Barboza <danielhb413@gmail.com>
To: Nicholas Piggin <npiggin@gmail.com>, qemu-ppc@nongnu.org
Cc: qemu-devel@nongnu.org,
	Daniel Henrique Barboza <dbarboza@ventanamicro.com>,
	balaton@eik.bme.hu, Fabiano Rosas <farosas@suse.de>
Subject: Re: [PATCH v2] target/ppc: Fix nested-hv HEAI delivery
Date: Thu, 1 Jun 2023 17:42:46 -0300	[thread overview]
Message-ID: <a1a2262d-5a1d-9779-6f26-99e02845636d@gmail.com> (raw)
In-Reply-To: <20230530132127.385001-1-npiggin@gmail.com>

Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks,


Daniel

On 5/30/23 10:21, Nicholas Piggin wrote:
> ppc hypervisors turn HEAI interrupts into program interrupts injected
> into the guest that executed the illegal instruction, if the hypervisor
> doesn't handle it some other way.
> 
> The nested-hv implementation failed to account for this HEAI->program
> conversion. The virtual hypervisor wants to see the HEAI when running
> a nested guest, so that interrupt type can be returned to its KVM
> caller.
> 
> Fixes: 7cebc5db2eba6 ("target/ppc: Introduce a vhyp framework for nested HV support")
> Cc: balaton@eik.bme.hu
> Reviewed-by: Fabiano Rosas <farosas@suse.de>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
> Since v1:
> - Address review comments style and typo fixes
> 
>   target/ppc/excp_helper.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
> index d69bd0033a..0f7ed58673 100644
> --- a/target/ppc/excp_helper.c
> +++ b/target/ppc/excp_helper.c
> @@ -1387,9 +1387,12 @@ static void powerpc_excp_books(PowerPCCPU *cpu, int excp)
>   
>       /*
>        * We don't want to generate a Hypervisor Emulation Assistance
> -     * Interrupt if we don't have HVB in msr_mask (PAPR mode).
> +     * Interrupt if we don't have HVB in msr_mask (PAPR mode),
> +     * unless running a nested-hv guest, in which case the L1
> +     * kernel wants the interrupt.
>        */
> -    if (excp == POWERPC_EXCP_HV_EMU && !(env->msr_mask & MSR_HVB)) {
> +    if (excp == POWERPC_EXCP_HV_EMU && !(env->msr_mask & MSR_HVB) &&
> +            !books_vhyp_handles_hv_excp(cpu)) {
>           excp = POWERPC_EXCP_PROGRAM;
>       }
>   


      reply	other threads:[~2023-06-01 20:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-30 13:21 [PATCH v2] target/ppc: Fix nested-hv HEAI delivery Nicholas Piggin
2023-06-01 20:42 ` Daniel Henrique Barboza [this message]

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=a1a2262d-5a1d-9779-6f26-99e02845636d@gmail.com \
    --to=danielhb413@gmail.com \
    --cc=balaton@eik.bme.hu \
    --cc=dbarboza@ventanamicro.com \
    --cc=farosas@suse.de \
    --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).