]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
KVM: x86: Use guest MAXPHYADDR from CPUID.0x8000_0008 iff TDP is enabled
authorSean Christopherson <seanjc@google.com>
Wed, 23 Jun 2021 23:05:46 +0000 (16:05 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 20 Sep 2021 16:48:43 +0000 (18:48 +0200)
commitb61b4fc490d7b41055e4f368af3152112aa25587
tree29cc047c26f09ca84bc30b4359b8510f4a6b321c
parent29a20044a540220867bb5cf7fe0a91ce98943b4f
KVM: x86: Use guest MAXPHYADDR from CPUID.0x8000_0008 iff TDP is enabled

BugLink: https://bugs.launchpad.net/bugs/1939440
commit 4bf48e3c0aafd32b960d341c4925b48f416f14a5 upstream.

Ignore the guest MAXPHYADDR reported by CPUID.0x8000_0008 if TDP, i.e.
NPT, is disabled, and instead use the host's MAXPHYADDR.  Per AMD'S APM:

  Maximum guest physical address size in bits. This number applies only
  to guests using nested paging. When this field is zero, refer to the
  PhysAddrSize field for the maximum guest physical address size.

Fixes: 24c82e576b78 ("KVM: Sanitize cpuid")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210623230552.4027702-2-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
arch/x86/kvm/cpuid.c