xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@citrix.com>
To: Tim Deegan <Tim.Deegan@eu.citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	xen devel <xen-devel@lists.xensource.com>,
	????????? <zpfalpc23@gmail.com>
Subject: Re: Re: changeset 22526:7a5ee3800417
Date: Mon, 07 Mar 2011 16:57:01 +0000	[thread overview]
Message-ID: <1299517021.19262.4704.camel@elijah> (raw)
In-Reply-To: <20110307164824.GE28479@whitby.uk.xensource.com>

On Mon, 2011-03-07 at 16:48 +0000, Tim Deegan wrote:
> Hi, 
> 
> At 16:41 +0000 on 07 Mar (1299516062), George Dunlap wrote:
> > diff -r 809ea782d2e6 -r 7ddd021a2079 xen/arch/x86/mm/hap/p2m-ept.c
> > --- a/xen/arch/x86/mm/hap/p2m-ept.c	Mon Mar 07 16:33:45 2011 +0000
> > +++ b/xen/arch/x86/mm/hap/p2m-ept.c	Mon Mar 07 16:41:02 2011 +0000
> > @@ -390,7 +390,7 @@
> >              new_entry.access = p2ma;
> >              new_entry.rsvd2_snp = (iommu_enabled && iommu_snoop);
> >  
> > -            if ( new_entry.mfn == mfn_x(mfn) )
> > +            if ( ept_entry->mfn == mfn_x(mfn) )
> 
> Better to use old_entry.mfn, in the spirit of the original cset
> ("access-once semantics")?  

I started to do that, but the one below didn't have an old_entry
already.  

> In fact, I suspect that to be safe, you need
> to do an atomic RMW instead of just an atomic set, and then decide
> whether the VT-d tables will need to be synced.

Are we not holding the p2m lock when writing entries?

Reading should be safe here if we are holding the p2m lock.  When
holding the lock, we only need write-once semantics (to avoid racing the
read-once semantics of someone reading without the lock).

 -George

> 
> Cheers,
> 
> Tim. 
> 
> >                  need_modify_vtd_table = 0;
> >              else
> >                  new_entry.mfn = mfn_x(mfn);
> > @@ -438,7 +438,7 @@
> >          new_entry.access = p2ma;
> >          new_entry.rsvd2_snp = (iommu_enabled && iommu_snoop);
> >  
> > -        if ( new_entry.mfn == mfn_x(mfn) )
> > +        if ( ept_entry->mfn == mfn_x(mfn) )
> >               need_modify_vtd_table = 0;
> >          else /* the caller should take care of the previous page */
> >              new_entry.mfn = mfn_x(mfn);
> 
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xensource.com
> > http://lists.xensource.com/xen-devel
> 
> 

  reply	other threads:[~2011-03-07 16:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTimqNJWRWzSj1BYPP5T7GAhSK_=70T9dq5CW94iB@mail.gmail.com>
2011-03-07 16:20 ` changeset 22526:7a5ee3800417 George Dunlap
2011-03-07 16:41   ` George Dunlap
2011-03-07 16:48     ` Tim Deegan
2011-03-07 16:57       ` George Dunlap [this message]
2011-03-09  8:44         ` Tim Deegan
2011-03-09 13:57           ` George Dunlap
2011-03-09 13:59     ` George Dunlap
2011-03-10  9:41       ` George Dunlap
2011-03-10  9:43         ` George Dunlap
2011-03-10 12:49           ` 答复: [Xen-devel] " zpfalpc23
2011-03-16 10:27           ` zpfalpc23
2011-03-17 12:01             ` 答复: " George Dunlap

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=1299517021.19262.4704.camel@elijah \
    --to=george.dunlap@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Tim.Deegan@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=zpfalpc23@gmail.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;
as well as URLs for NNTP newsgroup(s).