public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] KVM: selftests: Fix nx_huge_pages_test when TDP is disabled
@ 2022-09-28 18:48 David Matlack
  2022-09-28 18:48 ` [PATCH v2 1/3] KVM: selftests: Tell the compiler that code after TEST_FAIL() is unreachable David Matlack
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: David Matlack @ 2022-09-28 18:48 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Sean Christopherson, David Matlack, Ben Gardon, Jim Mattson,
	Peter Xu, Yang Zhong, Wei Wang, kvm

This builds on the v1 fix for nx_huge_pages_test for TDP-disabled hosts.
Originally this was just 1 patch but now it is 3 to add the necessary
infrastructure to check if TDP is enabled or not so that we can
conditionally use 4KiB or 2MiB mappings in the test.

Sean, I opted not to refactor virt_map() to take nr_bytes since that
will take a bit more work than I have cycles for at the moment and I
want to get this fix in. That being said, I coded up the new
virt_map_level() using nr_bytes so that there will be less to clean up
in the future.

v2:
 - Still use 4K mappins on TDP-enabled hosts [Sean]
 - Generalize virt_map_2m() to virt_map_level() [me]
 - Pass nr_bytes instead of nr_pages to virt_map_level() [Sean]

v1: https://lore.kernel.org/kvm/20220926175219.605113-1-dmatlack@google.com/

David Matlack (3):
  KVM: selftests: Tell the compiler that code after TEST_FAIL() is
    unreachable
  KVM: selftests: Add helper to read boolean module parameters
  KVM: selftests: Fix nx_huge_pages_test on TDP-disabled hosts

 .../testing/selftests/kvm/include/test_util.h |  7 +++-
 .../selftests/kvm/include/x86_64/processor.h  |  4 ++
 tools/testing/selftests/kvm/lib/test_util.c   | 31 ++++++++++++++
 .../selftests/kvm/lib/x86_64/processor.c      | 40 +++++++++++++------
 .../selftests/kvm/x86_64/nx_huge_pages_test.c | 19 ++++++++-
 5 files changed, 85 insertions(+), 16 deletions(-)


base-commit: 372d07084593dc7a399bf9bee815711b1fb1bcf2
prerequisite-patch-id: 2e3661ba8856c29b769499bac525b6943d9284b8
-- 
2.37.3.998.g577e59143f-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-29 16:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-28 18:48 [PATCH v2 0/3] KVM: selftests: Fix nx_huge_pages_test when TDP is disabled David Matlack
2022-09-28 18:48 ` [PATCH v2 1/3] KVM: selftests: Tell the compiler that code after TEST_FAIL() is unreachable David Matlack
2022-09-28 18:48 ` [PATCH v2 2/3] KVM: selftests: Add helper to read boolean module parameters David Matlack
2022-09-28 22:51   ` Sean Christopherson
2022-09-29 16:18     ` David Matlack
2022-09-28 18:48 ` [PATCH v2 3/3] KVM: selftests: Fix nx_huge_pages_test on TDP-disabled hosts David Matlack
2022-09-28 22:55   ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox