]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: KVM: avoid failures due to reserved HyperTransport region
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 5 Aug 2021 10:54:23 +0000 (06:54 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 10 Dec 2021 12:42:20 +0000 (07:42 -0500)
commit1c5c26c16f4c0a00eaed3edce0005ef98c8e29a2
treea3e3537dd90e255a26149ff3a86adfc53972ab87
parentfece6a282414e02a6feb4f9227aea4456ec694fa
selftests: KVM: avoid failures due to reserved HyperTransport region

AMD proceessors define an address range that is reserved by HyperTransport
and causes a failure if used for guest physical addresses.  Avoid
selftests failures by reserving those guest physical addresses; the
rules are:

- On parts with <40 bits, its fully hidden from software.

- Before Fam17h, it was always 12G just below 1T, even if there was more
RAM above this location.  In this case we just not use any RAM above 1T.

- On Fam17h and later, it is variable based on SME, and is either just
below 2^48 (no encryption) or 2^43 (encryption).

Fixes: 3d9c6ee8bdb0 ("KVM: selftests: Fix 32-bit truncation of vm_get_max_gfn()")
Cc: stable@vger.kernel.org
Cc: David Matlack <dmatlack@google.com>
Reported-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210805105423.412878-1-pbonzini@redhat.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Tested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/include/kvm_util.h
tools/testing/selftests/kvm/lib/kvm_util.c
tools/testing/selftests/kvm/lib/x86_64/processor.c