direct-io.hg

changeset 10462:c5da6b25744a

Merge
author ack@localhost.localdomain
date Tue Jun 20 12:12:44 2006 +0100 (2006-06-20)
parents 22802e120171 f7bb99cdc391
children 7d6fe353cda4
files
line diff
     1.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/page.h	Tue Jun 20 12:11:28 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/page.h	Tue Jun 20 12:12:44 2006 +0100
     1.3 @@ -89,19 +89,23 @@ static inline unsigned long mfn_to_pfn(u
     1.4  	if (xen_feature(XENFEAT_auto_translated_physmap))
     1.5  		return mfn;
     1.6  
     1.7 -	/*
     1.8 -	 * The array access can fail (e.g., device space beyond end of RAM).
     1.9 -	 * In such cases it doesn't matter what we return (we return garbage),
    1.10 -	 * but we must handle the fault without crashing!
    1.11 -	 */
    1.12 +	if (mfn >= MACH2PHYS_NR_ENTRIES)
    1.13 +		return max_mapnr;
    1.14 +
    1.15 +	/* The array access can fail (e.g., device space beyond end of RAM). */
    1.16  	asm (
    1.17  		"1:	movl %1,%0\n"
    1.18  		"2:\n"
    1.19 +		".section .fixup,\"ax\"\n"
    1.20 +		"3:	movl %2,%0\n"
    1.21 +		"	jmp  2b\n"
    1.22 +		".previous\n"
    1.23  		".section __ex_table,\"a\"\n"
    1.24  		"	.align 4\n"
    1.25 -		"	.long 1b,2b\n"
    1.26 +		"	.long 1b,3b\n"
    1.27  		".previous"
    1.28 -		: "=r" (pfn) : "m" (machine_to_phys_mapping[mfn]) );
    1.29 +		: "=r" (pfn)
    1.30 +		: "m" (machine_to_phys_mapping[mfn]), "i" (max_mapnr) );
    1.31  
    1.32  	return pfn;
    1.33  }
     2.1 --- a/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/page.h	Tue Jun 20 12:11:28 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/page.h	Tue Jun 20 12:12:44 2006 +0100
     2.3 @@ -107,19 +107,23 @@ static inline unsigned long mfn_to_pfn(u
     2.4  	if (xen_feature(XENFEAT_auto_translated_physmap))
     2.5  		return mfn;
     2.6  
     2.7 -	/*
     2.8 -	 * The array access can fail (e.g., device space beyond end of RAM).
     2.9 -	 * In such cases it doesn't matter what we return (we return garbage),
    2.10 -	 * but we must handle the fault without crashing!
    2.11 -	 */
    2.12 +	if (mfn >= MACH2PHYS_NR_ENTRIES)
    2.13 +		return end_pfn;
    2.14 +
    2.15 +	/* The array access can fail (e.g., device space beyond end of RAM). */
    2.16  	asm (
    2.17  		"1:	movq %1,%0\n"
    2.18  		"2:\n"
    2.19 +		".section .fixup,\"ax\"\n"
    2.20 +		"3:	movq %2,%0\n"
    2.21 +		"	jmp  2b\n"
    2.22 +		".previous\n"
    2.23  		".section __ex_table,\"a\"\n"
    2.24  		"	.align 8\n"
    2.25 -		"	.quad 1b,2b\n"
    2.26 +		"	.quad 1b,3b\n"
    2.27  		".previous"
    2.28 -		: "=r" (pfn) : "m" (machine_to_phys_mapping[mfn]) );
    2.29 +		: "=r" (pfn)
    2.30 +		: "m" (machine_to_phys_mapping[mfn]), "ir" (end_pfn) );
    2.31  
    2.32  	return pfn;
    2.33  }
     3.1 --- a/xen/arch/x86/setup.c	Tue Jun 20 12:11:28 2006 +0100
     3.2 +++ b/xen/arch/x86/setup.c	Tue Jun 20 12:12:44 2006 +0100
     3.3 @@ -396,11 +396,13 @@ void __init __start_xen(multiboot_info_t
     3.4      BUILD_BUG_ON(sizeof(shared_info_t) > PAGE_SIZE);
     3.5      BUILD_BUG_ON(sizeof(vcpu_info_t) != 64);
     3.6  
     3.7 -    /* __foo are defined in public headers. Check they match internal defs. */
     3.8 +    /* Check definitions in public headers match internal defs. */
     3.9      BUILD_BUG_ON(__HYPERVISOR_VIRT_START != HYPERVISOR_VIRT_START);
    3.10  #ifdef HYPERVISOR_VIRT_END
    3.11      BUILD_BUG_ON(__HYPERVISOR_VIRT_END   != HYPERVISOR_VIRT_END);
    3.12  #endif
    3.13 +    BUILD_BUG_ON(MACH2PHYS_VIRT_START != RO_MPT_VIRT_START);
    3.14 +    BUILD_BUG_ON(MACH2PHYS_VIRT_END   != RO_MPT_VIRT_END);
    3.15  
    3.16      init_frametable();
    3.17  
     4.1 --- a/xen/include/public/arch-x86_32.h	Tue Jun 20 12:11:28 2006 +0100
     4.2 +++ b/xen/include/public/arch-x86_32.h	Tue Jun 20 12:12:44 2006 +0100
     4.3 @@ -74,16 +74,23 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
     4.4   */
     4.5  #ifdef CONFIG_X86_PAE
     4.6  #define __HYPERVISOR_VIRT_START 0xF5800000
     4.7 +#define __MACH2PHYS_VIRT_START  0xF5800000
     4.8 +#define __MACH2PHYS_VIRT_END    0xF6800000
     4.9  #else
    4.10  #define __HYPERVISOR_VIRT_START 0xFC000000
    4.11 +#define __MACH2PHYS_VIRT_START  0xFC000000
    4.12 +#define __MACH2PHYS_VIRT_END    0xFC400000
    4.13  #endif
    4.14  
    4.15  #ifndef HYPERVISOR_VIRT_START
    4.16  #define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START)
    4.17  #endif
    4.18  
    4.19 +#define MACH2PHYS_VIRT_START  mk_unsigned_long(__MACH2PHYS_VIRT_START)
    4.20 +#define MACH2PHYS_VIRT_END    mk_unsigned_long(__MACH2PHYS_VIRT_END)
    4.21 +#define MACH2PHYS_NR_ENTRIES  ((MACH2PHYS_VIRT_END-MACH2PHYS_VIRT_START)>>2)
    4.22  #ifndef machine_to_phys_mapping
    4.23 -#define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START)
    4.24 +#define machine_to_phys_mapping ((unsigned long *)MACH2PHYS_VIRT_START)
    4.25  #endif
    4.26  
    4.27  /* Maximum number of virtual CPUs in multi-processor guests. */
     5.1 --- a/xen/include/public/arch-x86_64.h	Tue Jun 20 12:11:28 2006 +0100
     5.2 +++ b/xen/include/public/arch-x86_64.h	Tue Jun 20 12:12:44 2006 +0100
     5.3 @@ -85,22 +85,26 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
     5.4  
     5.5  #define __HYPERVISOR_VIRT_START 0xFFFF800000000000
     5.6  #define __HYPERVISOR_VIRT_END   0xFFFF880000000000
     5.7 +#define __MACH2PHYS_VIRT_START  0xFFFF800000000000
     5.8 +#define __MACH2PHYS_VIRT_END    0xFFFF804000000000
     5.9  
    5.10  #ifndef HYPERVISOR_VIRT_START
    5.11  #define HYPERVISOR_VIRT_START mk_unsigned_long(__HYPERVISOR_VIRT_START)
    5.12  #define HYPERVISOR_VIRT_END   mk_unsigned_long(__HYPERVISOR_VIRT_END)
    5.13  #endif
    5.14  
    5.15 +#define MACH2PHYS_VIRT_START  mk_unsigned_long(__MACH2PHYS_VIRT_START)
    5.16 +#define MACH2PHYS_VIRT_END    mk_unsigned_long(__MACH2PHYS_VIRT_END)
    5.17 +#define MACH2PHYS_NR_ENTRIES  ((MACH2PHYS_VIRT_END-MACH2PHYS_VIRT_START)>>3)
    5.18 +#ifndef machine_to_phys_mapping
    5.19 +#define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START)
    5.20 +#endif
    5.21 +
    5.22  /* Maximum number of virtual CPUs in multi-processor guests. */
    5.23  #define MAX_VIRT_CPUS 32
    5.24  
    5.25  #ifndef __ASSEMBLY__
    5.26  
    5.27 -/* The machine->physical mapping table starts at this address, read-only. */
    5.28 -#ifndef machine_to_phys_mapping
    5.29 -#define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START)
    5.30 -#endif
    5.31 -
    5.32  /*
    5.33   * int HYPERVISOR_set_segment_base(unsigned int which, unsigned long base)
    5.34   *  @which == SEGBASE_*  ;  @base == 64-bit base address