KVM: selftests: Check that the palette table exists before using it
authorAaron Lewis <aaronlewis@google.com>
Tue, 21 Feb 2023 16:36:54 +0000 (16:36 +0000)
committerSean Christopherson <seanjc@google.com>
Fri, 24 Mar 2023 21:21:41 +0000 (14:21 -0700)
commitd32fb071429360f5f597c284087c845b2f748ebe
treeb4b73882943f2794b0ec434db95780ed9cf7de51
parentd01d4a4f7bd2197208b904378debf3331eec936e
KVM: selftests: Check that the palette table exists before using it

Check that the palette table exists before using it. The maximum number of
AMX palette tables is enumerated by CPUID.1DH:EAX. Assert that the palette
used in amx_test, CPUID.1DH.1H, does not exceed that maximum.

Signed-off-by: Aaron Lewis <aaronlewis@google.com>
Signed-off-by: Mingwei Zhang <mizhang@google.com>
Link: https://lore.kernel.org/r/20230221163655.920289-13-mizhang@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/include/x86_64/processor.h
tools/testing/selftests/kvm/x86_64/amx_test.c