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

Re: [Xen-devel] [RFC PATCH v3 04/10] arm/mem_access: Add short-descriptor pte typedefs



Hi Andrew,

On 06/15/2017 09:49 PM, Andrew Cooper wrote:
> On 15/06/17 20:44, Julien Grall wrote:
>> Hi Andrew,
>>
>> On 06/15/2017 01:03 PM, Andrew Cooper wrote:
>>> On 15/06/17 12:05, Sergej Proskurin wrote:
>>>> The current implementation does not provide appropriate types for
>>>> short-descriptor translation table entries. As such, this commit
>>>> adds new
>>>> types, which simplify managing the respective translation table
>>>> entries.
>>>>
>>>> Signed-off-by: Sergej Proskurin <proskurin@xxxxxxxxxxxxx>
>>>> ---
>>>> Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
>>>> Cc: Julien Grall <julien.grall@xxxxxxx>
>>>> ---
>>>> v3: Add more short-descriptor related pte typedefs that will be used by
>>>>      the following commits.
>>>> ---
>>>>   xen/include/asm-arm/page.h | 104
>>>> +++++++++++++++++++++++++++++++++++++++++++++
>>>>   1 file changed, 104 insertions(+)
>>>>
>>>> diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
>>>> index e2e4b597a5..7a4aa64144 100644
>>>> --- a/xen/include/asm-arm/page.h
>>>> +++ b/xen/include/asm-arm/page.h
>>>> @@ -205,6 +205,110 @@ typedef union {
>>>>       lpae_walk_t walk;
>>>>   } lpae_t;
>>>>   +/*
>>>> + *  Comprises bits of the level 1 short-descriptor format representing
>>>> + *  a section.
>>>> + */
>>>> +typedef struct __packed {
>>>> +    unsigned int pxn:1;         /* Privileged Execute Never */
>>>
>>> (I'm not an ARM maintainer, but) can I recommend using bool bitfields
>>> for boolean fields like this.
>>
>> I was not aware it was possible to do boolean fields. I am all for it.
> 
> There isn't a good example in xen yet, but
> http://xenbits.xen.org/gitweb/?p=xtf.git;a=commitdiff;h=f099211f2ebdadf61ae6416559220d69b788cd2b
> is the XTF work I'm basing some imminent Xen improvements on.
> 

Thanks for the advice. I did not know that you can use boolean types for
bitfields either. I will fix that right away.

Cheers,
~Sergej

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

 


Rackspace

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