diff options
| -rw-r--r-- | arch/x86/kvm/svm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index a849dcb7fbc5..a9e553a1317f 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
| @@ -2024,7 +2024,11 @@ static void avic_vcpu_load(struct kvm_vcpu *vcpu, int cpu) | |||
| 2024 | if (!kvm_vcpu_apicv_active(vcpu)) | 2024 | if (!kvm_vcpu_apicv_active(vcpu)) |
| 2025 | return; | 2025 | return; |
| 2026 | 2026 | ||
| 2027 | if (WARN_ON(h_physical_id >= AVIC_MAX_PHYSICAL_ID_COUNT)) | 2027 | /* |
| 2028 | * Since the host physical APIC id is 8 bits, | ||
| 2029 | * we can support host APIC ID upto 255. | ||
| 2030 | */ | ||
| 2031 | if (WARN_ON(h_physical_id > AVIC_PHYSICAL_ID_ENTRY_HOST_PHYSICAL_ID_MASK)) | ||
| 2028 | return; | 2032 | return; |
| 2029 | 2033 | ||
| 2030 | entry = READ_ONCE(*(svm->avic_physical_id_cache)); | 2034 | entry = READ_ONCE(*(svm->avic_physical_id_cache)); |
