From: Muhammad Usama Anjum <Usama.Anjum@collabora.com>
To: Patrick Roy <roypat@amazon.co.uk>,
pbonzini@redhat.com, shuah@kernel.org, kvm@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Usama.Anjum@collabora.com, chao.p.peng@linux.intel.com,
ackerleytng@google.com, seanjc@google.com, graf@amazon.com,
jgowans@amazon.com
Subject: Re: [PATCH] kvm: selftest: fix noop test in guest_memfd_test.c
Date: Sat, 26 Oct 2024 13:59:43 +0500 [thread overview]
Message-ID: <491968e4-ced7-4ee1-a09e-477e30759d10@collabora.com> (raw)
In-Reply-To: <20241024095956.3668818-1-roypat@amazon.co.uk>
On 10/24/24 2:59 PM, Patrick Roy wrote:
> The loop in test_create_guest_memfd_invalid that is supposed to test
> that nothing is accepted as a valid flag to KVM_CREATE_GUEST_MEMFD was
> initializing `flag` as 0 instead of BIT(0). This caused the loop to
> immediately exit instead of iterating over BIT(0), BIT(1), ... .
>
> Fixes: 8a89efd43423 ("KVM: selftests: Add basic selftest for guest_memfd()")
> Signed-off-by: Patrick Roy <roypat@amazon.co.uk>
> ---
> tools/testing/selftests/kvm/guest_memfd_test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/kvm/guest_memfd_test.c b/tools/testing/selftests/kvm/guest_memfd_test.c
> index ba0c8e9960358..ce687f8d248fc 100644
> --- a/tools/testing/selftests/kvm/guest_memfd_test.c
> +++ b/tools/testing/selftests/kvm/guest_memfd_test.c
> @@ -134,7 +134,7 @@ static void test_create_guest_memfd_invalid(struct kvm_vm *vm)
> size);
> }
>
> - for (flag = 0; flag; flag <<= 1) {
> + for (flag = BIT(0); flag; flag <<= 1) {
> fd = __vm_create_guest_memfd(vm, page_size, flag);
> TEST_ASSERT(fd == -1 && errno == EINVAL,
> "guest_memfd() with flag '0x%lx' should fail with EINVAL",
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
--
BR,
Muhammad Usama Anjum
next prev parent reply other threads:[~2024-10-26 9:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-24 9:59 [PATCH] kvm: selftest: fix noop test in guest_memfd_test.c Patrick Roy
2024-10-24 10:19 ` Gowans, James
2024-10-26 8:59 ` Muhammad Usama Anjum [this message]
2024-10-31 19:51 ` Sean Christopherson
2024-11-05 5:53 ` Sean Christopherson
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=491968e4-ced7-4ee1-a09e-477e30759d10@collabora.com \
--to=usama.anjum@collabora.com \
--cc=ackerleytng@google.com \
--cc=chao.p.peng@linux.intel.com \
--cc=graf@amazon.com \
--cc=jgowans@amazon.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=roypat@amazon.co.uk \
--cc=seanjc@google.com \
--cc=shuah@kernel.org \
/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