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

Re: [Xen-devel] [PATCH v4 6/9] arm/mem_access: Add software guest-page-table walk



Hi Julien,


On 06/22/2017 01:16 PM, Julien Grall wrote:
> Hi Sergej,
>
> On 20/06/17 21:33, Sergej Proskurin wrote:
>> +int guest_walk_tables(const struct vcpu *v, vaddr_t gva,
>> +                      paddr_t *ipa, unsigned int *perms)
>> +{
>> +    uint32_t sctlr = READ_SYSREG(SCTLR_EL1);
>> +    register_t tcr = READ_SYSREG(TCR_EL1);
>> +    unsigned int _perms = GV2M_READ;
>> +
>> +    /* We assume that the domain is running on the currently active
>> domain. */
>> +    if ( v != current )
>> +        return -EFAULT;
>> +
>> +    /* Allow perms to be NULL. */
>> +    perms = perms ?: &_perms;
>> +
>> +    /* If the MMU is disabled, there is no need to translate the
>> gva. */
>> +    if ( !(sctlr & SCTLR_M) )
>> +    {
>> +        *ipa = gva;
>> +
>> +        /* Memory can be accessed without any restrictions. */
>> +        *perms = GV2M_READ|GV2M_WRITE|GV2M_EXEC;
>> +
>> +        return 0;
>> +    }
>> +
>> +    if ( is_32bit_domain(v->domain) )
>> +    {
>> +        if ( !(tcr & TTBCR_EAE) )
>
> NIT: you can merge the two if to above one level of indentation. I.e:
>
> if ( is_32bit_domain(v->domain) && (!tcr & TTBCR_EAE) )
>   return guest_walk_ld(...);
> else
>   return guest_walk_ld(...);
>
> With that change:
>
> Acked-by: Julien Grall <julien.grall@xxxxxxx> 

I will do that right away, thanks.

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