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

Re: [Xen-devel] [PATCH v4 6/7] xen/arm: don't iomem_permit_access for reserved-memory regions


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Thu, 8 Aug 2019 19:19:11 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BYrAnpQp3FRRK5EcjLFpLEhnw/85P16Mjwh7oMWe9zc=; b=eKxNv8azb63/jnx/8SmCT1qU1IW48efKJFSSIWQg9hA5P3lYjeZyWDboQkLfDcqOATDUynFAGcdzQXASfEZvNd/r6BuycLYbrOjT17wyUp09rA7e67xJ/yW5D97JPRNTLF7uHkFoVJuMwvYk4DJP7T7kz2Vdqn6ecEZEE7gT6s24ZNuxZtpSEFoByKSzWZDVwuEijsUWwUAl9hxzBV4SI9cDBvRg01SAEfsrfYwWSw70F1vu/xaomAmH87pNiu3Na1fwMf1xPKyfihXJ1o3IIz3YgTc4Mn4hpy5o/8qmB4uaBmfFHhRAV/TYnsANsPk6apL7JIHjn+DBPzys0rbYIA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MbAhXqqZRl0PloChMxAefED6lQYBDNXrJze6VaxMi2ecTvTDhYzM2QGPElGg4QTeD3NqxqGZHlcTfTJYk8CxSNQV7eaEwoFvhr9zHjqhEa1KcsNbKQeZWJBRq+Hden6CY7wXahlGZf4cDQbkTjQj3NTC+u5WItTqmUpfxgdHtCAwT86mNlooMhPxx6U6eNcJXa1VeyaOG/2jbvrFRlHMJOeAtNrM/G0rJfCTjnL707fNoFjFGXhV2QK1dM++FFpZxaFtzFecN7qlOLI61io7v2Bk9y9SoFOGc2UFJdNiEENot8oofVHTKKc+Le+HChuQl6Ul8P92een80rs2DNcWgg==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Volodymyr_Babchuk@xxxxxxxx;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "julien.grall@xxxxxxx" <julien.grall@xxxxxxx>, Stefano Stabellini <stefanos@xxxxxxxxxx>
  • Delivery-date: Thu, 08 Aug 2019 19:19:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVTKDolHszhP/gS0iYSDHh38xNIKbxow6A
  • Thread-topic: [Xen-devel] [PATCH v4 6/7] xen/arm: don't iomem_permit_access for reserved-memory regions

Hi Stefano,

Stefano Stabellini writes:

> Don't allow reserved-memory regions to be remapped into any guests,
> until reserved-memory regions are properly supported in Xen. For now,
> do not call iomem_permit_access for them.
>
> Signed-off-by: Stefano Stabellini <stefanos@xxxxxxxxxx>
> ---
>
> Changes in v4:
> - compare the parent name with reserved-memory
> - use dt_node_cmp
>
> Changes in v3:
> - new patch
> ---
>  xen/arch/arm/domain_build.c | 24 ++++++++++++++++--------
>  1 file changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 4c8404155a..267e0549e2 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -1153,17 +1153,25 @@ static int __init map_range_to_domain(const struct 
> dt_device_node *dev,
>      struct map_range_data *mr_data = data;
>      struct domain *d = mr_data->d;
>      bool need_mapping = !dt_device_for_passthrough(dev);
> +    const struct dt_device_node *parent = dt_get_parent(dev);
>      int res;
>
> -    res = iomem_permit_access(d, paddr_to_pfn(addr),
> -                              paddr_to_pfn(PAGE_ALIGN(addr + len - 1)));
> -    if ( res )
> +    /*
> +     * Don't give iomem permissions for reserved-memory ranges until
> +     * reserved-memory support is complete.
> +     */
> +    if ( dt_node_cmp(dt_node_name(parent), "reserved-memory") == 0 )
Am I missing something, or you are permitting access only if it from a
"reserved-memory" node? This contradicts with patch description.

>      {
> -        printk(XENLOG_ERR "Unable to permit to dom%d access to"
> -               " 0x%"PRIx64" - 0x%"PRIx64"\n",
> -               d->domain_id,
> -               addr & PAGE_MASK, PAGE_ALIGN(addr + len) - 1);
> -        return res;
> +        res = iomem_permit_access(d, paddr_to_pfn(addr),
> +                                  paddr_to_pfn(PAGE_ALIGN(addr + len - 1)));
> +        if ( res )
> +        {
> +            printk(XENLOG_ERR "Unable to permit to dom%d access to"
> +                   " 0x%"PRIx64" - 0x%"PRIx64"\n",
> +                   d->domain_id,
> +                   addr & PAGE_MASK, PAGE_ALIGN(addr + len) - 1);
> +            return res;
> +        }
>      }
>
>      if ( need_mapping )
So, this region cold be mapped, but without the access?


--
Volodymyr Babchuk at EPAM
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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