All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Steven Smith <steven.smith@citrix.com>
Cc: Ian Campbell <Ian.Campbell@eu.citrix.com>,
	Steven Smith <Steven.Smith@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: Re: [PATCH] xen: reduce severity of message about using v1 grant tables.
Date: Thu, 03 Dec 2009 12:13:58 -0800	[thread overview]
Message-ID: <4B181C06.7040107@goop.org> (raw)
In-Reply-To: <20091203120116.GA15460@weybridge.uk.xensource.com>

On 12/03/09 04:01, Steven Smith wrote:
>> Oh, I see what you meant... in the proper resume case (as opposed to the
>> cancelled suspend/checkpoint case I was thinking of) there should be no
>> grant tables in use at this point so most devices should, in theory, be
>> able to reconnect using v1 grants, any drivers which require v2 grant
>> tables need to check for them in their resume hook as well as at start
>> of day.
>>
>> Unfortunately frontend devices tear down their grant entries after the
>> resume rather than before the suspend (I presume this has to do with
>> faster checkpointing?) which means they could be trying to clear an
>> entry of the wrong layout, leading the unbounded badness that the
>> comment refers to.
>>     
> Actually, I think that'd be okay.  Drivers should be clearing grant
> table entries through the gnttab_end_* functions, which always check
> grant_table_version and do the right thing.
> gnttab_grant_foreign_access_ref_{subpage,trans} would BUG(), but that
> could be turned into an error return easily enough.  Handling it
> everywhere would be a pain, though.
>
> The only other potential subtlety is handling a suspend while some
> other vcpu is doing grant table operations, but I think the
> stop_machine() is sufficient protection against that.
>   

Yes.  We already have to be careful to prevent pte updates from being
preempted by suspend, so grant operations are similar.  (When
CONFIG_PREEMPT is enabled, it is freeze/thaw which provides this guarantee.)

>  	BUG_ON(flags & (GTF_accept_transfer | GTF_reading |
>  			GTF_writing | GTF_sub_page | GTF_permit_access));
> -	BUG_ON(grant_table_version == 1);
> +	if (grant_table_version == 1)
>   

Rather than having all these version tests, would it make sense to have
a grant_ops vector?

    J

  parent reply	other threads:[~2009-12-03 20:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-02 19:28 [PATCH] xen: reduce severity of message about using v1 grant tables Ian Campbell
2009-12-02 19:33 ` Jeremy Fitzhardinge
2009-12-02 19:54   ` Ian Campbell
2009-12-03 10:28     ` Ian Campbell
2009-12-03 12:01       ` Steven Smith
2009-12-03 12:15         ` Ian Campbell
2009-12-03 14:47           ` Steven Smith
2009-12-03 20:15           ` Jeremy Fitzhardinge
2009-12-03 21:22             ` Ian Campbell
2009-12-03 20:13         ` Jeremy Fitzhardinge [this message]
2009-12-03 21:23           ` Ian Campbell
2009-12-03 20:10       ` Jeremy Fitzhardinge

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=4B181C06.7040107@goop.org \
    --to=jeremy@goop.org \
    --cc=Ian.Campbell@eu.citrix.com \
    --cc=Steven.Smith@eu.citrix.com \
    --cc=steven.smith@citrix.com \
    --cc=xen-devel@lists.xensource.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 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.