From: Sean Christopherson <seanjc@google.com>
To: Shaoqin Huang <shahuang@redhat.com>
Cc: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
Shuah Khan <shuah@kernel.org>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] KVM: selftests: Fix Assertion on non-x86_64 platforms
Date: Fri, 8 Dec 2023 08:21:12 -0800 [thread overview]
Message-ID: <ZXNCd5UKYS_90xAD@google.com> (raw)
In-Reply-To: <20231208033505.2930064-1-shahuang@redhat.com>
On Thu, Dec 07, 2023, Shaoqin Huang wrote:
> When running the set_memory_region_test on arm64 platform, it causes the
> below assert:
>
> ==== Test Assertion Failure ====
> set_memory_region_test.c:355: r && errno == EINVAL
> pid=40695 tid=40695 errno=0 - Success
> 1 0x0000000000401baf: test_invalid_memory_region_flags at set_memory_region_test.c:355
> 2 (inlined by) main at set_memory_region_test.c:541
> 3 0x0000ffff951c879b: ?? ??:0
> 4 0x0000ffff951c886b: ?? ??:0
> 5 0x0000000000401caf: _start at ??:?
> KVM_SET_USER_MEMORY_REGION should have failed on v2 only flag 0x2
>
> This is because the arm64 platform also support the KVM_MEM_READONLY flag, but
> the current implementation add it into the supportd_flags only on x86_64
> platform, so this causes assert on other platform which also support the
> KVM_MEM_READONLY flag.
>
> Fix it by using the __KVM_HAVE_READONLY_MEM macro to detect if the
> current platform support the KVM_MEM_READONLY, thus fix this problem on
> all other platform which support KVM_MEM_READONLY.
>
> Fixes: 5d74316466f4 ("KVM: selftests: Add a memory region subtest to validate invalid flags")
> Signed-off-by: Shaoqin Huang <shahuang@redhat.com>
> ---
/facepalm
Reviewed-by: Sean Christopherson <seanjc@google.com>
prev parent reply other threads:[~2023-12-08 16:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-08 3:35 [PATCH v1] KVM: selftests: Fix Assertion on non-x86_64 platforms Shaoqin Huang
2023-12-08 5:07 ` Gavin Shan
2023-12-08 16:21 ` 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=ZXNCd5UKYS_90xAD@google.com \
--to=seanjc@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=shahuang@redhat.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