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

Re: [Xen-devel] [PATCH v3 03/38] arm/p2m: Introduce p2m_(switch|restore)_vttbr_and_(g|s)et_flags




On 02/09/16 09:40, Sergej Proskurin wrote:
> Hi Julien,

Hello Sergej,

> On 09/01/2016 05:51 PM, Julien Grall wrote:
>> Hello Sergej,
>>
>> On 16/08/16 23:16, Sergej Proskurin wrote:
>>> This commit introduces macros for switching and restoring the vttbr
>>> considering the currently set irq flags. We define these macros, as the
>>> following commits will use the associated functionality multiple times
>>> throughout the file ./xen/arch/arm/p2m.c.
>>>
>>> Signed-off-by: Sergej Proskurin <proskurin@xxxxxxxxxxxxx>
>>> ---
>>> Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
>>> Cc: Julien Grall <julien.grall@xxxxxxx>
>>> ---
>>>  xen/arch/arm/p2m.c | 37 +++++++++++++++++++++++--------------
>>>  1 file changed, 23 insertions(+), 14 deletions(-)
>>>
>>> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
>>> index 08114d8..02e9ee7 100644
>>> --- a/xen/arch/arm/p2m.c
>>> +++ b/xen/arch/arm/p2m.c
>>> @@ -27,6 +27,26 @@ static unsigned int __read_mostly p2m_root_level;
>>>
>>>  #define P2M_ROOT_PAGES    (1<<P2M_ROOT_ORDER)
>>>
>>> +#define p2m_switch_vttbr_and_get_flags(ovttbr, nvttbr, flags)       \
>>> +({                                                                  \
>>
>> It makes more sense to save the content of VTTBR_EL2 in the macro.
>>
> 
> I assume you mean the VTTBR_EL2 within the macro parameter ovttbr. I
> will move the definition of the ovttbr variable into the macro and
> return its value at the end so that it can be subsequently provided with
> the "p2m_restore_vttbr_and_set_flags" macro. Thank you.

I meant

#define p2m_switch_vttbr_and_get_flags(ovttbr, nvttbr, flags)           \
({                                                                      \
        ovttbr = READ_SYSREG(VTTBR_EL2);                                \
        if ( ovttbr != nvttbr )                                         \
        {                                                               \
                local_irq_save(flags);                                  \
                WRITE_SYSREG64(nvttbr, VTTBR_EL2);                      \
                isb();                                                  \
        }
})

Regards,

-- 
Julien Grall

_______________________________________________
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®.