Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull kvm fix from Paolo Bonzini:

- s390: fix support for z16 systems

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
KVM: s390: fix LPSWEY handling

+49
+1
arch/s390/include/asm/kvm_host.h
··· 427 427 u64 instruction_io_other; 428 428 u64 instruction_lpsw; 429 429 u64 instruction_lpswe; 430 + u64 instruction_lpswey; 430 431 u64 instruction_pfmf; 431 432 u64 instruction_ptff; 432 433 u64 instruction_sck;
+1
arch/s390/kvm/kvm-s390.c
··· 132 132 STATS_DESC_COUNTER(VCPU, instruction_io_other), 133 133 STATS_DESC_COUNTER(VCPU, instruction_lpsw), 134 134 STATS_DESC_COUNTER(VCPU, instruction_lpswe), 135 + STATS_DESC_COUNTER(VCPU, instruction_lpswey), 135 136 STATS_DESC_COUNTER(VCPU, instruction_pfmf), 136 137 STATS_DESC_COUNTER(VCPU, instruction_ptff), 137 138 STATS_DESC_COUNTER(VCPU, instruction_sck),
+15
arch/s390/kvm/kvm-s390.h
··· 138 138 return (base2 ? vcpu->run->s.regs.gprs[base2] : 0) + disp2; 139 139 } 140 140 141 + static inline u64 kvm_s390_get_base_disp_siy(struct kvm_vcpu *vcpu, u8 *ar) 142 + { 143 + u32 base1 = vcpu->arch.sie_block->ipb >> 28; 144 + s64 disp1; 145 + 146 + /* The displacement is a 20bit _SIGNED_ value */ 147 + disp1 = sign_extend64(((vcpu->arch.sie_block->ipb & 0x0fff0000) >> 16) + 148 + ((vcpu->arch.sie_block->ipb & 0xff00) << 4), 19); 149 + 150 + if (ar) 151 + *ar = base1; 152 + 153 + return (base1 ? vcpu->run->s.regs.gprs[base1] : 0) + disp1; 154 + } 155 + 141 156 static inline void kvm_s390_get_base_disp_sse(struct kvm_vcpu *vcpu, 142 157 u64 *address1, u64 *address2, 143 158 u8 *ar_b1, u8 *ar_b2)
+32
arch/s390/kvm/priv.c
··· 797 797 return 0; 798 798 } 799 799 800 + static int handle_lpswey(struct kvm_vcpu *vcpu) 801 + { 802 + psw_t new_psw; 803 + u64 addr; 804 + int rc; 805 + u8 ar; 806 + 807 + vcpu->stat.instruction_lpswey++; 808 + 809 + if (!test_kvm_facility(vcpu->kvm, 193)) 810 + return kvm_s390_inject_program_int(vcpu, PGM_OPERATION); 811 + 812 + if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE) 813 + return kvm_s390_inject_program_int(vcpu, PGM_PRIVILEGED_OP); 814 + 815 + addr = kvm_s390_get_base_disp_siy(vcpu, &ar); 816 + if (addr & 7) 817 + return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION); 818 + 819 + rc = read_guest(vcpu, addr, ar, &new_psw, sizeof(new_psw)); 820 + if (rc) 821 + return kvm_s390_inject_prog_cond(vcpu, rc); 822 + 823 + vcpu->arch.sie_block->gpsw = new_psw; 824 + if (!is_valid_psw(&vcpu->arch.sie_block->gpsw)) 825 + return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION); 826 + 827 + return 0; 828 + } 829 + 800 830 static int handle_stidp(struct kvm_vcpu *vcpu) 801 831 { 802 832 u64 stidp_data = vcpu->kvm->arch.model.cpuid; ··· 1492 1462 case 0x61: 1493 1463 case 0x62: 1494 1464 return handle_ri(vcpu); 1465 + case 0x71: 1466 + return handle_lpswey(vcpu); 1495 1467 default: 1496 1468 return -EOPNOTSUPP; 1497 1469 }