diff mbox series

[1/4] ppc/spapr: H_ENTER_NESTED should restore host XER ca field

Message ID 20230608091344.88685-2-npiggin@gmail.com
State New
Headers show
Series ppc/spapr: Nested HV fix and tidying | expand

Commit Message

Nicholas Piggin June 8, 2023, 9:13 a.m. UTC
Fix missing env->ca restore when going from L2 back to the host.

Fixes: 120f738a467 ("spapr: implement nested-hv capability for the virtual hypervisor")
Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 hw/ppc/spapr_hcall.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Harsh Prateek Bora June 9, 2023, 7:05 a.m. UTC | #1
Since we have the spapr_exit_nested routine that gets executed during 
return path which contains the below change, I think mentioning 
spapr_exit_nested in the title may be more specific/appropriate.

On 6/8/23 14:43, Nicholas Piggin wrote:
> Fix missing env->ca restore when going from L2 back to the host.
> 
> Fixes: 120f738a467 ("spapr: implement nested-hv capability for the virtual hypervisor")
> Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---
>   hw/ppc/spapr_hcall.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
> index b904755575..0582b524d1 100644
> --- a/hw/ppc/spapr_hcall.c
> +++ b/hw/ppc/spapr_hcall.c
> @@ -1773,6 +1773,7 @@ out_restore_l1:
>       env->cfar = spapr_cpu->nested_host_state->cfar;
>       env->xer = spapr_cpu->nested_host_state->xer;
>       env->so = spapr_cpu->nested_host_state->so;
> +    env->ca = spapr_cpu->nested_host_state->ca;
>       env->ov = spapr_cpu->nested_host_state->ov;
>       env->ov32 = spapr_cpu->nested_host_state->ov32;
>       env->ca32 = spapr_cpu->nested_host_state->ca32;
Nicholas Piggin June 14, 2023, 11:53 a.m. UTC | #2
On Fri Jun 9, 2023 at 5:05 PM AEST, Harsh Prateek Bora wrote:
> Since we have the spapr_exit_nested routine that gets executed during 
> return path which contains the below change, I think mentioning 
> spapr_exit_nested in the title may be more specific/appropriate.

It's the H_ENTER_NESTED call from the host though. I think that's
the right subject, changelog then says the bug is when returning
back to the host.

Thanks,
Nick



>
> On 6/8/23 14:43, Nicholas Piggin wrote:
> > Fix missing env->ca restore when going from L2 back to the host.
> > 
> > Fixes: 120f738a467 ("spapr: implement nested-hv capability for the virtual hypervisor")
> > Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
> > Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> > ---
> >   hw/ppc/spapr_hcall.c | 1 +
> >   1 file changed, 1 insertion(+)
> > 
> > diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
> > index b904755575..0582b524d1 100644
> > --- a/hw/ppc/spapr_hcall.c
> > +++ b/hw/ppc/spapr_hcall.c
> > @@ -1773,6 +1773,7 @@ out_restore_l1:
> >       env->cfar = spapr_cpu->nested_host_state->cfar;
> >       env->xer = spapr_cpu->nested_host_state->xer;
> >       env->so = spapr_cpu->nested_host_state->so;
> > +    env->ca = spapr_cpu->nested_host_state->ca;
> >       env->ov = spapr_cpu->nested_host_state->ov;
> >       env->ov32 = spapr_cpu->nested_host_state->ov32;
> >       env->ca32 = spapr_cpu->nested_host_state->ca32;
diff mbox series

Patch

diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index b904755575..0582b524d1 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -1773,6 +1773,7 @@  out_restore_l1:
     env->cfar = spapr_cpu->nested_host_state->cfar;
     env->xer = spapr_cpu->nested_host_state->xer;
     env->so = spapr_cpu->nested_host_state->so;
+    env->ca = spapr_cpu->nested_host_state->ca;
     env->ov = spapr_cpu->nested_host_state->ov;
     env->ov32 = spapr_cpu->nested_host_state->ov32;
     env->ca32 = spapr_cpu->nested_host_state->ca32;