|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] RISCV/bitops: Use Zbb to provide arch-optimised bitops
On 3/25/25 5:46 PM, Jan Beulich wrote:
On 25.03.2025 17:35, Oleksii Kurochko wrote:On 3/7/25 1:12 PM, Andrew Cooper wrote:On 07/03/2025 12:01 pm, Jan Beulich wrote:On 07.03.2025 12:50, Oleksii Kurochko wrote:On 3/6/25 9:19 PM, Andrew Cooper wrote:On 05/03/2025 7:34 am, Jan Beulich wrote: Yes, but then if we want to move it to xen/config.h then it will be needed to:
in Arm's asm/config.h to have something like:
#ifdef CONFIG_ARM_32
#define BITS_PER_LONG 32
#endif
and then in xen/config.h
#ifndef BITS_PER_LONG
#define BITS_PER_LONG 64
#endif
But I wanted to not have #ifndef BITS_PER_LONG in xen/config.h. (or using CONFIG_ARM_32 in xen/config.h)
If it is okay to have this #ifndef in xen/config.h then we can do in that way.
Also, it seems like the follwoing could be moved there too: #define POINTER_ALIGN BYTES_PER_LONGThis one is likely fine to move.#define BITS_PER_LLONG 64This one is only fine to move imo when converted to #define BITS_PER_LONG (BYTES_PER_LLONG << 3)Erm? That's mixing long and long long types. Presuming that's an errant L, then sure.#define BITS_PER_BYTE 8Personally I'd rather leave this per-arch. The others can truly be derived; this one can't be. If we centralize, imo we should also convert the " << 3" to " * BITS_PER_BYTE".It is highly unlikely that Xen will ever run on a system where CHAR_BIT isn't 8. So I suggest it stays central to reduce complexity. If an arch ever needs to change it, the complexity can be added then.Does it make sense to ifdef that? Or, at least, before defintion of BITS_PER_BYTE something like: #if CHAR_BIT != 8 #error "CHAR_BIT isn't 8" #endifWhere would CHAR_BIT come from? Oh, perhaps you mean __CHAR_BIT__? If all compilers we can build with supply that value, we could indeed centrally use either #define BITS_PER_BYTE __CHAR_BIT__ or #define BITS_PER_BYTE 8 #if BITS_PER_BYTE != __CHAR_BIT__ # error "..." #endif Sorry, I meant __CHAR_BIT__. Thanks. ~ Oleksii
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |