History

Merge tag 'kvm-s390-next-5.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into kvm-next-5.6

Paolo Bonzini committed 6 years ago

Commit f3633c22 parents ff2bd9f 23a60f87 files · +23 −11Browse files

Unified · Split

7 files
  1. arch/s390/include/asm/diag.h +2 −4
  2. arch/s390/include/asm/kvm_host.h +3 −1
  3. arch/s390/include/uapi/asm/kvm.h +5 −2
  4. arch/s390/kernel/setup.c +1 −2
  5. arch/s390/kvm/kvm-s390.c +10 −1
  6. arch/s390/kvm/vsie.c +1 −0
  7. include/uapi/linux/kvm.h +1 −1
arch/s390/include/asm/diag.h+2−4
@@ -298,10 +298,8 @@ struct diag26c_mac_resp { · 297 unmodified lines
298298 union diag318_info {
299299 unsigned long val;
300300 struct {
301− unsigned int cpnc : 8;
302− unsigned int cpvc_linux : 24;
303− unsigned char cpvc_distro[3];
304− unsigned char zero;
301+ unsigned long cpnc : 8;
302+ unsigned long cpvc : 56;
305303 };
306304 };
307305
arch/s390/include/asm/kvm_host.h+3−1
@@ -260,7 +260,8 @@ struct kvm_s390_sie_block { · 259 unmodified lines
260260 __u32 scaol; /* 0x0064 */
261261 __u8 sdf; /* 0x0068 */
262262 __u8 epdx; /* 0x0069 */
263− __u8 reserved6a[2]; /* 0x006a */
263+ __u8 cpnc; /* 0x006a */
264+ __u8 reserved6b; /* 0x006b */
264265 __u32 todpr; /* 0x006c */
265266 #define GISA_FORMAT1 0x00000001
266267 __u32 gd; /* 0x0070 */
@@ -745,6 +746,7 @@ struct kvm_vcpu_arch { · 478 unmodified lines
745746 bool gs_enabled;
746747 bool skey_enabled;
747748 struct kvm_s390_pv_vcpu pv;
749+ union diag318_info diag318_info;
748750 };
749751
750752 struct kvm_vm_stat {
arch/s390/include/uapi/asm/kvm.h+5−2
@@ -231,11 +231,13 @@ struct kvm_guest_debug_arch { · 230 unmodified lines
231231 #define KVM_SYNC_GSCB (1UL << 9)
232232 #define KVM_SYNC_BPBC (1UL << 10)
233233 #define KVM_SYNC_ETOKEN (1UL << 11)
234+#define KVM_SYNC_DIAG318 (1UL << 12)
234235
235236 #define KVM_SYNC_S390_VALID_FIELDS \
236237 (KVM_SYNC_PREFIX | KVM_SYNC_GPRS | KVM_SYNC_ACRS | KVM_SYNC_CRS | \
237238 KVM_SYNC_ARCH0 | KVM_SYNC_PFAULT | KVM_SYNC_VRS | KVM_SYNC_RICCB | \
238− KVM_SYNC_FPRS | KVM_SYNC_GSCB | KVM_SYNC_BPBC | KVM_SYNC_ETOKEN)
239+ KVM_SYNC_FPRS | KVM_SYNC_GSCB | KVM_SYNC_BPBC | KVM_SYNC_ETOKEN | \
240+ KVM_SYNC_DIAG318)
239241
240242 /* length and alignment of the sdnx as a power of two */
241243 #define SDNXC 8
@@ -264,7 +266,8 @@ struct kvm_sync_regs { · 22 unmodified lines
264266 __u8 reserved2 : 7;
265267 __u8 padding1[51]; /* riccb needs to be 64byte aligned */
266268 __u8 riccb[64]; /* runtime instrumentation controls block */
267− __u8 padding2[192]; /* sdnx needs to be 256byte aligned */
269+ __u64 diag318; /* diagnose 0x318 info */
270+ __u8 padding2[184]; /* sdnx needs to be 256byte aligned */
268271 union {
269272 __u8 sdnx[SDNXL]; /* state description annex */
270273 struct {
arch/s390/kernel/setup.c+1−2
@@ -1021,8 +1021,7 @@ static void __init setup_control_program_code(void) · 1020 unmodified lines
10211021 {
10221022 union diag318_info diag318_info = {
10231023 .cpnc = CPNC_LINUX,
1024− .cpvc_linux = 0,
1025− .cpvc_distro = {0},
1024+ .cpvc = 0,
10261025 };
10271026
10281027 if (!sclp.has_diag318)
arch/s390/kvm/kvm-s390.c+10−1
@@ -545,6 +545,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 544 unmodified lines
545545 case KVM_CAP_S390_AIS_MIGRATION:
546546 case KVM_CAP_S390_VCPU_RESETS:
547547 case KVM_CAP_SET_GUEST_DEBUG:
548+ case KVM_CAP_S390_DIAG318:
548549 r = 1;
549550 break;
550551 case KVM_CAP_S390_HPAGE_1M:
@@ -3267,7 +3268,8 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) · 2716 unmodified lines
32673268 KVM_SYNC_ACRS |
32683269 KVM_SYNC_CRS |
32693270 KVM_SYNC_ARCH0 |
3270− KVM_SYNC_PFAULT;
3271+ KVM_SYNC_PFAULT |
3272+ KVM_SYNC_DIAG318;
32713273 kvm_s390_set_prefix(vcpu, 0);
32723274 if (test_kvm_facility(vcpu->kvm, 64))
32733275 vcpu->run->kvm_valid_regs |= KVM_SYNC_RICCB;
@@ -3562,6 +3564,7 @@ static void kvm_arch_vcpu_ioctl_initial_reset(struct kvm_vcpu *vcpu) · 288 unmodified lines
35623564 vcpu->arch.sie_block->pp = 0;
35633565 vcpu->arch.sie_block->fpf &= ~FPF_BPBC;
35643566 vcpu->arch.sie_block->todpr = 0;
3567+ vcpu->arch.sie_block->cpnc = 0;
35653568 }
35663569 }
35673570
@@ -3579,6 +3582,7 @@ static void kvm_arch_vcpu_ioctl_clear_reset(struct kvm_vcpu *vcpu) · 11 unmodified lines
35793582
35803583 regs->etoken = 0;
35813584 regs->etoken_extension = 0;
3585+ regs->diag318 = 0;
35823586 }
35833587
35843588 int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
@@ -4195,6 +4199,10 @@ static void sync_regs_fmt2(struct kvm_vcpu *vcpu) · 610 unmodified lines
41954199 if (vcpu->arch.pfault_token == KVM_S390_PFAULT_TOKEN_INVALID)
41964200 kvm_clear_async_pf_completion_queue(vcpu);
41974201 }
4202+ if (kvm_run->kvm_dirty_regs & KVM_SYNC_DIAG318) {
4203+ vcpu->arch.diag318_info.val = kvm_run->s.regs.diag318;
4204+ vcpu->arch.sie_block->cpnc = vcpu->arch.diag318_info.cpnc;
4205+ }
41984206 /*
41994207 * If userspace sets the riccb (e.g. after migration) to a valid state,
42004208 * we should enable RI here instead of doing the lazy enablement.
@@ -4300,6 +4308,7 @@ static void store_regs_fmt2(struct kvm_vcpu *vcpu) · 99 unmodified lines
43004308 kvm_run->s.regs.pp = vcpu->arch.sie_block->pp;
43014309 kvm_run->s.regs.gbea = vcpu->arch.sie_block->gbea;
43024310 kvm_run->s.regs.bpbc = (vcpu->arch.sie_block->fpf & FPF_BPBC) == FPF_BPBC;
4311+ kvm_run->s.regs.diag318 = vcpu->arch.diag318_info.val;
43034312 if (MACHINE_HAS_GS) {
43044313 __ctl_set_bit(2, 4);
43054314 if (vcpu->arch.gs_enabled)
arch/s390/kvm/vsie.c+1−0
@@ -548,6 +548,7 @@ static int shadow_scb(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page) · 547 unmodified lines
548548 scb_s->ecd |= scb_o->ecd & ECD_ETOKENF;
549549
550550 scb_s->hpid = HPID_VSIE;
551+ scb_s->cpnc = scb_o->cpnc;
551552
552553 prepare_ibc(vcpu, vsie_page);
553554 rc = shadow_crycb(vcpu, vsie_page);
include/uapi/linux/kvm.h+1−1
@@ -1034,7 +1034,7 @@ struct kvm_ppc_resize_hpt { · 1033 unmodified lines
10341034 #define KVM_CAP_ASYNC_PF_INT 183
10351035 #define KVM_CAP_LAST_CPU 184
10361036 #define KVM_CAP_SMALLER_MAXPHYADDR 185
1037−
1037+#define KVM_CAP_S390_DIAG318 186
10381038
10391039 #ifdef KVM_CAP_IRQ_ROUTING
10401040

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t