Home Home > GIT Browse > SLE12-SP5-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Rogers <brogers@suse.com>2019-08-21 16:30:34 -0600
committerBruce Rogers <brogers@suse.com>2019-08-21 16:30:34 -0600
commit5fc27f72bcaedb00dfae19bb7362cb5737a00186 (patch)
tree36ff3e75e92aa80821be8ef6d26ee1beddc6f305
parent81959b5177796714c09c27d7bfefdc0751856bda (diff)
Refresh
patches.arch/s390-sles15sp1-00-04-12-KVM-s390-Add-skey-emulation-fault-handling.patch. Needed to add 2 more lines of context because patch was being misapplied
-rw-r--r--patches.arch/s390-sles15sp1-00-04-12-KVM-s390-Add-skey-emulation-fault-handling.patch60
1 files changed, 49 insertions, 11 deletions
diff --git a/patches.arch/s390-sles15sp1-00-04-12-KVM-s390-Add-skey-emulation-fault-handling.patch b/patches.arch/s390-sles15sp1-00-04-12-KVM-s390-Add-skey-emulation-fault-handling.patch
index 714d062a5a..6b7fc143f9 100644
--- a/patches.arch/s390-sles15sp1-00-04-12-KVM-s390-Add-skey-emulation-fault-handling.patch
+++ b/patches.arch/s390-sles15sp1-00-04-12-KVM-s390-Add-skey-emulation-fault-handling.patch
@@ -27,7 +27,9 @@ Acked-by: Petr Tesarik <ptesarik@suse.com>
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
-@@ -1514,6 +1514,7 @@ static long kvm_s390_set_skeys(struct kv
+@@ -1549,10 +1549,11 @@ static long kvm_s390_get_skeys(struct kv
+ static long kvm_s390_set_skeys(struct kvm *kvm, struct kvm_s390_skeys *args)
+ {
uint8_t *keys;
uint64_t hva;
int srcu_idx, i, r = 0;
@@ -35,7 +37,11 @@ Acked-by: Petr Tesarik <ptesarik@suse.com>
if (args->flags != 0)
return -EINVAL;
-@@ -1538,9 +1539,11 @@ static long kvm_s390_set_skeys(struct kv
+
+ /* Enforce sane limit on memory allocation */
+@@ -1573,13 +1574,15 @@ static long kvm_s390_set_skeys(struct kv
+ /* Enable storage key handling for the guest */
+ r = s390_enable_skey();
if (r)
goto out;
@@ -48,7 +54,11 @@ Acked-by: Petr Tesarik <ptesarik@suse.com>
hva = gfn_to_hva(kvm, args->start_gfn + i);
if (kvm_is_error_hva(hva)) {
r = -EFAULT;
-@@ -1554,8 +1557,14 @@ static long kvm_s390_set_skeys(struct kv
+ break;
+ }
+@@ -1589,12 +1592,18 @@ static long kvm_s390_set_skeys(struct kv
+ r = -EINVAL;
+ break;
}
r = set_guest_storage_key(current->mm, hva, keys[i], 0);
@@ -65,9 +75,13 @@ Acked-by: Petr Tesarik <ptesarik@suse.com>
}
srcu_read_unlock(&kvm->srcu, srcu_idx);
up_read(&current->mm->mmap_sem);
+ out:
+ kvfree(keys);
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
-@@ -247,9 +247,10 @@ static int try_handle_skey(struct kvm_vc
+@@ -245,13 +245,14 @@ static int try_handle_skey(struct kvm_vc
+ return 0;
+ }
static int handle_iske(struct kvm_vcpu *vcpu)
{
@@ -79,7 +93,11 @@ Acked-by: Petr Tesarik <ptesarik@suse.com>
int rc;
vcpu->stat.instruction_iske++;
-@@ -263,18 +264,28 @@ static int handle_iske(struct kvm_vcpu *
+
+ if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE)
+@@ -261,31 +262,42 @@ static int handle_iske(struct kvm_vcpu *
+ if (rc)
+ return rc != -EAGAIN ? rc : 0;
kvm_s390_get_regs_rre(vcpu, &reg1, &reg2);
@@ -116,7 +134,7 @@ Acked-by: Petr Tesarik <ptesarik@suse.com>
vcpu->run->s.regs.gprs[reg1] &= ~0xff;
vcpu->run->s.regs.gprs[reg1] |= key;
return 0;
-@@ -282,8 +293,9 @@ static int handle_iske(struct kvm_vcpu *
+ }
static int handle_rrbe(struct kvm_vcpu *vcpu)
{
@@ -127,7 +145,11 @@ Acked-by: Petr Tesarik <ptesarik@suse.com>
int rc;
vcpu->stat.instruction_rrbe++;
-@@ -297,19 +309,27 @@ static int handle_rrbe(struct kvm_vcpu *
+
+ if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE)
+@@ -295,23 +307,31 @@ static int handle_rrbe(struct kvm_vcpu *
+ if (rc)
+ return rc != -EAGAIN ? rc : 0;
kvm_s390_get_regs_rre(vcpu, &reg1, &reg2);
@@ -164,7 +186,11 @@ Acked-by: Petr Tesarik <ptesarik@suse.com>
kvm_s390_set_psw_cc(vcpu, rc);
return 0;
}
-@@ -324,6 +344,7 @@ static int handle_sske(struct kvm_vcpu *
+
+ #define SSKE_NQ 0x8
+@@ -322,10 +342,11 @@ static int handle_sske(struct kvm_vcpu *
+ {
+ unsigned char m3 = vcpu->arch.sie_block->ipb >> 28;
unsigned long start, end;
unsigned char key, oldkey;
int reg1, reg2;
@@ -172,7 +198,11 @@ Acked-by: Petr Tesarik <ptesarik@suse.com>
int rc;
vcpu->stat.instruction_sske++;
-@@ -356,19 +377,28 @@ static int handle_sske(struct kvm_vcpu *
+
+ if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE)
+@@ -354,23 +375,32 @@ static int handle_sske(struct kvm_vcpu *
+ start = kvm_s390_real_to_abs(vcpu, start);
+ end = start + PAGE_SIZE;
}
while (start != end) {
@@ -207,7 +237,11 @@ Acked-by: Petr Tesarik <ptesarik@suse.com>
}
if (m3 & (SSKE_MC | SSKE_MR)) {
-@@ -944,15 +974,16 @@ static int handle_pfmf(struct kvm_vcpu *
+ if (m3 & SSKE_MB) {
+ /* skey in reg1 is unpredictable */
+@@ -947,36 +977,43 @@ static int handle_pfmf(struct kvm_vcpu *
+ default:
+ return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
}
while (start != end) {
@@ -228,7 +262,9 @@ Acked-by: Petr Tesarik <ptesarik@suse.com>
return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
}
-@@ -962,14 +993,20 @@ static int handle_pfmf(struct kvm_vcpu *
+ if (vcpu->run->s.regs.gprs[reg1] & PFMF_SK) {
+ int rc = kvm_s390_skey_check_enable(vcpu);
+
if (rc)
return rc;
down_read(&current->mm->mmap_sem);
@@ -254,3 +290,5 @@ Acked-by: Petr Tesarik <ptesarik@suse.com>
}
if (vcpu->run->s.regs.gprs[reg1] & PFMF_FSC) {
if (psw_bits(vcpu->arch.sie_block->gpsw).eaba == PSW_BITS_AMODE_64BIT) {
+ vcpu->run->s.regs.gprs[reg2] = end;
+ } else {