Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: s390: vsie: Accommodate ESA prefix pages

The prefix page address occupies a different number
of bits for z/Architecture versus ESA mode. Adjust the
definition to cover both, and permit an ESA mode
address within the nested codepath.

Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>

authored by

Eric Farman and committed by
Janosch Frank
c0dcada0 a9640e2e

+11 -4
+1 -2
arch/s390/include/asm/kvm_host_types.h
··· 137 137 struct kvm_s390_sie_block { 138 138 atomic_t cpuflags; /* 0x0000 */ 139 139 __u32 : 1; /* 0x0004 */ 140 - __u32 prefix : 18; 141 - __u32 : 1; 140 + __u32 prefix : 19; 142 141 __u32 ibc : 12; 143 142 __u8 reserved08[4]; /* 0x0008 */ 144 143 #define PROG_IN_SIE (1<<0)
+4 -1
arch/s390/kvm/kvm-s390.h
··· 122 122 #endif 123 123 } 124 124 125 - #define GUEST_PREFIX_SHIFT 13 125 + #define GUEST_PREFIX_SHIFT 12 126 + #define GUEST_PREFIX_MASK_ZARCH 0x7fffe 127 + #define GUEST_PREFIX_MASK_ESA 0x7ffff 126 128 static inline u32 kvm_s390_get_prefix(struct kvm_vcpu *vcpu) 127 129 { 128 130 return vcpu->arch.sie_block->prefix << GUEST_PREFIX_SHIFT; ··· 135 133 VCPU_EVENT(vcpu, 3, "set prefix of cpu %03u to 0x%x", vcpu->vcpu_id, 136 134 prefix); 137 135 vcpu->arch.sie_block->prefix = prefix >> GUEST_PREFIX_SHIFT; 136 + vcpu->arch.sie_block->prefix &= GUEST_PREFIX_MASK_ZARCH; 138 137 kvm_make_request(KVM_REQ_TLB_FLUSH, vcpu); 139 138 kvm_make_request(KVM_REQ_REFRESH_GUEST_PREFIX, vcpu); 140 139 }
+6 -1
arch/s390/kvm/vsie.c
··· 479 479 struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; 480 480 /* READ_ONCE does not work on bitfields - use a temporary variable */ 481 481 const uint32_t __new_prefix = scb_o->prefix; 482 - const uint32_t new_prefix = READ_ONCE(__new_prefix); 482 + uint32_t new_prefix = READ_ONCE(__new_prefix); 483 483 const bool wants_tx = READ_ONCE(scb_o->ecb) & ECB_TE; 484 484 bool had_tx = scb_s->ecb & ECB_TE; 485 485 unsigned long new_mso = 0; ··· 526 526 scb_s->ictl |= ICTL_ISKE | ICTL_SSKE | ICTL_RRBE; 527 527 528 528 scb_s->icpua = scb_o->icpua; 529 + 530 + if (!(atomic_read(&scb_s->cpuflags) & CPUSTAT_ZARCH)) 531 + new_prefix &= GUEST_PREFIX_MASK_ESA; 532 + else 533 + new_prefix &= GUEST_PREFIX_MASK_ZARCH; 529 534 530 535 if (!(atomic_read(&scb_s->cpuflags) & CPUSTAT_SM)) 531 536 new_mso = READ_ONCE(scb_o->mso) & 0xfffffffffff00000UL;