Skip to content

Commit f0a2388

Browse files
committed
Merge tag 'kvm-s390-next-6.11-1' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD
Assortment of tiny fixes which are not time critical: - Rejecting memory region operations for ucontrol mode VMs - Rewind the PSW on host intercepts for VSIE - Remove unneeded include
2 parents 60d2b2f + 7816e58 commit f0a2388

File tree

4 files changed

+34
-4
lines changed

4 files changed

+34
-4
lines changed

Documentation/virt/kvm/api.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,6 +1403,12 @@ Instead, an abort (data abort if the cause of the page-table update
14031403
was a load or a store, instruction abort if it was an instruction
14041404
fetch) is injected in the guest.
14051405

1406+
S390:
1407+
^^^^^
1408+
1409+
Returns -EINVAL if the VM has the KVM_VM_S390_UCONTROL flag set.
1410+
Returns -EINVAL if called on a protected VM.
1411+
14061412
4.36 KVM_SET_TSS_ADDR
14071413
---------------------
14081414

@@ -6273,6 +6279,12 @@ state. At VM creation time, all memory is shared, i.e. the PRIVATE attribute
62736279
is '0' for all gfns. Userspace can control whether memory is shared/private by
62746280
toggling KVM_MEMORY_ATTRIBUTE_PRIVATE via KVM_SET_MEMORY_ATTRIBUTES as needed.
62756281

6282+
S390:
6283+
^^^^^
6284+
6285+
Returns -EINVAL if the VM has the KVM_VM_S390_UCONTROL flag set.
6286+
Returns -EINVAL if called on a protected VM.
6287+
62766288
4.141 KVM_SET_MEMORY_ATTRIBUTES
62776289
-------------------------------
62786290

arch/s390/include/asm/kvm_host.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <linux/hrtimer.h>
1616
#include <linux/interrupt.h>
1717
#include <linux/kvm_types.h>
18-
#include <linux/kvm_host.h>
1918
#include <linux/kvm.h>
2019
#include <linux/seqlock.h>
2120
#include <linux/module.h>

arch/s390/kvm/kvm-s390.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5748,6 +5748,9 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
57485748
{
57495749
gpa_t size;
57505750

5751+
if (kvm_is_ucontrol(kvm))
5752+
return -EINVAL;
5753+
57515754
/* When we are protected, we should not change the memory slots */
57525755
if (kvm_s390_pv_get_handle(kvm))
57535756
return -EINVAL;

arch/s390/kvm/vsie.c

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,10 +1304,24 @@ static int vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
13041304

13051305
if (rc == -EAGAIN)
13061306
rc = 0;
1307-
if (rc || scb_s->icptcode || signal_pending(current) ||
1307+
1308+
/*
1309+
* Exit the loop if the guest needs to process the intercept
1310+
*/
1311+
if (rc || scb_s->icptcode)
1312+
break;
1313+
1314+
/*
1315+
* Exit the loop if the host needs to process an intercept,
1316+
* but rewind the PSW to re-enter SIE once that's completed
1317+
* instead of passing a "no action" intercept to the guest.
1318+
*/
1319+
if (signal_pending(current) ||
13081320
kvm_s390_vcpu_has_irq(vcpu, 0) ||
1309-
kvm_s390_vcpu_sie_inhibited(vcpu))
1321+
kvm_s390_vcpu_sie_inhibited(vcpu)) {
1322+
kvm_s390_rewind_psw(vcpu, 4);
13101323
break;
1324+
}
13111325
cond_resched();
13121326
}
13131327

@@ -1426,8 +1440,10 @@ int kvm_s390_handle_vsie(struct kvm_vcpu *vcpu)
14261440
return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
14271441

14281442
if (signal_pending(current) || kvm_s390_vcpu_has_irq(vcpu, 0) ||
1429-
kvm_s390_vcpu_sie_inhibited(vcpu))
1443+
kvm_s390_vcpu_sie_inhibited(vcpu)) {
1444+
kvm_s390_rewind_psw(vcpu, 4);
14301445
return 0;
1446+
}
14311447

14321448
vsie_page = get_vsie_page(vcpu->kvm, scb_addr);
14331449
if (IS_ERR(vsie_page))

0 commit comments

Comments
 (0)