From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: Zoltan Kiss <zoltan.kiss@citrix.com>
Cc: "Stefano Stabellini" <stefano.stabellini@eu.citrix.com>,
"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
"Boris Ostrovsky" <boris.ostrovsky@oracle.com>,
"David Vrabel" <david.vrabel@citrix.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ingo Molnar" <mingo@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, xen-devel@lists.xenproject.org,
linux-kernel@vger.kernel.org,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Jan Beulich" <jbeulich@suse.com>,
"Ian Campbell" <Ian.Campbell@citrix.com>
Subject: Re: [PATCH v9] xen/grant-table: Avoid m2p_override during mapping
Date: Thu, 20 Feb 2014 17:26:04 +0000 [thread overview]
Message-ID: <alpine.DEB.2.02.1402201724430.15812@kaball.uk.xensource.com> (raw)
In-Reply-To: <5301F74E.3070107@citrix.com>
On Mon, 17 Feb 2014, Zoltan Kiss wrote:
> On 16/02/14 18:36, Stefano Stabellini wrote:
> > On Wed, 12 Feb 2014, Zoltan Kiss wrote:
> > > diff --git a/arch/arm/include/asm/xen/page.h
> > > b/arch/arm/include/asm/xen/page.h
> > > index e0965ab..4eaeb3f 100644
> > > --- a/arch/arm/include/asm/xen/page.h
> > > +++ b/arch/arm/include/asm/xen/page.h
> > > @@ -97,16 +97,15 @@ static inline pte_t *lookup_address(unsigned long
> > > address, unsigned int *level)
> > > return NULL;
> > > }
> > >
> > > -static inline int m2p_add_override(unsigned long mfn, struct page *page,
> > > - struct gnttab_map_grant_ref *kmap_op)
> > > -{
> > > - return 0;
> > > -}
> > > -
> > > -static inline int m2p_remove_override(struct page *page, bool clear_pte)
> > > -{
> > > - return 0;
> > > -}
> > > +extern int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
> > > + struct gnttab_map_grant_ref *kmap_ops,
> > > + struct page **pages, unsigned int count,
> > > + bool m2p_override);
> > > +
> > > +extern int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref
> > > *unmap_ops,
> > > + struct gnttab_map_grant_ref *kmap_ops,
> > > + struct page **pages, unsigned int count,
> > > + bool m2p_override);
> >
> > Much much better.
> > The only comment I have is about this m2p_override boolean parameter.
> > m2p_override is now meaningless in this context, what we really want to
> > let the arch specific implementation know is whether the mapping is a
> > kernel only mapping or a userspace mapping.
> > Testing for kmap_ops != NULL might even be enough, but it would not
> > improve the interface.
> gntdev is the only user of this, the kmap_ops parameter there is:
> use_ptemod ? map->kmap_ops + offset : NULL
> where:
> use_ptemod = !xen_feature(XENFEAT_auto_translated_physmap);
> So I think we can't rely on kmap_ops to decide whether we should m2p_override
> or not.
>
> > Is it possible to realize if the mapping is a userspace mapping by
> > checking for GNTMAP_application_map in map_ops?
> > Otherwise I would keep the boolean and rename it to user_mapping.
> Sounds better, but as far as I see gntdev set that flag in find_grant_ptes,
> which is called only
>
> if (use_ptemod) {
> err = apply_to_page_range(vma->vm_mm, vma->vm_start,
> vma->vm_end - vma->vm_start,
> find_grant_ptes, map);
>
> So if xen_feature(XENFEAT_auto_translated_physmap), we don't have kmap_ops,
> and GNTMAP_application_map is not set as well, but I guess we still need
> m2p_override. Or not? I'm a bit confused, maybe because of Monday ...
If xen_feature(XENFEAT_auto_translated_physmap) we shouldn't need the
m2p_override.
next prev parent reply other threads:[~2014-02-20 17:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-12 20:54 Zoltan Kiss
2014-02-16 18:36 ` Stefano Stabellini
2014-02-17 11:49 ` Zoltan Kiss
2014-02-20 17:26 ` Stefano Stabellini [this message]
2014-02-20 17:36 ` Zoltan Kiss
2014-02-20 18:17 ` Stefano Stabellini
2014-02-20 18:19 ` David Vrabel
2014-02-20 18:26 ` Stefano Stabellini
2014-02-20 18:28 ` David Vrabel
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.02.1402201724430.15812@kaball.uk.xensource.com \
--to=stefano.stabellini@eu.citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=david.vrabel@citrix.com \
--cc=hpa@zytor.com \
--cc=jbeulich@suse.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=roger.pau@citrix.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.org \
--cc=zoltan.kiss@citrix.com \
/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
all inboxes | Powered by JetHome®