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>,
Claudio Imbrenda <imbrenda@linux.ibm.com>,
Heiko Carstens <hca@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Alexander Gordeev <agordeev@linux.ibm.com>
Cc: David Hildenbrand <david@redhat.com>,
Jonathan Corbet <corbet@lwn.net>,
kvm@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-s390@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
Shuah Khan <shuah@kernel.org>,
Sven Schnelle <svens@linux.ibm.com>
Subject: Re: [PATCH v1 3/9] Documentation: KVM: s390: Describe KVM_S390_MEMOP_F_CMPXCHG
Date: Tue, 04 Oct 2022 20:51:36 +0200 [thread overview]
Message-ID: <dca9e17ffbe71c76665ba25a6d9cd91d4aa0c329.camel@linux.ibm.com> (raw)
In-Reply-To: <85399389-9b5a-d72a-5db1-b8418008ad58@redhat.com>
On Tue, 2022-10-04 at 10:16 +0200, Thomas Huth wrote:
> On 30/09/2022 23.07, Janis Schoetterl-Glausch wrote:
> > Describe the semantics of the new KVM_S390_MEMOP_F_CMPXCHG flag for
> > absolute vm write memops which allows user space to perform (storage key
> > checked) cmpxchg operations on guest memory.
> >
> > Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
> > ---
> > Documentation/virt/kvm/api.rst | 18 +++++++++++++++++-
> > 1 file changed, 17 insertions(+), 1 deletion(-)
> >
> > diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
> > index abd7c32126ce..0e02d66e38ae 100644
> > --- a/Documentation/virt/kvm/api.rst
> > +++ b/Documentation/virt/kvm/api.rst
> > @@ -3771,6 +3771,7 @@ Parameters are specified via the following structure::
> > struct {
What is the reason you initially didn't copy the /* in */ comment here?
Thanks for the reviews.
> > __u8 ar; /* the access register number */
> > __u8 key; /* access key, ignored if flag unset */
>
> Padding / alignment?
>
> > + __u64 old[2]; /* ignored if flag unset */
> > };
> > __u32 sida_offset; /* offset into the sida */
> > __u8 reserved[32]; /* ignored */
> > @@ -3853,8 +3854,23 @@ Absolute accesses are permitted for non-protected guests only.
> > Supported flags:
> > * ``KVM_S390_MEMOP_F_CHECK_ONLY``
> > * ``KVM_S390_MEMOP_F_SKEY_PROTECTION``
> > + * ``KVM_S390_MEMOP_F_CMPXCHG``
> > +
> > +The semantics of the flags common with logical acesses are as for logical accesses.
> > +
> > +For write accesses, the KVM_S390_MEMOP_F_CMPXCHG might be supported.
> > +In this case, instead of doing an unconditional write, the access occurs only
> > +if the target location contains the value provided in "old". This is performed
> > +as an atomic cmpxchg. "size" must be a power of two up to and including 16.
> > +Values with sizes <8 byte are to be provided by assignment to "old[1]".
> > +Doublewords are provided with the higher value word in "old[0]" and the lower
> > +word in "old[1]".
> > +The value at the target location is returned in "old", encoded in the same manner.
> > +If the value was exchanged the KVM_S390_MEMOP_F_CMPXCHG bit in "flags" is set to
> > +0, otherwise it remains set.
> > +The KVM_S390_MEMOP_F_CMPXCHG flag is supported if KVM_CAP_S390_MEM_OP_EXTENSION
> > +has bit 1 (i.e. bit with value 2) set.
>
> Please try to fit the text within 80 columns.
>
> Thanks,
> Thomas
>
next prev parent reply other threads:[~2022-10-04 18:52 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-30 21:07 [PATCH v1 0/9] KVM: s390: Extend MEM_OP ioctl by storage key checked cmpxchg Janis Schoetterl-Glausch
2022-09-30 21:07 ` [PATCH v1 1/9] s390/uaccess: Add storage key checked cmpxchg access to user space Janis Schoetterl-Glausch
2022-10-05 14:13 ` Claudio Imbrenda
2022-10-05 15:54 ` Janis Schoetterl-Glausch
2022-09-30 21:07 ` [PATCH v1 2/9] KVM: s390: Extend MEM_OP ioctl by storage key checked cmpxchg Janis Schoetterl-Glausch
2022-10-01 5:03 ` kernel test robot
2022-10-04 8:13 ` Thomas Huth
2022-10-05 6:32 ` Thomas Huth
2022-10-05 19:16 ` Janis Schoetterl-Glausch
2022-09-30 21:07 ` [PATCH v1 3/9] Documentation: KVM: s390: Describe KVM_S390_MEMOP_F_CMPXCHG Janis Schoetterl-Glausch
2022-10-04 8:16 ` Thomas Huth
2022-10-04 18:51 ` Janis Schoetterl-Glausch [this message]
2022-10-05 6:27 ` Thomas Huth
2022-09-30 21:07 ` [PATCH v1 4/9] KVM: s390: selftest: memop: Pass mop_desc via pointer Janis Schoetterl-Glausch
2022-10-04 8:18 ` Thomas Huth
2022-09-30 21:07 ` [PATCH v1 5/9] KVM: s390: selftest: memop: Replace macros by functions Janis Schoetterl-Glausch
2022-09-30 21:07 ` [PATCH v1 6/9] KVM: s390: selftest: memop: Add bad address test Janis Schoetterl-Glausch
2022-09-30 21:07 ` [PATCH v1 7/9] KVM: s390: selftest: memop: Add cmpxchg tests Janis Schoetterl-Glausch
2022-09-30 21:07 ` [PATCH v1 8/9] KVM: s390: selftest: memop: Fix typo Janis Schoetterl-Glausch
2022-10-01 3:13 ` Bagas Sanjaya
2022-10-04 8:21 ` Thomas Huth
2022-09-30 21:07 ` [PATCH v1 9/9] KVM: s390: selftest: memop: Fix wrong address being used in test Janis Schoetterl-Glausch
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=dca9e17ffbe71c76665ba25a6d9cd91d4aa0c329.camel@linux.ibm.com \
--to=scgl@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=corbet@lwn.net \
--cc=david@redhat.com \
--cc=frankja@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=shuah@kernel.org \
--cc=svens@linux.ibm.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;
as well as URLs for NNTP newsgroup(s).