[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y2womHanaMzETfwU@osiris>
Date: Wed, 9 Nov 2022 23:24:24 +0100
From: Heiko Carstens <hca@...ux.ibm.com>
To: Janis Schoetterl-Glausch <scgl@...ux.ibm.com>
Cc: Christian Borntraeger <borntraeger@...ux.ibm.com>,
Janosch Frank <frankja@...ux.ibm.com>,
Claudio Imbrenda <imbrenda@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
David Hildenbrand <david@...hat.com>,
Jonathan Corbet <corbet@....net>, kvm@...r.kernel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, linux-s390@...r.kernel.org,
Paolo Bonzini <pbonzini@...hat.com>,
Shuah Khan <shuah@...nel.org>,
Sven Schnelle <svens@...ux.ibm.com>
Subject: Re: [PATCH 5/5] s390/uaccess: add cmpxchg_user_key()
On Wed, Nov 09, 2022 at 04:46:29PM +0100, Janis Schoetterl-Glausch wrote:
> On Wed, 2022-11-02 at 15:19 +0100, Heiko Carstens wrote:
> > + case 1: {
> > + unsigned int prev, tmp, shift;
> > +
> > + shift = (3 ^ (address & 3)) << 3;
> > + address ^= address & 3;
> > + asm volatile(
> > + " spka 0(%[key])\n"
> > + " sacf 256\n"
> > + "0: l %[prev],%[address]\n"
> > + "1: nr %[prev],%[mask]\n"
> > + " lr %[tmp],%[prev]\n"
> > + " or %[prev],%[old]\n"
> > + " or %[tmp],%[new]\n"
> > + "2: cs %[prev],%[tmp],%[address]\n"
> > + "3: jnl 4f\n"
> > + " xr %[tmp],%[prev]\n"
> > + " nr %[tmp],%[mask]\n"
>
> Are you only entertaining cosmetic changes to cmpxchg.h?
I fail to parse what you are trying to say. Please elaborate.
> The loop condition being imprecise seems non-ideal.
What exactly is imprecise?
> > + [key] "a" (key),
>
> Why did you get rid of the << 4 shift?
> That's inconsistent with the other uaccess functions that take an access key.
That's not only inconsistent, but also a bug.
Thank you for pointing this out. Will be fixed.
Powered by blists - more mailing lists