[PATCH 0/2] nVMX: Ensure host's PAT stays sane

Sean Christopherson posted 2 patches 1 year, 8 months ago
x86/vmx.c       |  4 +++-
x86/vmx_tests.c | 10 +++++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
[PATCH 0/2] nVMX: Ensure host's PAT stays sane
Posted by Sean Christopherson 1 year, 8 months ago
Fix a bug(s) where test_load_host_pat clobbers PAT and causes all
subsequent tests to effectively run with all memory mapped as UC.  Xiangfei
first noticed that this caused rdtsc_vmexit_diff_test to fail, but it can
also lead to timeouts if more tests are added, i.e. if more stuff runs after
test_load_host_pat.

Sean Christopherson (2):
  nVMX: Ensure host's PAT is loaded at the end of all VMX tests
  nVMX: Verify KVM actually loads the value in HOST_PAT into the PAT MSR

 x86/vmx.c       |  4 +++-
 x86/vmx_tests.c | 10 +++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)


base-commit: 765b349b6c4b1c06473dfea548a15f799e0fbc2b
-- 
2.45.1.467.gbab1589fc0-goog
Re: [PATCH 0/2] nVMX: Ensure host's PAT stays sane
Posted by Sean Christopherson 1 year, 8 months ago
On Wed, 05 Jun 2024 15:45:25 -0700, Sean Christopherson wrote:
> Fix a bug(s) where test_load_host_pat clobbers PAT and causes all
> subsequent tests to effectively run with all memory mapped as UC.  Xiangfei
> first noticed that this caused rdtsc_vmexit_diff_test to fail, but it can
> also lead to timeouts if more tests are added, i.e. if more stuff runs after
> test_load_host_pat.
> 
> Sean Christopherson (2):
>   nVMX: Ensure host's PAT is loaded at the end of all VMX tests
>   nVMX: Verify KVM actually loads the value in HOST_PAT into the PAT MSR
> 
> [...]

Applied to kvm-x86 next, thanks!

[1/2] nVMX: Ensure host's PAT is loaded at the end of all VMX tests
      https://github.com/kvm-x86/kvm-unit-tests/commit/8cbb8d3cbca9
[2/2] nVMX: Verify KVM actually loads the value in HOST_PAT into the PAT MSR
      https://github.com/kvm-x86/kvm-unit-tests/commit/d31433807f2b

--
https://github.com/kvm-x86/kvm-unit-tests/tree/next
Re: [PATCH 0/2] nVMX: Ensure host's PAT stays sane
Posted by Yan Zhao 1 year, 8 months ago
On Tue, Jun 11, 2024 at 06:18:40PM -0700, Sean Christopherson wrote:
> On Wed, 05 Jun 2024 15:45:25 -0700, Sean Christopherson wrote:
> > Fix a bug(s) where test_load_host_pat clobbers PAT and causes all
> > subsequent tests to effectively run with all memory mapped as UC.  Xiangfei
> > first noticed that this caused rdtsc_vmexit_diff_test to fail, but it can
> > also lead to timeouts if more tests are added, i.e. if more stuff runs after
> > test_load_host_pat.
> > 
> > Sean Christopherson (2):
> >   nVMX: Ensure host's PAT is loaded at the end of all VMX tests
> >   nVMX: Verify KVM actually loads the value in HOST_PAT into the PAT MSR
> > 
> > [...]
> 
> Applied to kvm-x86 next, thanks!
> 
> [1/2] nVMX: Ensure host's PAT is loaded at the end of all VMX tests
>       https://github.com/kvm-x86/kvm-unit-tests/commit/8cbb8d3cbca9
This is also good, though I thought you would fix the theoretical one as
https://lore.kernel.org/all/ZmesywdpFG3qDIkZ@google.com/ :)

> [2/2] nVMX: Verify KVM actually loads the value in HOST_PAT into the PAT MSR
>       https://github.com/kvm-x86/kvm-unit-tests/commit/d31433807f2b
> 
> --
> https://github.com/kvm-x86/kvm-unit-tests/tree/next
Re: [PATCH 0/2] nVMX: Ensure host's PAT stays sane
Posted by Sean Christopherson 1 year, 8 months ago
On Wed, Jun 12, 2024, Yan Zhao wrote:
> On Tue, Jun 11, 2024 at 06:18:40PM -0700, Sean Christopherson wrote:
> > On Wed, 05 Jun 2024 15:45:25 -0700, Sean Christopherson wrote:
> > > Fix a bug(s) where test_load_host_pat clobbers PAT and causes all
> > > subsequent tests to effectively run with all memory mapped as UC.  Xiangfei
> > > first noticed that this caused rdtsc_vmexit_diff_test to fail, but it can
> > > also lead to timeouts if more tests are added, i.e. if more stuff runs after
> > > test_load_host_pat.
> > > 
> > > Sean Christopherson (2):
> > >   nVMX: Ensure host's PAT is loaded at the end of all VMX tests
> > >   nVMX: Verify KVM actually loads the value in HOST_PAT into the PAT MSR
> > > 
> > > [...]
> > 
> > Applied to kvm-x86 next, thanks!
> > 
> > [1/2] nVMX: Ensure host's PAT is loaded at the end of all VMX tests
> >       https://github.com/kvm-x86/kvm-unit-tests/commit/8cbb8d3cbca9
> This is also good, though I thought you would fix the theoretical one as
> https://lore.kernel.org/all/ZmesywdpFG3qDIkZ@google.com/ :)

Doh, I did squash that, I just forgot to update the "thanks" email with the
correct hashes.

[1/2] nVMX: Ensure host's PAT is loaded at the end of all VMX tests
      https://github.com/kvm-x86/kvm-unit-tests/commit/184ee0d5
[2/2] nVMX: Verify KVM actually loads the value in HOST_PAT into the PAT MSR
      https://github.com/kvm-x86/kvm-unit-tests/commit/ee1d79c3
Re: [PATCH 0/2] nVMX: Ensure host's PAT stays sane
Posted by Sean Christopherson 1 year, 8 months ago
On Wed, Jun 05, 2024, Sean Christopherson wrote:
> Fix a bug(s) where test_load_host_pat clobbers PAT and causes all
> subsequent tests to effectively run with all memory mapped as UC.  Xiangfei
> first noticed that this caused rdtsc_vmexit_diff_test to fail, but it can
> also lead to timeouts if more tests are added, i.e. if more stuff runs after
> test_load_host_pat.
> 
> Sean Christopherson (2):
>   nVMX: Ensure host's PAT is loaded at the end of all VMX tests
>   nVMX: Verify KVM actually loads the value in HOST_PAT into the PAT MSR
> 
>  x86/vmx.c       |  4 +++-
>  x86/vmx_tests.c | 10 +++++++++-
>  2 files changed, 12 insertions(+), 2 deletions(-)

Doh, this is for kvm-unit-tests.  Been a while since I sent KUT patches...