All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: xen-devel@lists.xenproject.org,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCHv4 04/14] xen: remove scratch frames for ballooned pages and m2p override
Date: Tue, 27 Jan 2015 11:17:46 +0000	[thread overview]
Message-ID: <alpine.DEB.2.02.1501271117090.9702@kaball.uk.xensource.com> (raw)
In-Reply-To: <54C772FB.6020000@citrix.com>

On Tue, 27 Jan 2015, David Vrabel wrote:
> On 27/01/15 11:10, Stefano Stabellini wrote:
> > On Tue, 27 Jan 2015, David Vrabel wrote:
> >> On 27/01/15 10:57, Stefano Stabellini wrote:
> >>> On Mon, 26 Jan 2015, David Vrabel wrote:
> >>>> The scratch frame mappings for ballooned pages and the m2p override
> >>>> are broken.  Remove them in preparation for replacing them with
> >>>> simpler mechanisms that works.
> >>>>
> >>>> The scratch pages did not ensure that the page was not in use.  In
> >>>> particular, the foreign page could still be in use by hardware.  If
> >>>> the guest reused the frame the hardware could read or write that
> >>>> frame.
> >>>>
> >>>> The m2p override did not handle the same frame being granted by two
> >>>> different grant references.  Trying an M2P override lookup in this
> >>>> case is impossible.
> >>>>
> >>>> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> >>>
> >>> [...]
> >>>
> >>>>  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)
> >>>>  {
> >>>>  	int i, ret = 0;
> >>>> -	bool lazy = false;
> >>>>  	pte_t *pte;
> >>>>  
> >>>>  	if (xen_feature(XENFEAT_auto_translated_physmap))
> >>>>  		return 0;
> >>>>  
> >>>> -	if (kmap_ops &&
> >>>> -	    !in_interrupt() &&
> >>>> -	    paravirt_get_lazy_mode() == PARAVIRT_LAZY_NONE) {
> >>>> -		arch_enter_lazy_mmu_mode();
> >>>> -		lazy = true;
> >>>> +	if (kmap_ops) {
> >>>> +		ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref,
> >>>> +						kmap_ops, count);
> >>>> +		if (ret)
> >>>> +			goto out;
> >>>>  	}
> >>>
> >>> I think that you should explain why you are adding one more grant table
> >>> mapping to a function meant to work on the p2m/m2p.  Everything else is
> >>> clear.
> >>
> >> I'm not.  This function has always done this.
> > 
> > Can you be more specific please?
> > 
> > I cannot see a call to HYPERVISOR_grant_table_op among the lines you are
> > removing from this function in this patch.
> 
> This function called m2p_add_override() which did the grant map
> hypercall (an op at a time).

OK. Add to the commit message please.

  reply	other threads:[~2015-01-27 11:18 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-26 17:01 [PATCHv4 00/14] xen: fix many long-standing grant mapping bugs David Vrabel
2015-01-26 17:01 ` [PATCHv4 01/14] mm: provide a find_special_page vma operation David Vrabel
2015-01-26 17:01 ` [PATCHv4 02/14] mm: add 'foreign' alias for the 'pinned' page flag David Vrabel
2015-01-26 17:01 ` [PATCHv4 03/14] xen/grant-table: pre-populate kernel unmap ops for xen_gnttab_unmap_refs() David Vrabel
2015-01-26 18:31   ` Stefano Stabellini
2015-01-27 11:55     ` David Vrabel
2015-01-26 17:01 ` [PATCHv4 04/14] xen: remove scratch frames for ballooned pages and m2p override David Vrabel
2015-01-27 10:57   ` Stefano Stabellini
2015-01-27 11:00     ` David Vrabel
2015-01-27 11:10       ` Stefano Stabellini
2015-01-27 11:14         ` David Vrabel
2015-01-27 11:17           ` Stefano Stabellini [this message]
2015-01-26 17:01 ` [PATCHv4 05/14] x86/xen: require ballooned pages for grant maps David Vrabel
2015-01-27 11:08   ` Stefano Stabellini
2015-01-26 17:01 ` [PATCHv4 06/14] xen/grant-table: add helpers for allocating pages David Vrabel
2015-01-27 11:13   ` Stefano Stabellini
2015-01-26 17:01 ` [PATCHv4 07/14] xen: mark grant mapped pages as foreign David Vrabel
2015-01-27 11:32   ` Stefano Stabellini
2015-01-26 17:01 ` [PATCHv4 08/14] xen-netback: use foreign page information from the pages themselves David Vrabel
2015-01-26 17:01 ` [PATCHv4 09/14] xen/grant-table: add a mechanism to safely unmap pages that are in use David Vrabel
2015-01-26 19:14   ` Stefano Stabellini
2015-01-26 17:01 ` [PATCHv4 10/14] xen/gntdev: convert priv->lock to a mutex David Vrabel
2015-01-26 18:57   ` Stefano Stabellini
2015-01-26 19:17     ` David Vrabel
2015-01-26 21:07       ` Stefano Stabellini
2015-01-27 10:00         ` David Vrabel
2015-01-27 10:20           ` Stefano Stabellini
2015-01-26 17:01 ` [PATCHv4 11/14] xen/gntdev: safely unmap grants in case they are still in use David Vrabel
2015-01-27 11:37   ` Stefano Stabellini
2015-01-26 17:01 ` [PATCHv4 12/14] xen-blkback: " David Vrabel
2015-01-26 19:21   ` Roger Pau Monné
2015-01-27 11:34   ` Stefano Stabellini
2015-01-26 17:01 ` [PATCHv4 13/14] xen/gntdev: mark userspace PTEs as special on x86 PV guests David Vrabel
2015-01-27 11:42   ` Stefano Stabellini
2015-01-26 17:01 ` [PATCHv4 14/14] xen/gntdev: provide find_special_page VMA operation David Vrabel
2015-01-27 11:45   ` 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.02.1501271117090.9702@kaball.uk.xensource.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.