From: Sean Christopherson <seanjc@google.com>
To: Gautam Menghani <gautammenghani201@gmail.com>
Cc: pbonzini@redhat.com, shuah@kernel.org, yang.zhong@intel.com,
jmattson@google.com, peterx@redhat.com, guang.zeng@intel.com,
wei.w.wang@intel.com, dmatlack@google.com, vkuznets@redhat.com,
kvm@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel-mentees@lists.linuxfoundation.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests/kvm: Add error messages before skipping tests in vm_xsave_req_perm()
Date: Thu, 7 Jul 2022 23:10:50 +0000 [thread overview]
Message-ID: <Ysdn+ia40BSKnXU+@google.com> (raw)
In-Reply-To: <20220704163538.31165-1-gautammenghani201@gmail.com>
On Mon, Jul 04, 2022, Gautam Menghani wrote:
> Add messages in the checks that are performed before making a request
> with ARCH_REQ_XCOMP_GUEST_PERM.
>
> Signed-off-by: Gautam Menghani <gautammenghani201@gmail.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);
> + }
This is no longer necessary as of commit 7ed397d107d4 ("KVM: selftests: Add
TEST_REQUIRE macros to reduce skipping copy+paste"), which will automagically
print the missing requirement before calling exit().
Thanks much for the patch though!
prev parent reply other threads:[~2022-07-07 23:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-04 16:35 [PATCH] selftests/kvm: Add error messages before skipping tests in vm_xsave_req_perm() Gautam Menghani
2022-07-07 23:10 ` Sean Christopherson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Ysdn+ia40BSKnXU+@google.com \
--to=seanjc@google.com \
--cc=dmatlack@google.com \
--cc=gautammenghani201@gmail.com \
--cc=guang.zeng@intel.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=shuah@kernel.org \
--cc=vkuznets@redhat.com \
--cc=wei.w.wang@intel.com \
--cc=yang.zhong@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).