[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] xen: Introduce cmpxchg64() and guest_cmpxchg64()
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. Jan
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |