WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Fix address canonicalisation in do_set_segment_base().

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix address canonicalisation in do_set_segment_base().
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Wed, 06 Apr 2005 22:35:02 +0000
Delivery-date: Thu, 07 Apr 2005 09:03:03 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1279, 2005/04/06 23:35:02+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        Fix address canonicalisation in do_set_segment_base().
        Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>



 arch/x86/x86_64/mm.c          |    3 +--
 include/asm-x86/x86_64/page.h |    9 +++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)


diff -Nru a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c  2005-04-07 05:03:09 -04:00
+++ b/xen/arch/x86/x86_64/mm.c  2005-04-07 05:03:09 -04:00
@@ -249,8 +249,7 @@
 {
     struct exec_domain *ed = current;
 
-    /* Canonicalise the base address. */
-    base |= ~VADDR_MASK;
+    base = canonicalise_virt_address(base);
 
     switch ( which )
     {
diff -Nru a/xen/include/asm-x86/x86_64/page.h 
b/xen/include/asm-x86/x86_64/page.h
--- a/xen/include/asm-x86/x86_64/page.h 2005-04-07 05:03:09 -04:00
+++ b/xen/include/asm-x86/x86_64/page.h 2005-04-07 05:03:09 -04:00
@@ -98,6 +98,15 @@
 #define L3_DISALLOW_MASK ((cpu_has_nx?0:(1UL<<63)) | (7UL << 7))
 #define L4_DISALLOW_MASK ((cpu_has_nx?0:(1UL<<63)) | (7UL << 7))
 
+#ifndef __ASSEMBLY__
+static inline unsigned long canonicalise_virt_address(unsigned long v)
+{
+    v &= VADDR_MASK;
+    if ( v & (1UL << (VADDR_BITS - 1)) )
+        v |= ~VADDR_MASK;
+}
+#endif /* !__ASSEMBLY__ */
+
 #endif /* __X86_64_PAGE_H__ */
 
 /*

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix address canonicalisation in do_set_segment_base()., BitKeeper Bot <=