direct-io.hg

changeset 4817:14ee7bbe9cfe

bitkeeper revision 1.1389.5.45 (428092ac-yDbfUH2hZkDdl0sU-Sv8Q)

Various cleanups.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue May 10 10:53:32 2005 +0000 (2005-05-10)
parents f44eec6db437
children bf186cdb8693
files xen/arch/x86/io_apic.c xen/arch/x86/mtrr/main.c xen/arch/x86/traps.c xen/arch/x86/x86_32/asm-offsets.c xen/arch/x86/x86_32/mm.c xen/arch/x86/x86_64/mm.c xen/include/asm-x86/fixmap.h
line diff
     1.1 --- a/xen/arch/x86/io_apic.c	Tue May 10 10:53:03 2005 +0000
     1.2 +++ b/xen/arch/x86/io_apic.c	Tue May 10 10:53:32 2005 +0000
     1.3 @@ -1233,7 +1233,6 @@ static inline void UNEXPECTED_IO_APIC(vo
     1.4  
     1.5  void __init print_IO_APIC(void)
     1.6  {
     1.7 -#ifndef NDEBUG
     1.8  	int apic, i;
     1.9  	union IO_APIC_reg_00 reg_00;
    1.10  	union IO_APIC_reg_01 reg_01;
    1.11 @@ -1377,7 +1376,7 @@ void __init print_IO_APIC(void)
    1.12  	}
    1.13  
    1.14  	printk(KERN_INFO ".................................... done.\n");
    1.15 -#endif /* !NDEBUG */
    1.16 +
    1.17  	return;
    1.18  }
    1.19  
    1.20 @@ -1830,26 +1829,6 @@ static struct hw_interrupt_type lapic_ir
    1.21  	.end 		= end_lapic_irq
    1.22  };
    1.23  
    1.24 -#if 0
    1.25 -static void setup_nmi (void)
    1.26 -{
    1.27 -	/*
    1.28 - 	 * Dirty trick to enable the NMI watchdog ...
    1.29 -	 * We put the 8259A master into AEOI mode and
    1.30 -	 * unmask on all local APICs LVT0 as NMI.
    1.31 -	 *
    1.32 -	 * The idea to use the 8259A in AEOI mode ('8259A Virtual Wire')
    1.33 -	 * is from Maciej W. Rozycki - so we do not have to EOI from
    1.34 -	 * the NMI handler or the timer interrupt.
    1.35 -	 */ 
    1.36 -	apic_printk(APIC_VERBOSE, KERN_INFO "activating NMI Watchdog ...");
    1.37 -
    1.38 -	on_each_cpu(enable_NMI_through_LVT0, NULL, 1, 1);
    1.39 -
    1.40 -	apic_printk(APIC_VERBOSE, " done.\n");
    1.41 -}
    1.42 -#endif
    1.43 -
    1.44  /*
    1.45   * This looks a bit hackish but it's about the only one way of sending
    1.46   * a few INTA cycles to 8259As and any associated glue logic.  ICR does
    1.47 @@ -1953,14 +1932,6 @@ static inline void check_timer(void)
    1.48  		 */
    1.49  		unmask_IO_APIC_irq(0);
    1.50  		if (timer_irq_works()) {
    1.51 -#if 0
    1.52 -			if (nmi_watchdog == NMI_IO_APIC) {
    1.53 -				disable_8259A_irq(0);
    1.54 -				setup_nmi();
    1.55 -				enable_8259A_irq(0);
    1.56 -				check_nmi_watchdog();
    1.57 -			}
    1.58 -#endif
    1.59  			return;
    1.60  		}
    1.61  		clear_IO_APIC_pin(0, pin1);
    1.62 @@ -1980,12 +1951,6 @@ static inline void check_timer(void)
    1.63  				replace_pin_at_irq(0, 0, pin1, 0, pin2);
    1.64  			else
    1.65  				add_pin_to_irq(0, 0, pin2);
    1.66 -#if 0
    1.67 -			if (nmi_watchdog == NMI_IO_APIC) {
    1.68 -				setup_nmi();
    1.69 -				check_nmi_watchdog();
    1.70 -			}
    1.71 -#endif
    1.72  			return;
    1.73  		}
    1.74  		/*
     2.1 --- a/xen/arch/x86/mtrr/main.c	Tue May 10 10:53:03 2005 +0000
     2.2 +++ b/xen/arch/x86/mtrr/main.c	Tue May 10 10:53:32 2005 +0000
     2.3 @@ -34,6 +34,7 @@
     2.4  #include <xen/config.h>
     2.5  #include <xen/init.h>
     2.6  #include <xen/pci.h>
     2.7 +#include <xen/slab.h>
     2.8  #include <xen/smp.h>
     2.9  #include <xen/spinlock.h>
    2.10  #include <asm/mtrr.h>
     3.1 --- a/xen/arch/x86/traps.c	Tue May 10 10:53:03 2005 +0000
     3.2 +++ b/xen/arch/x86/traps.c	Tue May 10 10:53:32 2005 +0000
     3.3 @@ -115,7 +115,8 @@ asmlinkage void fatal_trap(int trapnr, s
     3.4      if ( trapnr == TRAP_page_fault )
     3.5      {
     3.6          __asm__ __volatile__ ("mov %%cr2,%0" : "=r" (cr2) : );
     3.7 -        printk("Faulting linear address might be %p\n", _p(cr2));
     3.8 +        printk("Faulting linear address: %p\n", _p(cr2));
     3.9 +        show_page_walk(cr2);
    3.10      }
    3.11  
    3.12      printk("************************************\n");
    3.13 @@ -349,7 +350,7 @@ asmlinkage int do_page_fault(struct cpu_
    3.14      show_page_walk(addr);
    3.15      panic("CPU%d FATAL PAGE FAULT\n"
    3.16            "[error_code=%04x]\n"
    3.17 -          "Faulting linear address might be %p\n",
    3.18 +          "Faulting linear address: %p\n",
    3.19            smp_processor_id(), regs->error_code, addr);
    3.20      return 0;
    3.21  }
     4.1 --- a/xen/arch/x86/x86_32/asm-offsets.c	Tue May 10 10:53:03 2005 +0000
     4.2 +++ b/xen/arch/x86/x86_32/asm-offsets.c	Tue May 10 10:53:32 2005 +0000
     4.3 @@ -90,7 +90,7 @@ void __dummy__(void)
     4.4      OFFSET(MULTICALL_result, multicall_entry_t, args[5]);
     4.5      BLANK();
     4.6  
     4.7 -    DEFINE(FIXMAP_apic_base, __fix_to_virt(FIX_APIC_BASE));
     4.8 +    DEFINE(FIXMAP_apic_base, fix_to_virt(FIX_APIC_BASE));
     4.9      BLANK();
    4.10  
    4.11      DEFINE(IRQSTAT_shift, LOG_2(sizeof(irq_cpustat_t)));
     5.1 --- a/xen/arch/x86/x86_32/mm.c	Tue May 10 10:53:03 2005 +0000
     5.2 +++ b/xen/arch/x86/x86_32/mm.c	Tue May 10 10:53:32 2005 +0000
     5.3 @@ -83,7 +83,7 @@ void __set_fixmap(
     5.4  {
     5.5      if ( unlikely(idx >= __end_of_fixed_addresses) )
     5.6          BUG();
     5.7 -    map_pages(idle_pg_table, __fix_to_virt(idx), p, PAGE_SIZE, flags);
     5.8 +    map_pages(idle_pg_table, fix_to_virt(idx), p, PAGE_SIZE, flags);
     5.9  }
    5.10  
    5.11  
     6.1 --- a/xen/arch/x86/x86_64/mm.c	Tue May 10 10:53:03 2005 +0000
     6.2 +++ b/xen/arch/x86/x86_64/mm.c	Tue May 10 10:53:32 2005 +0000
     6.3 @@ -125,7 +125,7 @@ void __set_fixmap(
     6.4  {
     6.5      if ( unlikely(idx >= __end_of_fixed_addresses) )
     6.6          BUG();
     6.7 -    map_pages(idle_pg_table, __fix_to_virt(idx), p, PAGE_SIZE, flags);
     6.8 +    map_pages(idle_pg_table, fix_to_virt(idx), p, PAGE_SIZE, flags);
     6.9  }
    6.10  
    6.11  
     7.1 --- a/xen/include/asm-x86/fixmap.h	Tue May 10 10:53:03 2005 +0000
     7.2 +++ b/xen/include/asm-x86/fixmap.h	Tue May 10 10:53:32 2005 +0000
     7.3 @@ -56,28 +56,7 @@ extern void __set_fixmap(
     7.4  #define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
     7.5  #define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
     7.6  
     7.7 -extern void __this_fixmap_does_not_exist(void);
     7.8 -
     7.9 -/*
    7.10 - * 'index to address' translation. If anyone tries to use the idx
    7.11 - * directly without translation, we catch the bug with a NULL-deference
    7.12 - * kernel oops. Illegal ranges of incoming indices are caught too.
    7.13 - */
    7.14 -static always_inline unsigned long fix_to_virt(const unsigned int idx)
    7.15 -{
    7.16 -    /*
    7.17 -     * This branch gets completely eliminated after inlining, except when 
    7.18 -     * someone tries to use fixaddr indices in an illegal way (such as mixing 
    7.19 -     * up address types or using out-of-range indices).
    7.20 -     *
    7.21 -     * If it doesn't get removed, the linker will complain loudly with a 
    7.22 -     * reasonably clear error message.
    7.23 -     */
    7.24 -    if (idx >= __end_of_fixed_addresses)
    7.25 -        __this_fixmap_does_not_exist();
    7.26 -
    7.27 -    return __fix_to_virt(idx);
    7.28 -}
    7.29 +#define fix_to_virt(x)   (__fix_to_virt(x))
    7.30  
    7.31  static inline unsigned long virt_to_fix(const unsigned long vaddr)
    7.32  {