Re: [kvm-unit-tests PATCH v3 5/6] s390x: lib: sie: don't reenter SIE on pgm int

Claudio Imbrenda
2023-06-05T10:47:34Z

On Mon, 5 Jun 2023 11:30:36 +0200
Janosch Frank <frankja@linux.ibm.com> wrote:

[,,,]

> > + */
> > +static inline uint16_t read_pgm_int_code(void)
> > +{
>
> No mb()?

is one needed there?

>
> > + return lowcore.pgm_int_code;
> > +}
> > +
> > #endif
> > diff --git a/lib/s390x/asm/mem.h b/lib/s390x/asm/mem.h
> > index 64ef59b546a4..94d58c34f53f 100644
> > --- a/lib/s390x/asm/mem.h
> > +++ b/lib/s390x/asm/mem.h
> > @@ -8,6 +8,7 @@
> > #ifndef _ASMS390X_MEM_H_
> > #define _ASMS390X_MEM_H_
> > #include <asm/arch_def.h>
> > +#include <asm/facility.h>
> >
> > /* create pointer while avoiding compiler warnings */
> > #define OPAQUE_PTR(x) ((void *)(((uint64_t)&lowcore) + (x)))
> > diff --git a/lib/s390x/sie.c b/lib/s390x/sie.c
> > index ffa8ec91a423..632740edd431 100644
> > --- a/lib/s390x/sie.c
> > +++ b/lib/s390x/sie.c
> > @@ -13,6 +13,7 @@
> > #include <libcflat.h>
> > #include <sie.h>
> > #include <asm/page.h>
> > +#include <asm/interrupt.h>
> > #include <libcflat.h>
> > #include <alloc_page.h>
> >
> > @@ -65,7 +66,8 @@ void sie(struct vm *vm)
> > /* also handle all interruptions in home space while in SIE */
> > irq_set_dat_mode(IRQ_DAT_ON, AS_HOME);
> >
> > - while (vm->sblk->icptcode == 0) {
> > + /* leave SIE when we have an intercept or an interrupt so the test can react to it */
> > + while (vm->sblk->icptcode == 0 && !read_pgm_int_code()) {
> > sie64a(vm->sblk, &vm->save_area);
> > sie_handle_validity(vm);
> > }
>