Fix idte_crste() to add the missing table-type bits and the missing "memory" clobber. Fixes: 5a74e3d93417 ("KVM: s390: KVM-specific bitfields and helper functions") Signed-off-by: Claudio Imbrenda Cc: stable@vger.kernel.org # 7.0+ --- arch/s390/kvm/gmap/dat.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/s390/kvm/gmap/dat.h b/arch/s390/kvm/gmap/dat.h index 687e1fa904d6..fb7e839a355f 100644 --- a/arch/s390/kvm/gmap/dat.h +++ b/arch/s390/kvm/gmap/dat.h @@ -640,20 +640,22 @@ static __always_inline void idte_crste(union crste *crstep, gfn_t gfn, unsigned unsigned long table_origin = __pa(crste_table_start(crstep)); unsigned long gaddr = gfn_to_gpa(gfn) & HPAGE_MASK; + table_origin |= crstep->val & _REGION_ENTRY_TYPE_MASK; + if (__builtin_constant_p(opt) && opt == 0) { /* flush without guest asce */ asm volatile("idte %[table_origin],0,%[gaddr],%[local]" : "+m" (*crstep) : [table_origin] "a" (table_origin), [gaddr] "a" (gaddr), [local] "i" (local) - : "cc"); + : "cc", "memory"); } else { /* flush with guest asce */ asm volatile("idte %[table_origin],%[asce],%[gaddr_opt],%[local]" : "+m" (*crstep) : [table_origin] "a" (table_origin), [gaddr_opt] "a" (gaddr | opt), [asce] "a" (asce.val), [local] "i" (local) - : "cc"); + : "cc", "memory"); } } -- 2.56.0