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

Re: [PATCH 3/6] x86/mem-paging: use guest handle for XENMEM_paging_op_prep



On 20.04.2020 14:31, Jan Beulich wrote:
> On 20.04.2020 14:20, Julien Grall wrote:
>> On 20/04/2020 13:12, Jan Beulich wrote:
>>> On 20.04.2020 14:08, Julien Grall wrote:
>>> Are the unions plain ones? I could see room for behavior like
>>> the one you describe with transparent unions, albeit still
>>> not quite like you describe it. Getting handle types to be
>>> properly type-checked by the compiler is pretty imperative imo.
>>
>> It looks like x86 is using structure, but arm is using plain union:
>>
>> #define ___DEFINE_XEN_GUEST_HANDLE(name, type)                  \
>>     typedef union { type *p; unsigned long q; }                 \
>>         __guest_handle_ ## name;                                \
>>     typedef union { type *p; uint64_aligned_t q; }              \
>>         __guest_handle_64_ ## name
> 
> I don't see how this would make a difference, and hence ...
> 
>> I will look at introducing a union on Arm.
> 
> ... how this would help. I must be missing something, or there
> must be a very curious bug in only the Arm gcc.

Compiling this (for x86) properly raises two errors:

union u1 { void *p; unsigned long v; };
union u2 { void *p; unsigned long v; };

void test(union u1 u1, union u2 u2) {
        test(u1, u1);
        test(u2, u2);
}

Jan



 


Rackspace

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