Merge tag 'kvm-s390-master-6.8-1' of https://git.kernel.org/pub/scm/linux/kernel...
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 26 Jan 2024 17:57:12 +0000 (12:57 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 26 Jan 2024 17:57:12 +0000 (12:57 -0500)
pqap instruction missing cc fix
vsie shadow creation race fix

1  2 
arch/s390/kvm/vsie.c

diff --combined arch/s390/kvm/vsie.c
index fef42e2a80a2ae5bc47eae89f2b4e38293a2586b,db9a180de65f1f3029bfbb0870f35ba5788f3287..3af3bd20ac7b8f075e08b85b34f7e257f4687eeb
@@@ -19,7 -19,6 +19,7 @@@
  #include <asm/nmi.h>
  #include <asm/dis.h>
  #include <asm/fpu/api.h>
 +#include <asm/facility.h>
  #include "kvm-s390.h"
  #include "gaccess.h"
  
@@@ -985,26 -984,12 +985,26 @@@ static void retry_vsie_icpt(struct vsie
  static int handle_stfle(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
  {
        struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s;
 -      __u32 fac = READ_ONCE(vsie_page->scb_o->fac) & 0x7ffffff8U;
 +      __u32 fac = READ_ONCE(vsie_page->scb_o->fac);
  
 +      /*
 +       * Alternate-STFLE-Interpretive-Execution facilities are not supported
 +       * -> format-0 flcb
 +       */
        if (fac && test_kvm_facility(vcpu->kvm, 7)) {
                retry_vsie_icpt(vsie_page);
 +              /*
 +               * The facility list origin (FLO) is in bits 1 - 28 of the FLD
 +               * so we need to mask here before reading.
 +               */
 +              fac = fac & 0x7ffffff8U;
 +              /*
 +               * format-0 -> size of nested guest's facility list == guest's size
 +               * guest's size == host's size, since STFLE is interpretatively executed
 +               * using a format-0 for the guest, too.
 +               */
                if (read_guest_real(vcpu, fac, &vsie_page->fac,
 -                                  sizeof(vsie_page->fac)))
 +                                  stfle_size() * sizeof(u64)))
                        return set_validity_icpt(scb_s, 0x1090U);
                scb_s->fac = (__u32)(__u64) &vsie_page->fac;
        }
@@@ -1235,7 -1220,6 +1235,6 @@@ static int acquire_gmap_shadow(struct k
        gmap = gmap_shadow(vcpu->arch.gmap, asce, edat);
        if (IS_ERR(gmap))
                return PTR_ERR(gmap);
-       gmap->private = vcpu->kvm;
        vcpu->kvm->stat.gmap_shadow_create++;
        WRITE_ONCE(vsie_page->gmap, gmap);
        return 0;