From: "Tian, Kevin" <kevin.tian@intel.com>
To: Roger Pau Monne <roger.pau@citrix.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Sergey Dyasli <sergey.dyasli@citrix.com>,
"Nakajima, Jun" <jun.nakajima@intel.com>, Wei Liu <wl@xen.org>,
George Dunlap <george.dunlap@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Paul Durrant <paul.durrant@citrix.com>,
Jan Beulich <jbeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] p2m/ept: pass correct level to atomic_write_ept_entry in ept_invalidate_emt
Date: Fri, 23 Aug 2019 05:58:29 +0000 [thread overview]
Message-ID: <AADFC41AFE54684AB9EE6CBC0274A5D19D545BBD@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20190820153745.40103-1-roger.pau@citrix.com>
> From: Roger Pau Monne [mailto:roger.pau@citrix.com]
> Sent: Tuesday, August 20, 2019 11:38 PM
>
> The level passed to ept_invalidate_emt corresponds to the EPT entry
> passed as the mfn parameter, which is a pointer to an EPT page table,
> hence the entries in that page table will have one level less than the
> parent.
>
> Fix the call to atomic_write_ept_entry to pass the correct level, ie:
> one level less than the parent.
>
> Fixes: 50fe6e73705 ('pvh dom0: add and remove foreign pages')
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> Cc: Jun Nakajima <jun.nakajima@intel.com>
> Cc: Kevin Tian <kevin.tian@intel.com>
> Cc: George Dunlap <george.dunlap@eu.citrix.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> Cc: Wei Liu <wl@xen.org>
> Cc: Sergey Dyasli <sergey.dyasli@citrix.com>
> Cc: Paul Durrant <paul.durrant@citrix.com>
> ---
> xen/arch/x86/mm/p2m-ept.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
> index 6b8468c793..23ae6e9da3 100644
> --- a/xen/arch/x86/mm/p2m-ept.c
> +++ b/xen/arch/x86/mm/p2m-ept.c
> @@ -367,7 +367,7 @@ static bool_t ept_invalidate_emt(struct p2m_domain
> *p2m, mfn_t mfn,
> e.emt = MTRR_NUM_TYPES;
> if ( recalc )
> e.recalc = 1;
> - rc = atomic_write_ept_entry(p2m, &epte[i], e, level);
> + rc = atomic_write_ept_entry(p2m, &epte[i], e, level - 1);
> ASSERT(rc == 0);
> changed = 1;
> }
Reviewed-by: Kevin Tian <kevin.tian@intel.com>.
One small comment about readability. What about renaming 'level'
to 'parent_level' in this function?
Thanks
Kevin
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-08-23 5:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-20 15:37 [Xen-devel] [PATCH] p2m/ept: pass correct level to atomic_write_ept_entry in ept_invalidate_emt Roger Pau Monne
2019-08-23 5:58 ` Tian, Kevin [this message]
2019-08-23 9:47 ` Roger Pau Monné
2019-08-27 15:23 ` Jan Beulich
2019-08-29 10:26 ` Roger Pau Monné
2019-08-29 10:35 ` Jan Beulich
2019-09-04 6:50 ` Tian, Kevin
2019-09-04 14:15 ` Roger Pau Monné
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=AADFC41AFE54684AB9EE6CBC0274A5D19D545BBD@SHSMSX104.ccr.corp.intel.com \
--to=kevin.tian@intel.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=jun.nakajima@intel.com \
--cc=paul.durrant@citrix.com \
--cc=roger.pau@citrix.com \
--cc=sergey.dyasli@citrix.com \
--cc=wl@xen.org \
--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).