linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC V2 PATCH 0/8] selftests: KVM: selftests for fd-based approach of supporting private memory
@ 2022-05-11  0:08 Vishal Annapurve
  2022-05-11  0:08 ` [RFC V2 PATCH 1/8] selftests: kvm: Fix inline assembly for hypercall Vishal Annapurve
                   ` (10 more replies)
  0 siblings, 11 replies; 24+ messages in thread
From: Vishal Annapurve @ 2022-05-11  0:08 UTC (permalink / raw)
  To: x86, kvm, linux-kernel, linux-kselftest
  Cc: pbonzini, vkuznets, wanpengli, jmattson, joro, tglx, mingo, bp,
	dave.hansen, hpa, shauh, yang.zhong, drjones, ricarkol,
	aaronlewis, wei.w.wang, kirill.shutemov, corbet, hughd, jlayton,
	bfields, akpm, chao.p.peng, yu.c.zhang, jun.nakajima,
	dave.hansen, michael.roth, qperret, steven.price, ak, david,
	luto, vbabka, marcorr, erdemaktas, pgonda, nikunj, seanjc,
	diviness, Vishal Annapurve

This v2 series implements selftests targeting the feature floated by Chao
via:
https://lore.kernel.org/linux-mm/20220310140911.50924-1-chao.p.peng@linux.intel.com/

Below changes aim to test the fd based approach for guest private memory
in context of normal (non-confidential) VMs executing on non-confidential
platforms.

priv_memfd_test.c file adds a suite of selftests to access private memory
from the guest via private/shared accesses and checking if the contents
can be leaked to/accessed by vmm via shared memory view.

Updates in V2:
1) Tests are added to exercise implicit/explicit memory conversion paths.
2) Test is added to exercise UPM feature without double memory allocation.

This series has dependency on following patches:
1) V5 series patches from Chao mentioned above.
2) https://github.com/vishals4gh/linux/commit/b9adedf777ad84af39042e9c19899600a4add68a
  - Fixes host kernel crash with current implementation
3) https://github.com/vishals4gh/linux/commit/0577e351ee36d52c1f6cdcb1b8de7aa6b5f760fe
  - Confidential platforms along with the confidentiality aware software stack
    support a notion of private/shared accesses from the confidential VMs.
    Generally, a bit in the GPA conveys the shared/private-ness of the access.

    Non-confidential platforms don't have a notion of private or shared accesses
    from the guest VMs. To support this notion, KVM_HC_MAP_GPA_RANGE is modified
    to allow marking an access from a VM within a GPA range as always shared or
    private. There is an ongoing discussion about adding support for
    software-only confidential VMs, which should replace this patch.
4) https://github.com/vishals4gh/linux/commit/8d46aea9a7d72e4b1b998066ce0dde085fb963a7
  - Temporary placeholder to be able to test memory conversion paths
    till the memory conversion exit error code is finalized.
5) https://github.com/vishals4gh/linux/commit/4c36706477c62d9416d635fa6ac4ef6484014dfc
  - Fixes GFN calculation during memory conversion path.

Github link for the patches posted as part of this series:
https://github.com/vishals4gh/linux/commits/priv_memfd_selftests_rfc_v2

Austin Diviness (1):
  selftests: kvm: Add hugepage support to priv_memfd_test suite.

Vishal Annapurve (7):
  selftests: kvm: Fix inline assembly for hypercall
  selftests: kvm: Add a basic selftest to test private memory
  selftests: kvm: priv_memfd_test: Add support for memory conversion
  selftests: kvm: priv_memfd_test: Add shared access test
  selftests: kvm: Add implicit memory conversion tests
  selftests: kvm: Add KVM_HC_MAP_GPA_RANGE hypercall test
  selftests: kvm: priv_memfd: Add test avoiding double allocation

 tools/testing/selftests/kvm/Makefile          |    1 +
 .../selftests/kvm/lib/x86_64/processor.c      |    2 +-
 tools/testing/selftests/kvm/priv_memfd_test.c | 1359 +++++++++++++++++
 3 files changed, 1361 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/selftests/kvm/priv_memfd_test.c

-- 
2.36.0.512.ge40c2bad7a-goog


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

end of thread, other threads:[~2022-07-21 21:16 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-11  0:08 [RFC V2 PATCH 0/8] selftests: KVM: selftests for fd-based approach of supporting private memory Vishal Annapurve
2022-05-11  0:08 ` [RFC V2 PATCH 1/8] selftests: kvm: Fix inline assembly for hypercall Vishal Annapurve
2022-05-12 17:31   ` Shuah Khan
2022-05-11  0:08 ` [RFC V2 PATCH 2/8] selftests: kvm: Add a basic selftest to test private memory Vishal Annapurve
2022-05-12 17:29   ` Shuah Khan
2022-07-20 23:03   ` Sean Christopherson
2022-07-21 20:24     ` Vishal Annapurve
2022-07-21 21:16       ` Sean Christopherson
2022-05-11  0:08 ` [RFC V2 PATCH 3/8] selftests: kvm: priv_memfd_test: Add support for memory conversion Vishal Annapurve
2022-05-12 17:40   ` Shuah Khan
2022-05-11  0:08 ` [RFC V2 PATCH 4/8] selftests: kvm: priv_memfd_test: Add shared access test Vishal Annapurve
2022-05-12 17:45   ` Shuah Khan
2022-05-11  0:08 ` [RFC V2 PATCH 5/8] selftests: kvm: Add implicit memory conversion tests Vishal Annapurve
2022-05-12 17:48   ` Shuah Khan
2022-05-11  0:08 ` [RFC V2 PATCH 6/8] selftests: kvm: Add KVM_HC_MAP_GPA_RANGE hypercall test Vishal Annapurve
2022-05-12 17:50   ` Shuah Khan
2022-05-11  0:08 ` [RFC V2 PATCH 7/8] selftests: kvm: Add hugepage support to priv_memfd_test suite Vishal Annapurve
2022-05-12 17:51   ` Shuah Khan
2022-05-11  0:08 ` [RFC V2 PATCH 8/8] selftests: kvm: priv_memfd: Add test avoiding double allocation Vishal Annapurve
2022-05-12 17:52   ` Shuah Khan
2022-05-11  0:08 ` [RFC V2 PATCH 8/8] selftests: kvm: priv_memfd: Add test without " Vishal Annapurve
2022-05-12 18:04 ` [RFC V2 PATCH 0/8] selftests: KVM: selftests for fd-based approach of supporting private memory Shuah Khan
2022-05-12 18:18   ` Vishal Annapurve
2022-07-20 22:19 ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).