|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v4 2/3] bitmap: import bitmap_{set/clear} from Linux 5.5
On 05/02/2020 13:27, Jan Beulich wrote: On 05.02.2020 14:21, Roger Pau Monné wrote:On Wed, Feb 05, 2020 at 09:46:25AM +0100, Jan Beulich wrote:On 04.02.2020 18:34, Roger Pau Monne wrote:Import the functions and it's dependencies. Based on Linux 5.5, commit id d5226fa6dbae0569ee43ecfc08bdcd6770fc4755. Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>Thanks for going this route; two remarks / requests:--- a/xen/common/bitmap.c +++ b/xen/common/bitmap.c @@ -212,6 +212,47 @@ int __bitmap_weight(const unsigned long *bitmap, int bits) #endif EXPORT_SYMBOL(__bitmap_weight);+void __bitmap_set(unsigned long *map, unsigned int start, int len)
BIT_WORD used to use BITS_PER_LONG but this was changed in commit:
commit cd338e967c598bf747b03dcfd9d8d45dc40bac1a
Author: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Thu May 8 16:13:55 2014 +0100
xen: arm: bitops take unsigned int
Xen bitmaps can be 4 rather than 8 byte aligned, so use the
appropriate type.
Otherwise the compiler can generate unaligned 8 byte accesses and
cause traps.
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
On 64-bit Arm, while we allow unaligned access, the atomic operations
still enforce alignment.
On 32-bit Arm, there are no unaligned access allowed. However, the change of BIT_WORD is not a concern for 32-bit. I haven't check whether we still have places where bitops are used with 4 byte aligned memory. However, as the bitops take a void * in parameter, there are no promise on the alignment. Therefore, we can't rewrite BIT_WORD without addressing the underlying issues. Introducing BIT_LONG is probably the easiest way at the moment. However, our bitops really ought to specify the alignment in parameter to avoid such issues arising. I would be in favor of using unsigned long *. This seems quite far off, so if you don't mind I would rather have the original v3 2/2 using set_bit: https://lists.xenproject.org/archives/html/xen-devel/2020-02/msg00190.htmlAs per my previous reply - yes, I'm okay with that, and yes, expecting this I've also kept your patches this way in my to-be-committed folder (pending Kevin's ack for patch 1). Jan Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |