mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
KVM: s390: Fix and feature for 5.15
- enable interpretion of specification exceptions - fix a vcpu_idx vs vcpu_id mixup -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAABAgAGBQJhKxuYAAoJEBF7vIC1phx8w80P/i3mOFrNWyS9eVuFnFc34Bb5 soueWQKv3HR3pdjPhN6GnfkZsZlHjcflTQzvB3QNi6xlfhJSkwh+hoYZvhjZUJCa 25/vRYJfkkp6xWu+tGsfrBC+2e6muFMLE5PRBVvjEcrCb/IM3rfzBazcXwahBuTW oT2j9+eYvlD6hy2kQSHaAkhIW5ldJj6RJ9cVE1lcWs+6YjP6e17a3SHMUXoBUjSv RAIv3iCgK0IuVALGzvC4QeKblTv2l+TrcUyIiQdFjnzv7IIcfPzzJFdYRg6g6pbR vsz5a309MyOaiVERUNqmNhDC0j6TLwS2eSvdqksJXhfmoT1kbK+rkum10IM7Q4ii rmKw3Wmvb+Dyde4SILcpQt2zsg5KjGAOFOqIb0f8lq7cIvrqdA1FbY8XxjJgkmSo EM9GkRWqS6K5nwNV7bSeLmFmdzYeCTFfzeYIPWI/cjZB4KPd9K0aU8LtiLJjZn2y xjfvZE+iRzPZL2sBZLtovhfOrqh8LLTd6o+i6KIgCC98CPOL0Y3ShNxPsCgN1sXH REK9dPKymoXEbFyUabUAerrUrjWZc80AnFZMWTz9wybwTuSWyIGxIUBuq2W1aLSV AKN8BEVdiB2PGsTlzio8JUtDb8dzHbEHyNrzKrYYdPb681b5EYRHZE5Eh9YejiaI I4d6bO1OmJD8uSaF+qRV =Usbs -----END PGP SIGNATURE----- Merge tag 'kvm-s390-next-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD KVM: s390: Fix and feature for 5.15 - enable interpretion of specification exceptions - fix a vcpu_idx vs vcpu_id mixup
This commit is contained in:
commit
0d0a19395b
5 changed files with 14 additions and 8 deletions
|
@ -244,6 +244,7 @@ struct kvm_s390_sie_block {
|
|||
__u8 fpf; /* 0x0060 */
|
||||
#define ECB_GS 0x40
|
||||
#define ECB_TE 0x10
|
||||
#define ECB_SPECI 0x08
|
||||
#define ECB_SRSI 0x04
|
||||
#define ECB_HOSTPROTINT 0x02
|
||||
__u8 ecb; /* 0x0061 */
|
||||
|
@ -957,6 +958,7 @@ struct kvm_arch{
|
|||
atomic64_t cmma_dirty_pages;
|
||||
/* subset of available cpu features enabled by user space */
|
||||
DECLARE_BITMAP(cpu_feat, KVM_S390_VM_CPU_FEAT_NR_BITS);
|
||||
/* indexed by vcpu_idx */
|
||||
DECLARE_BITMAP(idle_mask, KVM_MAX_VCPUS);
|
||||
struct kvm_s390_gisa_interrupt gisa_int;
|
||||
struct kvm_s390_pv pv;
|
||||
|
|
|
@ -419,13 +419,13 @@ static unsigned long deliverable_irqs(struct kvm_vcpu *vcpu)
|
|||
static void __set_cpu_idle(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
kvm_s390_set_cpuflags(vcpu, CPUSTAT_WAIT);
|
||||
set_bit(vcpu->vcpu_id, vcpu->kvm->arch.idle_mask);
|
||||
set_bit(kvm_vcpu_get_idx(vcpu), vcpu->kvm->arch.idle_mask);
|
||||
}
|
||||
|
||||
static void __unset_cpu_idle(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
kvm_s390_clear_cpuflags(vcpu, CPUSTAT_WAIT);
|
||||
clear_bit(vcpu->vcpu_id, vcpu->kvm->arch.idle_mask);
|
||||
clear_bit(kvm_vcpu_get_idx(vcpu), vcpu->kvm->arch.idle_mask);
|
||||
}
|
||||
|
||||
static void __reset_intercept_indicators(struct kvm_vcpu *vcpu)
|
||||
|
@ -3050,18 +3050,18 @@ int kvm_s390_get_irq_state(struct kvm_vcpu *vcpu, __u8 __user *buf, int len)
|
|||
|
||||
static void __airqs_kick_single_vcpu(struct kvm *kvm, u8 deliverable_mask)
|
||||
{
|
||||
int vcpu_id, online_vcpus = atomic_read(&kvm->online_vcpus);
|
||||
int vcpu_idx, online_vcpus = atomic_read(&kvm->online_vcpus);
|
||||
struct kvm_s390_gisa_interrupt *gi = &kvm->arch.gisa_int;
|
||||
struct kvm_vcpu *vcpu;
|
||||
|
||||
for_each_set_bit(vcpu_id, kvm->arch.idle_mask, online_vcpus) {
|
||||
vcpu = kvm_get_vcpu(kvm, vcpu_id);
|
||||
for_each_set_bit(vcpu_idx, kvm->arch.idle_mask, online_vcpus) {
|
||||
vcpu = kvm_get_vcpu(kvm, vcpu_idx);
|
||||
if (psw_ioint_disabled(vcpu))
|
||||
continue;
|
||||
deliverable_mask &= (u8)(vcpu->arch.sie_block->gcr[6] >> 24);
|
||||
if (deliverable_mask) {
|
||||
/* lately kicked but not yet running */
|
||||
if (test_and_set_bit(vcpu_id, gi->kicked_mask))
|
||||
if (test_and_set_bit(vcpu_idx, gi->kicked_mask))
|
||||
return;
|
||||
kvm_s390_vcpu_wakeup(vcpu);
|
||||
return;
|
||||
|
|
|
@ -3196,6 +3196,8 @@ static int kvm_s390_vcpu_setup(struct kvm_vcpu *vcpu)
|
|||
vcpu->arch.sie_block->ecb |= ECB_SRSI;
|
||||
if (test_kvm_facility(vcpu->kvm, 73))
|
||||
vcpu->arch.sie_block->ecb |= ECB_TE;
|
||||
if (!kvm_is_ucontrol(vcpu->kvm))
|
||||
vcpu->arch.sie_block->ecb |= ECB_SPECI;
|
||||
|
||||
if (test_kvm_facility(vcpu->kvm, 8) && vcpu->kvm->arch.use_pfmfi)
|
||||
vcpu->arch.sie_block->ecb2 |= ECB2_PFMFI;
|
||||
|
@ -4040,7 +4042,7 @@ static int vcpu_pre_run(struct kvm_vcpu *vcpu)
|
|||
kvm_s390_patch_guest_per_regs(vcpu);
|
||||
}
|
||||
|
||||
clear_bit(vcpu->vcpu_id, vcpu->kvm->arch.gisa_int.kicked_mask);
|
||||
clear_bit(kvm_vcpu_get_idx(vcpu), vcpu->kvm->arch.gisa_int.kicked_mask);
|
||||
|
||||
vcpu->arch.sie_block->icptcode = 0;
|
||||
cpuflags = atomic_read(&vcpu->arch.sie_block->cpuflags);
|
||||
|
|
|
@ -79,7 +79,7 @@ static inline int is_vcpu_stopped(struct kvm_vcpu *vcpu)
|
|||
|
||||
static inline int is_vcpu_idle(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
return test_bit(vcpu->vcpu_id, vcpu->kvm->arch.idle_mask);
|
||||
return test_bit(kvm_vcpu_get_idx(vcpu), vcpu->kvm->arch.idle_mask);
|
||||
}
|
||||
|
||||
static inline int kvm_is_ucontrol(struct kvm *kvm)
|
||||
|
|
|
@ -510,6 +510,8 @@ static int shadow_scb(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
|
|||
prefix_unmapped(vsie_page);
|
||||
scb_s->ecb |= ECB_TE;
|
||||
}
|
||||
/* specification exception interpretation */
|
||||
scb_s->ecb |= scb_o->ecb & ECB_SPECI;
|
||||
/* branch prediction */
|
||||
if (test_kvm_facility(vcpu->kvm, 82))
|
||||
scb_s->fpf |= scb_o->fpf & FPF_BPBC;
|
||||
|
|
Loading…
Reference in a new issue