ia64/xen-unstable

changeset 4494:d946608e6ddc

bitkeeper revision 1.1279 (42546416zxlkOnJgFX_0JvQ0FjNFDw)

Fix address canonicalisation in do_set_segment_base().
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Apr 06 22:35:02 2005 +0000 (2005-04-06)
parents 28c4d8ceff3c
children 4c5d6dc1eafe
files xen/arch/x86/x86_64/mm.c xen/include/asm-x86/x86_64/page.h
line diff
     1.1 --- a/xen/arch/x86/x86_64/mm.c	Wed Apr 06 12:46:25 2005 +0000
     1.2 +++ b/xen/arch/x86/x86_64/mm.c	Wed Apr 06 22:35:02 2005 +0000
     1.3 @@ -249,8 +249,7 @@ long do_set_segment_base(unsigned int wh
     1.4  {
     1.5      struct exec_domain *ed = current;
     1.6  
     1.7 -    /* Canonicalise the base address. */
     1.8 -    base |= ~VADDR_MASK;
     1.9 +    base = canonicalise_virt_address(base);
    1.10  
    1.11      switch ( which )
    1.12      {
     2.1 --- a/xen/include/asm-x86/x86_64/page.h	Wed Apr 06 12:46:25 2005 +0000
     2.2 +++ b/xen/include/asm-x86/x86_64/page.h	Wed Apr 06 22:35:02 2005 +0000
     2.3 @@ -98,6 +98,15 @@ typedef l4_pgentry_t root_pgentry_t;
     2.4  #define L3_DISALLOW_MASK ((cpu_has_nx?0:(1UL<<63)) | (7UL << 7))
     2.5  #define L4_DISALLOW_MASK ((cpu_has_nx?0:(1UL<<63)) | (7UL << 7))
     2.6  
     2.7 +#ifndef __ASSEMBLY__
     2.8 +static inline unsigned long canonicalise_virt_address(unsigned long v)
     2.9 +{
    2.10 +    v &= VADDR_MASK;
    2.11 +    if ( v & (1UL << (VADDR_BITS - 1)) )
    2.12 +        v |= ~VADDR_MASK;
    2.13 +}
    2.14 +#endif /* !__ASSEMBLY__ */
    2.15 +
    2.16  #endif /* __X86_64_PAGE_H__ */
    2.17  
    2.18  /*