[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xen: fix alignment for bitops



On Tue, Apr 15, 2014 at 8:35 AM, Jan Beulich <JBeulich@xxxxxxxx> wrote:
>>>> On 14.04.14 at 22:43, <murzin.v@xxxxxxxxx> wrote:
>>  I'd appreciate any thought how to fix it in the right way if suggest patch
>>  doesn't look appropriate ;)
>
> Clearly by making the bitops tolerate 32-bit aligned pointers rather
> than modifying common code with ugly hacks that aren't even
> necessary on x86 and arm32; I don't think this would remain the

Agree it is not perfect, and it is why I asked about any other
reasonable ways to fix it.
In case of 32-bit arches effect of the patch is going to be nop.

> only place you'd need to alter - we simply assume bitops on 32-bit
> aligned quantities to work.
>

You do, but reality seems to be different, apart from arm64 looks like
ppc64 has the same alignment requirement, I'm not aware about other
64-bit implementations... but, is it really possible to convince all
these people to change the implementation? I guess the answer would be
"use unsigned long", or like that :)

Looking at the past "unsigned long vs u32" not a news for Xen project
[1], and I guess the only reason for BM is a simple workaround for
that.

Any other thought? Should we involve arch people in discussion?

[1] http://lists.xen.org/archives/html/xen-devel/2005-10/msg00242.html

Vladimir
> Jan
>
>> --- a/drivers/xen/events/events_fifo.c
>> +++ b/drivers/xen/events/events_fifo.c
>> @@ -285,7 +285,7 @@ static void consume_one_event(unsigned cpu,
>>  static void evtchn_fifo_handle_events(unsigned cpu)
>>  {
>>       struct evtchn_fifo_control_block *control_block;
>> -     uint32_t ready;
>> +     uint32_t __aligned(sizeof(long)) ready;
>>       unsigned q;
>>
>>       control_block = per_cpu(cpu_control_block, cpu);
>
>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.