xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"julien.grall@arm.com" <julien.grall@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [Xen-devel] [PATCH v4 6/7] xen/arm: don't iomem_permit_access for reserved-memory regions
Date: Fri, 9 Aug 2019 15:56:17 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.21.1908091524160.7788@sstabellini-ThinkPad-T480s> (raw)
In-Reply-To: <87pnlfh3dc.fsf@epam.com>

On Thu, 8 Aug 2019, Volodymyr Babchuk wrote:
> 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@xilinx.com>
> > ---
> >
> > 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.

Well spotted! I inverted the condition by mistake.


> >      {
> > -        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?

I'll change it to return early from the function for reserved-memory
regions.

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

  reply	other threads:[~2019-08-09 22:56 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-06 21:49 [Xen-devel] [PATCH v4 0/7] reserved-memory in dom0 Stefano Stabellini
2019-08-06 21:49 ` [Xen-devel] [PATCH v4 1/7] xen/arm: extend device_tree_for_each_node Stefano Stabellini
2019-08-07 16:08   ` Julien Grall
2019-08-07 16:16     ` Julien Grall
2019-08-09 22:01     ` Stefano Stabellini
2019-08-06 21:49 ` [Xen-devel] [PATCH v4 2/7] xen/arm: make process_memory_node a device_tree_node_func Stefano Stabellini
2019-08-07 16:19   ` Julien Grall
2019-08-09 21:08     ` Stefano Stabellini
2019-08-06 21:49 ` [Xen-devel] [PATCH v4 3/7] xen/arm: keep track of reserved-memory regions Stefano Stabellini
2019-08-07 16:33   ` Julien Grall
2019-08-09 22:19     ` Stefano Stabellini
2019-08-09 23:57       ` Julien Grall
2019-08-12 18:10         ` Stefano Stabellini
2019-08-07 16:46   ` Julien Grall
2019-08-09 20:37     ` Stefano Stabellini
2019-08-06 21:49 ` [Xen-devel] [PATCH v4 4/7] xen/arm: early_print_info print reserved_mem Stefano Stabellini
2019-08-07 16:36   ` Julien Grall
2019-08-09 20:29     ` Stefano Stabellini
2019-08-06 21:49 ` [Xen-devel] [PATCH v4 5/7] xen/arm: handle reserved-memory in consider_modules and dt_unreserved_regions Stefano Stabellini
2019-08-06 21:49 ` [Xen-devel] [PATCH v4 6/7] xen/arm: don't iomem_permit_access for reserved-memory regions Stefano Stabellini
2019-08-08 19:19   ` Volodymyr Babchuk
2019-08-09 22:56     ` Stefano Stabellini [this message]
2019-08-12 10:43       ` Julien Grall
2019-08-12 17:45         ` Stefano Stabellini
2019-08-06 21:49 ` [Xen-devel] [PATCH v4 7/7] xen/arm: add reserved-memory regions to the dom0 memory node Stefano Stabellini
2019-08-07 18:29   ` Julien Grall
2019-08-08 19:11 ` [Xen-devel] [PATCH v4 0/7] reserved-memory in dom0 Volodymyr Babchuk
2019-08-08 19:16   ` 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.1908091524160.7788@sstabellini-ThinkPad-T480s \
    --to=sstabellini@kernel.org \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=julien.grall@arm.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).