From: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
To: Thomas Huth <thuth@redhat.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Janosch Frank <frankja@linux.ibm.com>,
kvm@vger.kernel.org
Cc: David Hildenbrand <david@redhat.com>,
Claudio Imbrenda <imbrenda@linux.ibm.com>,
Paolo Bonzini <pbonzini@redhat.com>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests: kvm: Check whether SIDA memop fails for normal guests
Date: Tue, 15 Feb 2022 11:03:20 +0100 [thread overview]
Message-ID: <a9a4bb87-2189-8c0a-8a94-6c6069fec7f7@linux.ibm.com> (raw)
In-Reply-To: <c01824a7-9d15-1356-2530-04c6112ace65@redhat.com>
On 2/15/22 10:59, Thomas Huth wrote:
> On 15/02/2022 10.54, Janis Schoetterl-Glausch wrote:
>> On 2/15/22 08:48, Thomas Huth wrote:
>>> Commit 2c212e1baedc ("KVM: s390: Return error on SIDA memop on normal
>>> guest") fixed the behavior of the SIDA memops for normal guests. It
>>> would be nice to have a way to test whether the current kernel has
>>> the fix applied or not. Thus add a check to the KVM selftests for
>>> these two memops.
>>>
>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>> ---
>>> tools/testing/selftests/kvm/s390x/memop.c | 15 +++++++++++++++
>>> 1 file changed, 15 insertions(+)
>>>
>>> diff --git a/tools/testing/selftests/kvm/s390x/memop.c b/tools/testing/selftests/kvm/s390x/memop.c
>>> index 9f49ead380ab..d19c3ffdea3f 100644
>>> --- a/tools/testing/selftests/kvm/s390x/memop.c
>>> +++ b/tools/testing/selftests/kvm/s390x/memop.c
>>> @@ -160,6 +160,21 @@ int main(int argc, char *argv[])
>>> run->psw_mask &= ~(3UL << (63 - 17)); /* Disable AR mode */
>>> vcpu_run(vm, VCPU_ID); /* Run to sync new state */
>>>
>>> + /* Check that the SIDA calls are rejected for non-protected guests */
>>> + ksmo.gaddr = 0;
>>> + ksmo.flags = 0;
>>> + ksmo.size = 8;
>>> + ksmo.op = KVM_S390_MEMOP_SIDA_READ;
>>> + ksmo.buf = (uintptr_t)mem1;
>>> + ksmo.sida_offset = 0x1c0;
>>
>> What is the rational for that constant?
>> Any would do, as long as size + offset < PAGE_SIZE, correct?
>
> Right, it's rather a random value.
Ah, ok.
Reviewed-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
>
> Thomas
>
next prev parent reply other threads:[~2022-02-15 10:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-15 7:48 Thomas Huth
2022-02-15 9:23 ` Claudio Imbrenda
2022-02-15 9:54 ` Janis Schoetterl-Glausch
2022-02-15 9:59 ` Thomas Huth
2022-02-15 10:03 ` Janis Schoetterl-Glausch [this message]
2022-02-15 12:11 ` Christian Borntraeger
2022-02-15 15:25 ` Shuah Khan
2022-02-21 9:31 ` Thomas Huth
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=a9a4bb87-2189-8c0a-8a94-6c6069fec7f7@linux.ibm.com \
--to=scgl@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=david@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=thuth@redhat.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
all inboxes | Powered by JetHome®