[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220704163538.31165-1-gautammenghani201@gmail.com>
Date: Mon, 4 Jul 2022 22:05:38 +0530
From: Gautam Menghani <gautammenghani201@...il.com>
To: pbonzini@...hat.com, shuah@...nel.org
Cc: Gautam Menghani <gautammenghani201@...il.com>,
yang.zhong@...el.com, jmattson@...gle.com, peterx@...hat.com,
guang.zeng@...el.com, wei.w.wang@...el.com, dmatlack@...gle.com,
vkuznets@...hat.com, kvm@...r.kernel.org,
linux-kselftest@...r.kernel.org,
linux-kernel-mentees@...ts.linuxfoundation.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] selftests/kvm: Add error messages before skipping tests in vm_xsave_req_perm()
Add messages in the checks that are performed before making a request
with ARCH_REQ_XCOMP_GUEST_PERM.
Signed-off-by: Gautam Menghani <gautammenghani201@...il.com>
---
tools/testing/selftests/kvm/lib/x86_64/processor.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/kvm/lib/x86_64/processor.c b/tools/testing/selftests/kvm/lib/x86_64/processor.c
index ead7011ee8f6..c74e846661b7 100644
--- a/tools/testing/selftests/kvm/lib/x86_64/processor.c
+++ b/tools/testing/selftests/kvm/lib/x86_64/processor.c
@@ -643,11 +643,15 @@ void vm_xsave_req_perm(int bit)
if (rc == -1 && (errno == ENXIO || errno == EINVAL))
exit(KSFT_SKIP);
TEST_ASSERT(rc == 0, "KVM_GET_DEVICE_ATTR(0, KVM_X86_XCOMP_GUEST_SUPP) error: %ld", rc);
- if (!(bitmask & (1ULL << bit)))
+ if (!(bitmask & (1ULL << bit))) {
+ print_skip("Userspace address of attr data is blank");
exit(KSFT_SKIP);
+ }
- if (!is_xfd_supported())
+ if (!is_xfd_supported()) {
+ print_skip("XFD is not supported");
exit(KSFT_SKIP);
+ }
rc = syscall(SYS_arch_prctl, ARCH_REQ_XCOMP_GUEST_PERM, bit);
--
2.36.1
Powered by blists - more mailing lists