All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "George Dunlap" <George.Dunlap@eu.citrix.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Wei Liu" <wl@xen.org>, "Roger Pau Monné" <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH v2 6/9] x86/HVM: relax shadow mode check in hvm_set_cr3()
Date: Tue, 17 Sep 2019 08:16:28 +0200	[thread overview]
Message-ID: <4e44e6e6-ca5c-dd93-2407-f92f6a82b053@suse.com> (raw)
In-Reply-To: <625c29ba-cfb8-88ee-eb15-5f2019198865@suse.com>

There's no need to re-obtain a page reference if only bits not affecting
the address change.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2325,7 +2325,7 @@ int hvm_set_cr3(unsigned long value, boo
     }
 
     if ( hvm_paging_enabled(v) && !paging_mode_hap(currd) &&
-         (value != v->arch.hvm.guest_cr[3]) )
+         ((value ^ v->arch.hvm.guest_cr[3]) >> PAGE_SHIFT) )
     {
         /* Shadow-mode CR3 change. Check PDBR and update refcounts. */
         HVM_DBG_LOG(DBG_LEVEL_VMMU, "CR3 value = %lx", value);


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2019-09-17  6:16 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-17  5:58 [Xen-devel] [PATCH v2 0/9] XSA-292 follow-up Jan Beulich
2019-09-17  6:13 ` [Xen-devel] [PATCH v2 1/9] x86: adjust cr3_pcid() return type Jan Beulich
2019-09-17 18:12   ` Andrew Cooper
2019-09-17  6:13 ` [Xen-devel] [PATCH v2 2/9] x86: limit the amount of TLB flushing in switch_cr3_cr4() Jan Beulich
2019-09-17 18:51   ` Andrew Cooper
2019-09-17  6:14 ` [Xen-devel] [PATCH v2 3/9] x86/mm: honor opt_pcid also for 32-bit PV domains Jan Beulich
2019-09-17 19:00   ` Andrew Cooper
2019-09-18  9:22     ` Jan Beulich
2019-09-18 11:55       ` Andrew Cooper
2019-09-18 12:04         ` Jan Beulich
2019-09-17  6:15 ` [Xen-devel] [PATCH v2 4/9] x86/HVM: move NOFLUSH handling out of hvm_set_cr3() Jan Beulich
2019-09-17 12:45   ` Paul Durrant
2019-09-17 13:03     ` Jan Beulich
2019-09-17 13:38       ` Paul Durrant
2019-09-17 19:31   ` Andrew Cooper
2019-09-18  9:29     ` Jan Beulich
2019-09-18 15:43       ` Tamas K Lengyel
2019-09-17  6:15 ` [Xen-devel] [PATCH v2 5/9] x86/HVM: refuse CR3 loads with reserved (upper) bits set Jan Beulich
2019-09-17 19:35   ` Andrew Cooper
2019-09-18  9:05     ` Jan Beulich
2019-09-17  6:16 ` Jan Beulich [this message]
2019-09-17 19:37   ` [Xen-devel] [PATCH v2 6/9] x86/HVM: relax shadow mode check in hvm_set_cr3() Andrew Cooper
2019-09-17  6:16 ` [Xen-devel] [PATCH v2 7/9] x86/HVM: cosmetics to hvm_set_cr3() Jan Beulich
2019-09-17 19:39   ` Andrew Cooper
2019-09-17  6:17 ` [Xen-devel] [PATCH v2 8/9] x86/CPUID: drop INVPCID dependency on PCID Jan Beulich
2019-09-17 19:59   ` Andrew Cooper
2019-09-18  9:10     ` Jan Beulich
2019-09-18 11:59       ` Andrew Cooper
2019-09-17  6:17 ` [Xen-devel] [PATCH v2 9/9] x86: PCID is unused when !PV Jan Beulich
2019-09-17 20:00   ` Andrew Cooper

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=4e44e6e6-ca5c-dd93-2407-f92f6a82b053@suse.com \
    --to=jbeulich@suse.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=roger.pau@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 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.