Skip to content

Commit 899e220

Browse files
steffen-eidenfrankjaa
authored andcommitted
KVM: s390: pv: Allow AP-instructions for pv-guests
Introduces new feature bits and enablement flags for AP and AP IRQ support. Signed-off-by: Steffen Eiden <seiden@linux.ibm.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Michael Mueller <mimu@linux.ibm.com> Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Link: https://lore.kernel.org/r/20230815151415.379760-5-seiden@linux.ibm.com Message-Id: <20230815151415.379760-5-seiden@linux.ibm.com>
1 parent 19c654b commit 899e220

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

arch/s390/include/asm/uv.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ enum uv_cmds_inst {
9999
enum uv_feat_ind {
100100
BIT_UV_FEAT_MISC = 0,
101101
BIT_UV_FEAT_AIV = 1,
102+
BIT_UV_FEAT_AP = 4,
103+
BIT_UV_FEAT_AP_INTR = 5,
102104
};
103105

104106
struct uv_cb_header {
@@ -159,7 +161,15 @@ struct uv_cb_cgc {
159161
u64 guest_handle;
160162
u64 conf_base_stor_origin;
161163
u64 conf_virt_stor_origin;
162-
u64 reserved30;
164+
u8 reserved30[6];
165+
union {
166+
struct {
167+
u16 : 14;
168+
u16 ap_instr_intr : 1;
169+
u16 ap_allow_instr : 1;
170+
};
171+
u16 raw;
172+
} flags;
163173
u64 guest_stor_origin;
164174
u64 guest_stor_len;
165175
u64 guest_sca;

arch/s390/kvm/pv.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,12 +572,14 @@ int kvm_s390_pv_init_vm(struct kvm *kvm, u16 *rc, u16 *rrc)
572572
uvcb.conf_base_stor_origin =
573573
virt_to_phys((void *)kvm->arch.pv.stor_base);
574574
uvcb.conf_virt_stor_origin = (u64)kvm->arch.pv.stor_var;
575+
uvcb.flags.ap_allow_instr = kvm->arch.model.uv_feat_guest.ap;
576+
uvcb.flags.ap_instr_intr = kvm->arch.model.uv_feat_guest.ap_intr;
575577

576578
cc = uv_call_sched(0, (u64)&uvcb);
577579
*rc = uvcb.header.rc;
578580
*rrc = uvcb.header.rrc;
579-
KVM_UV_EVENT(kvm, 3, "PROTVIRT CREATE VM: handle %llx len %llx rc %x rrc %x",
580-
uvcb.guest_handle, uvcb.guest_stor_len, *rc, *rrc);
581+
KVM_UV_EVENT(kvm, 3, "PROTVIRT CREATE VM: handle %llx len %llx rc %x rrc %x flags %04x",
582+
uvcb.guest_handle, uvcb.guest_stor_len, *rc, *rrc, uvcb.flags.raw);
581583

582584
/* Outputs */
583585
kvm->arch.pv.handle = uvcb.guest_handle;

0 commit comments

Comments
 (0)