Commit ef8b4b7
committed
KVM: ensure APICv is considered inactive if there is no APIC
kvm_vcpu_apicv_active() returns false if a virtual machine has no in-kernel
local APIC, however kvm_apicv_activated might still be true if there are
no reasons to disable APICv; in fact it is quite likely that there is none
because APICv is inhibited by specific configurations of the local APIC
and those configurations cannot be programmed. This triggers a WARN:
WARN_ON_ONCE(kvm_apicv_activated(vcpu->kvm) != kvm_vcpu_apicv_active(vcpu));
To avoid this, introduce another cause for APICv inhibition, namely the
absence of an in-kernel local APIC. This cause is enabled by default,
and is dropped by either KVM_CREATE_IRQCHIP or the enabling of
KVM_CAP_IRQCHIP_SPLIT.
Reported-by: Ignat Korchagin <[email protected]>
Fixes: ee49a89 ("KVM: x86: Move SVM's APICv sanity check to common x86", 2021-10-22)
Reviewed-by: Maxim Levitsky <[email protected]>
Reviewed-by: Sean Christopherson <[email protected]>
Tested-by: Ignat Korchagin <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>1 parent cb1d220 commit ef8b4b7
4 files changed
+8
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1036 | 1036 | | |
1037 | 1037 | | |
1038 | 1038 | | |
| 1039 | + | |
1039 | 1040 | | |
1040 | 1041 | | |
1041 | 1042 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
900 | 900 | | |
901 | 901 | | |
902 | 902 | | |
| 903 | + | |
903 | 904 | | |
904 | 905 | | |
905 | 906 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7525 | 7525 | | |
7526 | 7526 | | |
7527 | 7527 | | |
| 7528 | + | |
7528 | 7529 | | |
7529 | 7530 | | |
7530 | 7531 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5740 | 5740 | | |
5741 | 5741 | | |
5742 | 5742 | | |
| 5743 | + | |
5743 | 5744 | | |
5744 | 5745 | | |
5745 | 5746 | | |
| |||
6120 | 6121 | | |
6121 | 6122 | | |
6122 | 6123 | | |
| 6124 | + | |
6123 | 6125 | | |
6124 | 6126 | | |
6125 | 6127 | | |
| |||
8818 | 8820 | | |
8819 | 8821 | | |
8820 | 8822 | | |
8821 | | - | |
8822 | | - | |
8823 | | - | |
8824 | | - | |
| 8823 | + | |
| 8824 | + | |
| 8825 | + | |
8825 | 8826 | | |
8826 | 8827 | | |
8827 | 8828 | | |
| |||
0 commit comments