]> www.infradead.org Git - users/dwmw2/linux.git/commit
svm: Fix AVIC DFR and LDR handling
authorSuthikulpanit, Suravee <Suravee.Suthikulpanit@amd.com>
Tue, 29 Jan 2019 08:08:42 +0000 (08:08 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 12 Feb 2019 12:12:36 +0000 (13:12 +0100)
commitcac4d1bb37dfd2fb14db095248fd0784e3d8129d
tree069ac3ec937390bea097f24f32360534f1e3fb4a
parent2b722cb2da19357289c7c80721168dfc601b3e80
svm: Fix AVIC DFR and LDR handling

Current SVM AVIC driver makes two incorrect assumptions:
  1. APIC LDR register cannot be zero
  2. APIC DFR for all vCPUs must be the same

LDR=0 means the local APIC does not support logical destination mode.
Therefore, the driver should mark any previously assigned logical APIC ID
table entry as invalid, and return success.  Also, DFR is specific to
a particular local APIC, and can be different among all vCPUs
(as observed on Windows 10).

These incorrect assumptions cause Windows 10 and FreeBSD VMs to fail
to boot with AVIC enabled. So, instead of flush the whole logical APIC ID
table, handle DFR and LDR for each vCPU independently.

Fixes: 18f40c53e10f ('svm: Add VMEXIT handlers for AVIC')
Cc: Radim Krčmář <rkrcmar@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Reported-by: Julian Stecklina <jsteckli@amazon.de>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm.c