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

Re: [Xen-devel] [v8][PATCH 13/17] xen/mem_access: don't allow accessing reserved device memory



Hi,

CC Tamas as he did some work on memaccess for ARM.

On 01/12/14 09:24, Tiejun Chen wrote:
> We can't expost those reserved device memory in case of mem_access

s/expost/expose/

> since any access may corrupt device usage.
> 
> Signed-off-by: Tiejun Chen <tiejun.chen@xxxxxxxxx>
> ---
>  xen/common/mem_access.c | 41 +++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 41 insertions(+)
> 
> diff --git a/xen/common/mem_access.c b/xen/common/mem_access.c
> index 6c2724b..72a807a 100644
> --- a/xen/common/mem_access.c
> +++ b/xen/common/mem_access.c
> @@ -55,6 +55,43 @@ void mem_access_resume(struct domain *d)
>      }
>  }
>  
> +/* We can't expose reserved device memory. */
> +static int mem_access_check_rdm(struct domain *d, uint64_aligned_t start,
> +                                uint32_t nr)
> +{
> +    uint32_t i;
> +    struct p2m_get_reserved_device_memory pgrdm;

p2m_get_reserved_device_memory is only defined on x86. This will fail to
compile on ARM when memaccess is enabled.

> +    int rc = 0;
> +
> +    if ( !is_hardware_domain(d) && iommu_use_hap_pt(d) )
> +    {
> +        for ( i = 0; i < nr; i++ )
> +        {
> +            pgrdm.gfn = start + i;
> +            pgrdm.domain = d;
> +            rc = 
> iommu_get_reserved_device_memory(p2m_check_reserved_device_memory,
> +                                                  &pgrdm);

Same here.

Overall, I'm not sure if it's worth to introduce this code in the common
part has it doesn't seem useful for ARM.

In any case, you have to at least stub those bits for ARM.

Regards,

-- 
Julien Grall

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