Skip to content

Commit a484755

Browse files
committed
Revert "nSVM: Check for reserved encodings of TLB_CONTROL in nested VMCB"
Revert KVM's made-up consistency check on SVM's TLB control. The APM says that unsupported encodings are reserved, but the APM doesn't state that VMRUN checks for a supported encoding. Unless something is called out in "Canonicalization and Consistency Checks" or listed as MBZ (Must Be Zero), AMD behavior is typically to let software shoot itself in the foot. This reverts commit 174a921. Fixes: 174a921 ("nSVM: Check for reserved encodings of TLB_CONTROL in nested VMCB") Reported-by: Stefan Sterz <s.sterz@proxmox.com> Closes: https://lkml.kernel.org/r/b9915c9c-4cf6-051a-2d91-44cc6380f455%40proxmox.com Cc: stable@vger.kernel.org Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Link: https://lore.kernel.org/r/20231018194104.1896415-2-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent e9e60c8 commit a484755

1 file changed

Lines changed: 0 additions & 15 deletions

File tree

arch/x86/kvm/svm/nested.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -247,18 +247,6 @@ static bool nested_svm_check_bitmap_pa(struct kvm_vcpu *vcpu, u64 pa, u32 size)
247247
kvm_vcpu_is_legal_gpa(vcpu, addr + size - 1);
248248
}
249249

250-
static bool nested_svm_check_tlb_ctl(struct kvm_vcpu *vcpu, u8 tlb_ctl)
251-
{
252-
/* Nested FLUSHBYASID is not supported yet. */
253-
switch(tlb_ctl) {
254-
case TLB_CONTROL_DO_NOTHING:
255-
case TLB_CONTROL_FLUSH_ALL_ASID:
256-
return true;
257-
default:
258-
return false;
259-
}
260-
}
261-
262250
static bool __nested_vmcb_check_controls(struct kvm_vcpu *vcpu,
263251
struct vmcb_ctrl_area_cached *control)
264252
{
@@ -278,9 +266,6 @@ static bool __nested_vmcb_check_controls(struct kvm_vcpu *vcpu,
278266
IOPM_SIZE)))
279267
return false;
280268

281-
if (CC(!nested_svm_check_tlb_ctl(vcpu, control->tlb_ctl)))
282-
return false;
283-
284269
if (CC((control->int_ctl & V_NMI_ENABLE_MASK) &&
285270
!vmcb12_is_intercept(control, INTERCEPT_NMI))) {
286271
return false;

0 commit comments

Comments
 (0)