From: "Jan Beulich" Subject: [PATCH] x86-64: fix incorrect assertion in __maddr_to_virt() Date: Wed, 15 Jun 2011 16:35:21 +0100 Message-ID: <4DF8ED5902000078000476E9@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part25099D29.0__=" Return-path: 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" List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part25099D29.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline When memory map sparseness reduction is in use, machine address ranges can't validly be compared directly against the total size of the direct mapping range. Signed-off-by: Jan Beulich --- a/xen/include/asm-x86/x86_64/page.h +++ b/xen/include/asm-x86/x86_64/page.h @@ -95,7 +95,7 @@ static inline unsigned long __virt_to_ma =20 static inline void *__maddr_to_virt(unsigned long ma) { - ASSERT(ma < DIRECTMAP_VIRT_END - DIRECTMAP_VIRT_START); + ASSERT(pfn_to_pdx(ma >> PAGE_SHIFT) < (DIRECTMAP_SIZE >> PAGE_SHIFT));= return (void *)(DIRECTMAP_VIRT_START + ((ma & ma_va_bottom_mask) | ((ma & ma_top_mask) >> pfn_pdx_hole_shift))); --=__Part25099D29.0__= Content-Type: text/plain; name="x86_64-m2v-assert.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86_64-m2v-assert.patch" When memory map sparseness reduction is in use, machine address ranges=0Aca= n't validly be compared directly against the total size of the direct=0Amap= ping range.=0A=0ASigned-off-by: Jan Beulich =0A=0A--- = a/xen/include/asm-x86/x86_64/page.h=0A+++ b/xen/include/asm-x86/x86_64/page= .h=0A@@ -95,7 +95,7 @@ static inline unsigned long __virt_to_ma=0A =0A = static inline void *__maddr_to_virt(unsigned long ma)=0A {=0A- = ASSERT(ma < DIRECTMAP_VIRT_END - DIRECTMAP_VIRT_START);=0A+ ASSERT(pfn_t= o_pdx(ma >> PAGE_SHIFT) < (DIRECTMAP_SIZE >> PAGE_SHIFT));=0A return = (void *)(DIRECTMAP_VIRT_START +=0A ((ma & ma_va_bottom_= mask) |=0A ((ma & ma_top_mask) >> pfn_pdx_hole_shift))= );=0A --=__Part25099D29.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part25099D29.0__=--