Unified · Split
| @@ -298,10 +298,8 @@ struct diag26c_mac_resp { · 297 unmodified lines | ||
| 298 | 298 | union diag318_info { |
| 299 | 299 | unsigned long val; |
| 300 | 300 | 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; | |
| 305 | 303 | }; |
| 306 | 304 | }; |
| 307 | 305 | |
| @@ -260,7 +260,8 @@ struct kvm_s390_sie_block { · 259 unmodified lines | ||
| 260 | 260 | __u32 scaol; /* 0x0064 */ |
| 261 | 261 | __u8 sdf; /* 0x0068 */ |
| 262 | 262 | __u8 epdx; /* 0x0069 */ |
| 263 | − __u8 reserved6a[2]; /* 0x006a */ | |
| 263 | + __u8 cpnc; /* 0x006a */ | |
| 264 | + __u8 reserved6b; /* 0x006b */ | |
| 264 | 265 | __u32 todpr; /* 0x006c */ |
| 265 | 266 | #define GISA_FORMAT1 0x00000001 |
| 266 | 267 | __u32 gd; /* 0x0070 */ |
| @@ -745,6 +746,7 @@ struct kvm_vcpu_arch { · 478 unmodified lines | ||
| 745 | 746 | bool gs_enabled; |
| 746 | 747 | bool skey_enabled; |
| 747 | 748 | struct kvm_s390_pv_vcpu pv; |
| 749 | + union diag318_info diag318_info; | |
| 748 | 750 | }; |
| 749 | 751 | |
| 750 | 752 | struct kvm_vm_stat { |
| @@ -231,11 +231,13 @@ struct kvm_guest_debug_arch { · 230 unmodified lines | ||
| 231 | 231 | #define KVM_SYNC_GSCB (1UL << 9) |
| 232 | 232 | #define KVM_SYNC_BPBC (1UL << 10) |
| 233 | 233 | #define KVM_SYNC_ETOKEN (1UL << 11) |
| 234 | +#define KVM_SYNC_DIAG318 (1UL << 12) | |
| 234 | 235 | |
| 235 | 236 | #define KVM_SYNC_S390_VALID_FIELDS \ |
| 236 | 237 | (KVM_SYNC_PREFIX | KVM_SYNC_GPRS | KVM_SYNC_ACRS | KVM_SYNC_CRS | \ |
| 237 | 238 | 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) | |
| 239 | 241 | |
| 240 | 242 | /* length and alignment of the sdnx as a power of two */ |
| 241 | 243 | #define SDNXC 8 |
| @@ -264,7 +266,8 @@ struct kvm_sync_regs { · 22 unmodified lines | ||
| 264 | 266 | __u8 reserved2 : 7; |
| 265 | 267 | __u8 padding1[51]; /* riccb needs to be 64byte aligned */ |
| 266 | 268 | __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 */ | |
| 268 | 271 | union { |
| 269 | 272 | __u8 sdnx[SDNXL]; /* state description annex */ |
| 270 | 273 | struct { |
| @@ -1021,8 +1021,7 @@ static void __init setup_control_program_code(void) · 1020 unmodified lines | ||
| 1021 | 1021 | { |
| 1022 | 1022 | union diag318_info diag318_info = { |
| 1023 | 1023 | .cpnc = CPNC_LINUX, |
| 1024 | − .cpvc_linux = 0, | |
| 1025 | − .cpvc_distro = {0}, | |
| 1024 | + .cpvc = 0, | |
| 1026 | 1025 | }; |
| 1027 | 1026 | |
| 1028 | 1027 | if (!sclp.has_diag318) |
| @@ -545,6 +545,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) · 544 unmodified lines | ||
| 545 | 545 | case KVM_CAP_S390_AIS_MIGRATION: |
| 546 | 546 | case KVM_CAP_S390_VCPU_RESETS: |
| 547 | 547 | case KVM_CAP_SET_GUEST_DEBUG: |
| 548 | + case KVM_CAP_S390_DIAG318: | |
| 548 | 549 | r = 1; |
| 549 | 550 | break; |
| 550 | 551 | case KVM_CAP_S390_HPAGE_1M: |
| @@ -3267,7 +3268,8 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) · 2716 unmodified lines | ||
| 3267 | 3268 | KVM_SYNC_ACRS | |
| 3268 | 3269 | KVM_SYNC_CRS | |
| 3269 | 3270 | KVM_SYNC_ARCH0 | |
| 3270 | − KVM_SYNC_PFAULT; | |
| 3271 | + KVM_SYNC_PFAULT | | |
| 3272 | + KVM_SYNC_DIAG318; | |
| 3271 | 3273 | kvm_s390_set_prefix(vcpu, 0); |
| 3272 | 3274 | if (test_kvm_facility(vcpu->kvm, 64)) |
| 3273 | 3275 | 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 | ||
| 3562 | 3564 | vcpu->arch.sie_block->pp = 0; |
| 3563 | 3565 | vcpu->arch.sie_block->fpf &= ~FPF_BPBC; |
| 3564 | 3566 | vcpu->arch.sie_block->todpr = 0; |
| 3567 | + vcpu->arch.sie_block->cpnc = 0; | |
| 3565 | 3568 | } |
| 3566 | 3569 | } |
| 3567 | 3570 | |
| @@ -3579,6 +3582,7 @@ static void kvm_arch_vcpu_ioctl_clear_reset(struct kvm_vcpu *vcpu) · 11 unmodified lines | ||
| 3579 | 3582 | |
| 3580 | 3583 | regs->etoken = 0; |
| 3581 | 3584 | regs->etoken_extension = 0; |
| 3585 | + regs->diag318 = 0; | |
| 3582 | 3586 | } |
| 3583 | 3587 | |
| 3584 | 3588 | 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 | ||
| 4195 | 4199 | if (vcpu->arch.pfault_token == KVM_S390_PFAULT_TOKEN_INVALID) |
| 4196 | 4200 | kvm_clear_async_pf_completion_queue(vcpu); |
| 4197 | 4201 | } |
| 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 | + } | |
| 4198 | 4206 | /* |
| 4199 | 4207 | * If userspace sets the riccb (e.g. after migration) to a valid state, |
| 4200 | 4208 | * 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 | ||
| 4300 | 4308 | kvm_run->s.regs.pp = vcpu->arch.sie_block->pp; |
| 4301 | 4309 | kvm_run->s.regs.gbea = vcpu->arch.sie_block->gbea; |
| 4302 | 4310 | 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; | |
| 4303 | 4312 | if (MACHINE_HAS_GS) { |
| 4304 | 4313 | __ctl_set_bit(2, 4); |
| 4305 | 4314 | if (vcpu->arch.gs_enabled) |
| @@ -548,6 +548,7 @@ static int shadow_scb(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page) · 547 unmodified lines | ||
| 548 | 548 | scb_s->ecd |= scb_o->ecd & ECD_ETOKENF; |
| 549 | 549 | |
| 550 | 550 | scb_s->hpid = HPID_VSIE; |
| 551 | + scb_s->cpnc = scb_o->cpnc; | |
| 551 | 552 | |
| 552 | 553 | prepare_ibc(vcpu, vsie_page); |
| 553 | 554 | rc = shadow_crycb(vcpu, vsie_page); |
| @@ -1034,7 +1034,7 @@ struct kvm_ppc_resize_hpt { · 1033 unmodified lines | ||
| 1034 | 1034 | #define KVM_CAP_ASYNC_PF_INT 183 |
| 1035 | 1035 | #define KVM_CAP_LAST_CPU 184 |
| 1036 | 1036 | #define KVM_CAP_SMALLER_MAXPHYADDR 185 |
| 1037 | − | |
| 1037 | +#define KVM_CAP_S390_DIAG318 186 | |
| 1038 | 1038 | |
| 1039 | 1039 | #ifdef KVM_CAP_IRQ_ROUTING |
| 1040 | 1040 | |