From: Julien Grall <julien@xen.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Roger Pau Monné" <roger.pau@citrix.com>,
xen-devel@lists.xenproject.org,
"Julien Grall" <jgrall@amazon.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Wei Liu" <wl@xen.org>,
"Oleksandr Tyshchenko" <oleksandr_tyshchenko@epam.com>
Subject: Re: [PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64()
Date: Thu, 20 Aug 2020 10:14:02 +0100 [thread overview]
Message-ID: <7f37a386-d758-ac3e-c32b-f7bb1b523f52@xen.org> (raw)
In-Reply-To: <0fc30c51-9a7b-6421-ecdf-dbdbb76480f7@suse.com>
On 19/08/2020 10:22, Jan Beulich wrote:
> On 17.08.2020 15:03, Julien Grall wrote:
>> On 17/08/2020 12:50, Roger Pau Monné wrote:
>>> On Mon, Aug 17, 2020 at 12:05:54PM +0100, Julien Grall wrote:
>>>> The only way I could see to make it work would be to use the same trick as
>>>> we do for {read, write}_atomic() (see asm-arm/atomic.h). We are using union
>>>> and void pointer to prevent explicit cast.
>>>
>>> I'm mostly worried about common code having assumed that cmpxchg
>>> does also handle 64bit sized parameters, and thus failing to use
>>> cmpxchg64 when required. I assume this is not much of a deal as then
>>> the Arm 32 build would fail, so it should be fairly easy to catch
>>> those.
>> FWIW, this is not very different to the existing approach. If one would
>> use cmpxchg() with 64-bit, then it would fail to compile.
>
> A somewhat related question then: Do you really need both the
> guest_* and the non-guest variants? Limiting things to plain
> cmpxchg() would further reduce the risk of someone picking the
> wrong one without right away noticing the build issue on Arm32.
> For guest_cmpxchg{,64}() I think there's less of a risk.
For the IOREQ code, we will need the guest_* version that is built on
top of the non-guest variant.
I would like at least consistency between the two variants. IOW, if we
decide to use the name guest_cmpxchg64(), then I would like to use
cmpxchg64().
I still need to explore the code generated by cmpxchg() if I include
support for 64-bit.
Cheers,
--
Julien Grall
next prev parent reply other threads:[~2020-08-20 9:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-15 17:21 [PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64() Julien Grall
2020-08-16 19:26 ` Oleksandr
2020-08-17 9:24 ` Roger Pau Monné
2020-08-17 9:42 ` Julien Grall
2020-08-17 10:33 ` Roger Pau Monné
2020-08-17 11:05 ` Julien Grall
2020-08-17 11:50 ` Roger Pau Monné
2020-08-17 13:03 ` Julien Grall
2020-08-17 14:20 ` Roger Pau Monné
2020-08-19 9:22 ` Jan Beulich
2020-08-20 9:14 ` Julien Grall [this message]
2020-08-20 9:25 ` Jan Beulich
2020-08-20 9:34 ` Julien Grall
2020-08-19 9:18 ` Jan Beulich
2020-08-17 22:56 ` Stefano Stabellini
2020-08-18 10:30 ` Julien Grall
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=7f37a386-d758-ac3e-c32b-f7bb1b523f52@xen.org \
--to=julien@xen.org \
--cc=Volodymyr_Babchuk@epam.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=jgrall@amazon.com \
--cc=oleksandr_tyshchenko@epam.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.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;
as well as URLs for NNTP newsgroup(s).