summaryrefslogtreecommitdiff
path: root/arch/s390
diff options
context:
space:
mode:
authorClaudio Imbrenda <imbrenda@linux.ibm.com>2024-10-31 13:03:16 +0100
committerHeiko Carstens <hca@linux.ibm.com>2024-11-07 10:23:43 +0100
commit34fb045eddd300a2d1c0d7de7e83113215c422e3 (patch)
treebff1a4009d0a9464f9ea55cdcdd70bf2c9cd09a2 /arch/s390
parent64844729a608d308089510fc3bb23abf602f4e47 (diff)
s390/kvm: Mask extra bits from program interrupt code
The program interrupt code has some extra bits that are sometimes set by hardware for various reasons; those bits should be ignored when the program interrupt number is needed for interrupt handling. Fixes: 05066cafa925 ("s390/mm/fault: Handle guest-related program interrupts in KVM") Reported-by: Christian Borntraeger <borntraeger@linux.ibm.com> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Tested-by: Christian Borntraeger <borntraeger@linux.ibm.com> Link: https://lore.kernel.org/r/20241031120316.25462-1-imbrenda@linux.ibm.com Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kvm/kvm-s390.c2
-rw-r--r--arch/s390/kvm/vsie.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 5d113428b4cc..06e55f681a39 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -4737,7 +4737,7 @@ static int vcpu_post_run_handle_fault(struct kvm_vcpu *vcpu)
if (kvm_s390_cur_gmap_fault_is_write())
flags = FAULT_FLAG_WRITE;
- switch (current->thread.gmap_int_code) {
+ switch (current->thread.gmap_int_code & PGM_INT_CODE_MASK) {
case 0:
vcpu->stat.exit_null++;
break;
diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c
index d03f95e528fe..d3cdde1b18e5 100644
--- a/arch/s390/kvm/vsie.c
+++ b/arch/s390/kvm/vsie.c
@@ -922,7 +922,7 @@ static int handle_fault(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
{
int rc;
- if (current->thread.gmap_int_code == PGM_PROTECTION)
+ if ((current->thread.gmap_int_code & PGM_INT_CODE_MASK) == PGM_PROTECTION)
/* we can directly forward all protection exceptions */
return inject_fault(vcpu, PGM_PROTECTION,
current->thread.gmap_teid.addr * PAGE_SIZE, 1);