xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: Oleksandr <olekstysh@gmail.com>
Cc: xen-devel@lists.xenproject.org, julien.grall@arm.com,
	Stefano Stabellini <sstabellini@kernel.org>,
	Stefano Stabellini <stefanos@xilinx.com>
Subject: Re: [Xen-devel] [PATCH v3 5/6] xen/arm: don't iomem_permit_access for reserved-memory regions
Date: Tue, 6 Aug 2019 12:29:53 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.21.1908061229290.2451@sstabellini-ThinkPad-T480s> (raw)
In-Reply-To: <89310c95-f697-a1b7-b63c-492307fa80d1@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3027 bytes --]

On Tue, 9 Jul 2019, Oleksandr wrote:
> 
> On 22.06.19 02:56, Stefano Stabellini wrote:
> 
> Hi, Stefano
> 
> > 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@xilinx.com>
> > ---
> > Changes in v4:
> > - new patch
> > ---
> >   xen/arch/arm/domain_build.c | 23 +++++++++++++++--------
> >   1 file changed, 15 insertions(+), 8 deletions(-)
> > 
> > diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> > index d9836779d1..76dd4bf6f9 100644
> > --- a/xen/arch/arm/domain_build.c
> > +++ b/xen/arch/arm/domain_build.c
> > @@ -1158,15 +1158,22 @@ static int __init map_range_to_domain(const struct
> > dt_device_node *dev,
> >       bool need_mapping = !dt_device_for_passthrough(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 ( strcmp(dt_node_name(dev), "reserved-memory") )
> 
> This filter doesn't catch child nodes if the "reserved-memory" node has ones.
> 
> Here is my "reserved-memory" node:
> 
> reserved-memory {
>         #address-cells = <2>;
>         #size-cells = <2>;
>         ranges;
> 
>         /* device specific region for Lossy Decompression */
>         lossy_decompress: linux,lossy_decompress@54000000 {
>             no-map;
>             reg = <0x00000000 0x54000000 0x0 0x03000000>;
>         };
> 
>         /* For Audio DSP */
>         adsp_reserved: linux,adsp@57000000 {
>             compatible = "shared-dma-pool";
>             reusable;
>             reg = <0x00000000 0x57000000 0x0 0x01000000>;
>         };
> 
>         /* global autoconfigured region for contiguous allocations */
>         linux,cma@58000000 {
>             compatible = "shared-dma-pool";
>             reusable;
>             reg = <0x00000000 0x58000000 0x0 0x18000000>;
>             linux,cma-default;
>         };
> 
>         /* device specific region for contiguous allocations */
>         mmp_reserved: linux,multimedia@70000000 {
>             compatible = "shared-dma-pool";
>             reusable;
>             reg = <0x00000000 0x70000000 0x0 0x10000000>;
>         };
>     };
> 
> 
> So, the dt_node_name(dev) for child nodes are:
> 
> - linux,lossy_decompress
> - linux,adsp
> - linux,cma
> - linux,multimedia
> 
> 
> Probably, we should check whether the parent node is "reserved-memory" as
> well.

Yes, that is a mistake, thanks for spotting it. I should check the
parent node name instead.

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-08-06 19:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-21 23:55 [Xen-devel] [PATCH v3 0/6] reserved-memory in dom0 Stefano Stabellini
2019-06-21 23:56 ` [Xen-devel] [PATCH v3 1/6] xen/arm: extend device_tree_for_each_node Stefano Stabellini
2019-07-10 15:18   ` Julien Grall
2019-06-21 23:56 ` [Xen-devel] [PATCH v3 2/6] xen/arm: make process_memory_node a device_tree_node_func Stefano Stabellini
2019-06-21 23:56 ` [Xen-devel] [PATCH v3 3/6] xen/arm: keep track of reserved-memory regions Stefano Stabellini
2019-07-08 19:02   ` Oleksandr
2019-07-10 15:54     ` Julien Grall
2019-08-06 19:20       ` Stefano Stabellini
2019-07-10 15:40   ` Julien Grall
2019-08-06 20:52     ` Stefano Stabellini
2019-06-21 23:56 ` [Xen-devel] [PATCH v3 4/6] xen/arm: handle reserved-memory in consider_modules and dt_unreserved_regions Stefano Stabellini
2019-07-10 16:40   ` Julien Grall
2019-06-21 23:56 ` [Xen-devel] [PATCH v3 5/6] xen/arm: don't iomem_permit_access for reserved-memory regions Stefano Stabellini
2019-07-09 10:29   ` Oleksandr
2019-08-06 19:29     ` Stefano Stabellini [this message]
2019-07-10 16:48   ` Julien Grall
2019-06-21 23:56 ` [Xen-devel] [PATCH v3 6/6] xen/arm: add reserved-memory regions to the dom0 memory node Stefano Stabellini
2019-07-10 17:03   ` Julien Grall
2019-08-06 21:27     ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.21.1908061229290.2451@sstabellini-ThinkPad-T480s \
    --to=sstabellini@kernel.org \
    --cc=julien.grall@arm.com \
    --cc=olekstysh@gmail.com \
    --cc=stefanos@xilinx.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).