From: Tim Deegan Subject: [PATCH 2 of 5] Nested p2m: remove bogus check of CR3 value Date: Mon, 27 Jun 2011 11:46:12 +0100 Message-ID: <3c756243b74302daee24.1309171572@whitby.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Christoph Egger List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User Tim Deegan # Date 1308929084 -3600 # Node ID 3c756243b74302daee24fa77b9000e4039c897e3 # Parent 44c7b977302663487922a5d822d1d4032badfebc Nested p2m: remove bogus check of CR3 value. 0 is a valid CR3 value; CR3_EADDR isn't but there's nothing stopping a guest from putting it in its VMCB. The special case was broken anyway since AFAICT "p2m->cr3" is a nester-cr3 (i.e. p2m-table) value and guest_cr[3] is an actual-cr3 (pagetable) value. Signed-off-by: Tim Deegan diff -r 44c7b9773026 -r 3c756243b743 xen/arch/x86/mm/p2m.c --- a/xen/arch/x86/mm/p2m.c Fri Jun 24 16:24:44 2011 +0100 +++ b/xen/arch/x86/mm/p2m.c Fri Jun 24 16:24:44 2011 +0100 @@ -1122,8 +1122,8 @@ p2m_get_nestedp2m(struct vcpu *v, uint64 struct p2m_domain *p2m; int i; - if (cr3 == 0 || cr3 == CR3_EADDR) - cr3 = v->arch.hvm_vcpu.guest_cr[3]; + /* Mask out low bits; this avoids collisions with CR3_EADDR */ + cr3 &= ~(0xfffull); if (nv->nv_flushp2m && nv->nv_p2m) { nv->nv_p2m = NULL;