direct-io.hg

changeset 1444:e66d4ccb01af

bitkeeper revision 1.944 (40c70595GOCGjmHQFvphhaOjXAmbvw)

Xen build-configuration cleanups.
author kaf24@scramble.cl.cam.ac.uk
date Wed Jun 09 12:41:57 2004 +0000 (2004-06-09)
parents 180c1407b64f
children 1d1e0a1795b8
files xen/Makefile xen/Rules.mk xen/arch/i386/Makefile xen/arch/i386/entry.S xen/arch/i386/io_apic.c xen/arch/i386/irq.c xen/arch/i386/setup.c xen/arch/i386/smp.c xen/arch/i386/traps.c xen/common/Makefile xen/common/dom0_ops.c xen/common/domain.c xen/common/keyhandler.c xen/common/schedule.c xen/common/trace.c xen/drivers/Makefile xen/drivers/pci/pci.c xen/include/asm-i386/config.h xen/include/asm-i386/processor.h xen/include/asm-x86_64/config.h xen/include/xen/blkdev.h xen/include/xen/perfc.h xen/include/xen/vif.h
line diff
     1.1 --- a/xen/Makefile	Wed Jun 09 07:49:35 2004 +0000
     1.2 +++ b/xen/Makefile	Wed Jun 09 12:41:57 2004 +0000
     1.3 @@ -37,7 +37,7 @@ clean: delete-links
     1.4  $(TARGET): delete-unfresh-files make-links $(GENERATED_FILES)
     1.5  	$(MAKE) -C tools
     1.6  	$(MAKE) -C common
     1.7 -	if [ "$(nodev)" != "y" ]; then \
     1.8 +	if [ "$(old_drivers)" == "y" ]; then \
     1.9  	$(MAKE) -C net ; \
    1.10  	fi
    1.11  	$(MAKE) -C drivers
     2.1 --- a/xen/Rules.mk	Wed Jun 09 07:49:35 2004 +0000
     2.2 +++ b/xen/Rules.mk	Wed Jun 09 12:41:57 2004 +0000
     2.3 @@ -1,10 +1,13 @@
     2.4 +
     2.5 +debug       ?= n
     2.6 +debugger    ?= n
     2.7 +old_drivers ?= n
     2.8 +perfc       ?= n
     2.9 +trace       ?= n
    2.10 +
    2.11  COMPILE_ARCH := $(shell uname -m | sed -e s/i.86/i386/)
    2.12  TARGET_ARCH  ?= $(COMPILE_ARCH)
    2.13  
    2.14 -nodev ?= n
    2.15 -debug ?= n
    2.16 -trace ?= n
    2.17 -
    2.18  TARGET  := $(BASEDIR)/xen
    2.19  HDRS    := $(wildcard $(BASEDIR)/include/xen/*.h)
    2.20  HDRS    += $(wildcard $(BASEDIR)/include/scsi/*.h)
    2.21 @@ -23,7 +26,7 @@ ALL_OBJS := $(BASEDIR)/common/common.o
    2.22  ALL_OBJS += $(BASEDIR)/drivers/char/driver.o
    2.23  ALL_OBJS += $(BASEDIR)/drivers/acpi/driver.o
    2.24  ALL_OBJS += $(BASEDIR)/drivers/pci/driver.o
    2.25 -ifneq ($(nodev),y)
    2.26 +ifeq ($(old_drivers),y)
    2.27  ALL_OBJS += $(BASEDIR)/net/network.o
    2.28  ALL_OBJS += $(BASEDIR)/drivers/net/driver.o
    2.29  ALL_OBJS += $(BASEDIR)/drivers/block/driver.o
    2.30 @@ -43,12 +46,16 @@ ifneq ($(debug),y)
    2.31  CFLAGS += -DNDEBUG
    2.32  endif
    2.33  
    2.34 -ifeq ($(nperfc),y)
    2.35 -CFLAGS += -DNPERFC
    2.36 +ifeq ($(debugger),y)
    2.37 +CFLAGS += -DXEN_DEBUGGER
    2.38  endif
    2.39  
    2.40 -ifeq ($(nodev),y)
    2.41 -CFLAGS += -DNO_DEVICES_IN_XEN
    2.42 +ifeq ($(old_drivers),y)
    2.43 +CFLAGS += -DOLD_DRIVERS
    2.44 +endif
    2.45 +
    2.46 +ifeq ($(perfc),y)
    2.47 +CFLAGS += -DPERF_COUNTERS
    2.48  endif
    2.49  
    2.50  ifeq ($(trace),y)
     3.1 --- a/xen/arch/i386/Makefile	Wed Jun 09 07:49:35 2004 +0000
     3.2 +++ b/xen/arch/i386/Makefile	Wed Jun 09 12:41:57 2004 +0000
     3.3 @@ -1,6 +1,11 @@
     3.4  
     3.5  include $(BASEDIR)/Rules.mk
     3.6  
     3.7 +ifneq ($(debugger),y)
     3.8 +OBJS := $(subst pdb-linux.o,,$(OBJS))
     3.9 +OBJS := $(subst pdb-stub.o,,$(OBJS))
    3.10 +endif
    3.11 +
    3.12  # What happens here? We link monitor object files together, starting
    3.13  # at MONITOR_BASE (a very high address). But bootloader cannot put
    3.14  # things there, so we initially load at LOAD_BASE. A hacky little
     4.1 --- a/xen/arch/i386/entry.S	Wed Jun 09 07:49:35 2004 +0000
     4.2 +++ b/xen/arch/i386/entry.S	Wed Jun 09 12:41:57 2004 +0000
     4.3 @@ -711,7 +711,7 @@ ENTRY(hypervisor_call_table)
     4.4          .long SYMBOL_NAME(do_set_gdt)
     4.5          .long SYMBOL_NAME(do_stack_switch)
     4.6          .long SYMBOL_NAME(do_set_callbacks)      /*  5 */
     4.7 -#ifndef NO_DEVICES_IN_XEN
     4.8 +#ifdef OLD_DRIVERS
     4.9          .long SYMBOL_NAME(do_net_io_op)
    4.10  #else
    4.11          .long SYMBOL_NAME(do_ni_syscall)
    4.12 @@ -719,7 +719,7 @@ ENTRY(hypervisor_call_table)
    4.13          .long SYMBOL_NAME(do_fpu_taskswitch)
    4.14          .long SYMBOL_NAME(do_sched_op)
    4.15          .long SYMBOL_NAME(do_dom0_op)
    4.16 -#ifndef NO_DEVICES_IN_XEN
    4.17 +#ifdef OLD_DRIVERS
    4.18          .long SYMBOL_NAME(do_network_op)         /* 10 */
    4.19          .long SYMBOL_NAME(do_block_io_op)
    4.20  #else
     5.1 --- a/xen/arch/i386/io_apic.c	Wed Jun 09 07:49:35 2004 +0000
     5.2 +++ b/xen/arch/i386/io_apic.c	Wed Jun 09 12:41:57 2004 +0000
     5.3 @@ -212,7 +212,7 @@ static void set_ioapic_affinity (unsigne
     5.4   * In new I/O model, the interrupt is pinned to the CPU of the first
     5.5   * device-driver domain that attaches. Dynamic balancing is pointless.
     5.6   */
     5.7 -#if defined(CONFIG_SMP) && !defined(NO_DEVICES_IN_XEN)
     5.8 +#if defined(CONFIG_SMP) && defined(OLD_DRIVERS)
     5.9  
    5.10  typedef struct {
    5.11  	unsigned int cpu;
     6.1 --- a/xen/arch/i386/irq.c	Wed Jun 09 07:49:35 2004 +0000
     6.2 +++ b/xen/arch/i386/irq.c	Wed Jun 09 12:41:57 2004 +0000
     6.3 @@ -481,7 +481,7 @@ asmlinkage unsigned int do_IRQ(struct pt
     6.4      struct irqaction * action;
     6.5      unsigned int status;
     6.6  
     6.7 -#ifndef NPERFC
     6.8 +#ifdef PERF_COUNTERS
     6.9      int cpu = smp_processor_id();
    6.10      u32 cc_start, cc_end;
    6.11  
    6.12 @@ -553,7 +553,7 @@ asmlinkage unsigned int do_IRQ(struct pt
    6.13      desc->handler->end(irq);
    6.14      spin_unlock(&desc->lock);
    6.15  
    6.16 -#ifndef NPERFC
    6.17 +#ifdef PERF_COUNTERS
    6.18      rdtscl(cc_end);
    6.19  
    6.20      if ( !action || (!(action->flags & SA_NOPROFILE)) )
    6.21 @@ -564,7 +564,7 @@ asmlinkage unsigned int do_IRQ(struct pt
    6.22              printk("Long interrupt %08x -> %08x\n", cc_start, cc_end);
    6.23  #endif
    6.24      }
    6.25 -#endif /* NPERFC */
    6.26 +#endif
    6.27  
    6.28      return 1;
    6.29  }
     7.1 --- a/xen/arch/i386/setup.c	Wed Jun 09 07:49:35 2004 +0000
     7.2 +++ b/xen/arch/i386/setup.c	Wed Jun 09 12:41:57 2004 +0000
     7.3 @@ -328,7 +328,7 @@ void __init start_of_day(void)
     7.4      extern void timer_bh(void);
     7.5      extern void init_timervecs(void);
     7.6      extern void ac_timer_init(void);
     7.7 -#ifndef NO_DEVICES_IN_XEN
     7.8 +#ifdef OLD_DRIVERS
     7.9      extern int  setup_network_devices(void);
    7.10      extern void net_init(void);
    7.11      extern void initialize_block_io(void);
    7.12 @@ -415,7 +415,10 @@ void __init start_of_day(void)
    7.13  
    7.14      serial_init_stage2();
    7.15      initialize_keyboard(); /* setup keyboard (also for debugging)   */
    7.16 +
    7.17 +#ifdef XEN_DEBUGGER
    7.18      initialize_pdb();      /* pervasive debugger */
    7.19 +#endif
    7.20  
    7.21      if ( !cpu_has_apic )
    7.22      {
    7.23 @@ -434,7 +437,7 @@ void __init start_of_day(void)
    7.24      pci_init();
    7.25  #endif
    7.26      do_initcalls();
    7.27 -#ifndef NO_DEVICES_IN_XEN
    7.28 +#ifdef OLD_DRIVERS
    7.29      if ( !setup_network_devices() )
    7.30          panic("Must have a network device!\n");
    7.31      net_init();            /* initializes virtual network system. */
     8.1 --- a/xen/arch/i386/smp.c	Wed Jun 09 07:49:35 2004 +0000
     8.2 +++ b/xen/arch/i386/smp.c	Wed Jun 09 12:41:57 2004 +0000
     8.3 @@ -222,7 +222,7 @@ asmlinkage void smp_invalidate_interrupt
     8.4          local_flush_tlb();
     8.5  }
     8.6  
     8.7 -#ifndef NO_DEVICES_IN_XEN
     8.8 +#ifdef OLD_DRIVERS
     8.9  int try_flush_tlb_mask(unsigned long mask)
    8.10  {
    8.11      if ( mask & (1 << smp_processor_id()) )
     9.1 --- a/xen/arch/i386/traps.c	Wed Jun 09 07:49:35 2004 +0000
     9.2 +++ b/xen/arch/i386/traps.c	Wed Jun 09 12:41:57 2004 +0000
     9.3 @@ -24,7 +24,7 @@
     9.4   *  Copyright (C) 1991, 1992  Linus Torvalds
     9.5   *
     9.6   *  Pentium III FXSR, SSE support
     9.7 - *	Gareth Hughes <gareth@valinux.com>, May 2000
     9.8 + * Gareth Hughes <gareth@valinux.com>, May 2000
     9.9   */
    9.10  
    9.11  #include <xen/config.h>
    9.12 @@ -167,7 +167,7 @@ void show_registers(struct pt_regs *regs
    9.13             regs->xfs & 0xffff, regs->xgs & 0xffff, ss);
    9.14  
    9.15      show_stack(&regs->esp);
    9.16 -}	
    9.17 +} 
    9.18  
    9.19  
    9.20  spinlock_t die_lock = SPIN_LOCK_UNLOCKED;
    9.21 @@ -184,7 +184,7 @@ void die(const char * str, struct pt_reg
    9.22  
    9.23  
    9.24  static inline void do_trap(int trapnr, char *str,
    9.25 -			   struct pt_regs *regs, 
    9.26 +                           struct pt_regs *regs, 
    9.27                             long error_code, int use_error_code)
    9.28  {
    9.29      struct task_struct *p = current;
    9.30 @@ -233,27 +233,30 @@ do_trap(trapnr, str, regs, error_code, 1
    9.31  }
    9.32  
    9.33  DO_ERROR_NOCODE( 0, "divide error", divide_error)
    9.34 -DO_ERROR_NOCODE( 4, "overflow", overflow)
    9.35 -DO_ERROR_NOCODE( 5, "bounds", bounds)
    9.36 -DO_ERROR_NOCODE( 6, "invalid operand", invalid_op)
    9.37 -DO_ERROR_NOCODE( 9, "coprocessor segment overrun", coprocessor_segment_overrun)
    9.38 -DO_ERROR(10, "invalid TSS", invalid_TSS)
    9.39 -DO_ERROR(11, "segment not present", segment_not_present)
    9.40 -DO_ERROR(12, "stack segment", stack_segment)
    9.41 +    DO_ERROR_NOCODE( 4, "overflow", overflow)
    9.42 +    DO_ERROR_NOCODE( 5, "bounds", bounds)
    9.43 +    DO_ERROR_NOCODE( 6, "invalid operand", invalid_op)
    9.44 +    DO_ERROR_NOCODE( 9, "coprocessor segment overrun", coprocessor_segment_overrun)
    9.45 +    DO_ERROR(10, "invalid TSS", invalid_TSS)
    9.46 +    DO_ERROR(11, "segment not present", segment_not_present)
    9.47 +    DO_ERROR(12, "stack segment", stack_segment)
    9.48  /* Vector 15 reserved by Intel */
    9.49 -DO_ERROR_NOCODE(16, "fpu error", coprocessor_error)
    9.50 -DO_ERROR(17, "alignment check", alignment_check)
    9.51 -DO_ERROR_NOCODE(18, "machine check", machine_check)
    9.52 -DO_ERROR_NOCODE(19, "simd error", simd_coprocessor_error)
    9.53 +    DO_ERROR_NOCODE(16, "fpu error", coprocessor_error)
    9.54 +    DO_ERROR(17, "alignment check", alignment_check)
    9.55 +    DO_ERROR_NOCODE(18, "machine check", machine_check)
    9.56 +    DO_ERROR_NOCODE(19, "simd error", simd_coprocessor_error)
    9.57  
    9.58 -asmlinkage void do_int3(struct pt_regs *regs, long error_code)
    9.59 +    asmlinkage void do_int3(struct pt_regs *regs, long error_code)
    9.60  {
    9.61      struct task_struct *p = current;
    9.62      struct guest_trap_bounce *gtb = guest_trap_bounce+smp_processor_id();
    9.63      trap_info_t *ti;
    9.64  
    9.65 +#ifdef XEN_DEBUGGER
    9.66      if ( pdb_initialized && pdb_handle_exception(3, regs) == 0 )
    9.67          return;
    9.68 +#endif
    9.69 +
    9.70      if ( (regs->xcs & 3) != 3 )
    9.71      {
    9.72          if ( unlikely((regs->xcs & 3) == 0) )
    9.73 @@ -333,7 +336,7 @@ asmlinkage void do_page_fault(struct pt_
    9.74  
    9.75      if ( unlikely(p->mm.shadow_mode) && 
    9.76           (addr < PAGE_OFFSET) && shadow_fault(addr, error_code) )
    9.77 -	return; /* Returns TRUE if fault was handled. */
    9.78 +        return; /* Returns TRUE if fault was handled. */
    9.79  
    9.80      if ( unlikely(!(regs->xcs & 3)) )
    9.81          goto fault_in_hypervisor;
    9.82 @@ -377,14 +380,16 @@ asmlinkage void do_page_fault(struct pt_
    9.83  #endif
    9.84      }
    9.85  
    9.86 -    if (pdb_page_fault_possible)                 /* implicit pdb_initialized */
    9.87 +#ifdef XEN_DEBUGGER
    9.88 +    if ( pdb_page_fault_possible )
    9.89      {
    9.90          pdb_page_fault = 1;
    9.91 -	/* make eax & edx valid to complete the instruction */
    9.92 -	regs->eax = (long)&pdb_page_fault_scratch;
    9.93 -	regs->edx = (long)&pdb_page_fault_scratch;
    9.94 -	return;
    9.95 +        /* make eax & edx valid to complete the instruction */
    9.96 +        regs->eax = (long)&pdb_page_fault_scratch;
    9.97 +        regs->edx = (long)&pdb_page_fault_scratch;
    9.98 +        return;
    9.99      }
   9.100 +#endif
   9.101  
   9.102      show_registers(regs);
   9.103      panic("CPU%d FATAL PAGE FAULT\n"
   9.104 @@ -430,14 +435,15 @@ asmlinkage void do_general_protection(st
   9.105          ti = current->thread.traps + (error_code>>3);
   9.106          if ( TI_GET_DPL(ti) >= (regs->xcs & 3) )
   9.107          {
   9.108 -	    unsigned long cr3;
   9.109 -	
   9.110 -	    __asm__ __volatile__ ("movl %%cr3,%0" : "=r" (cr3) : );
   9.111 -	    if (pdb_initialized && pdb_ctx.system_call != 0 &&
   9.112 -		cr3 == pdb_ctx.ptbr)
   9.113 -	    {
   9.114 -	        pdb_linux_syscall_enter_bkpt(regs, error_code, ti);
   9.115 -	    }
   9.116 +#ifdef XEN_DEBUGGER
   9.117 +            if ( pdb_initialized && (pdb_ctx.system_call != 0) )
   9.118 +            {
   9.119 +                unsigned long cr3; 
   9.120 +                __asm__ __volatile__ ("movl %%cr3,%0" : "=r" (cr3) : );
   9.121 +                if ( cr3 == pdb_ctx.ptbr )
   9.122 +                    pdb_linux_syscall_enter_bkpt(regs, error_code, ti);
   9.123 +            }
   9.124 +#endif
   9.125  
   9.126              gtb->flags = GTBF_TRAP_NOCODE;
   9.127              regs->eip += 2;
   9.128 @@ -535,13 +541,41 @@ asmlinkage void math_state_restore(struc
   9.129      }
   9.130  }
   9.131  
   9.132 -asmlinkage void do_debug_orig(struct pt_regs *regs, long error_code)
   9.133 +#ifdef XEN_DEBUGGER
   9.134 +asmlinkage void do_pdb_debug(struct pt_regs *regs, long error_code)
   9.135  {
   9.136      unsigned int condition;
   9.137      struct task_struct *tsk = current;
   9.138      struct guest_trap_bounce *gtb = guest_trap_bounce+smp_processor_id();
   9.139  
   9.140      __asm__ __volatile__("movl %%db6,%0" : "=r" (condition));
   9.141 +    if ( (condition & (1 << 14)) != (1 << 14) )
   9.142 +        printk("\nwarning: debug trap w/o BS bit [0x%x]\n\n", condition);
   9.143 +    __asm__("movl %0,%%db6" : : "r" (0));
   9.144 +
   9.145 +    if ( pdb_handle_exception(1, regs) != 0 )
   9.146 +    {
   9.147 +        tsk->thread.debugreg[6] = condition;
   9.148 +
   9.149 +        gtb->flags = GTBF_TRAP_NOCODE;
   9.150 +        gtb->cs    = tsk->thread.traps[1].cs;
   9.151 +        gtb->eip   = tsk->thread.traps[1].address;
   9.152 +    }
   9.153 +}
   9.154 +#endif
   9.155 +
   9.156 +asmlinkage void do_debug(struct pt_regs *regs, long error_code)
   9.157 +{
   9.158 +    unsigned int condition;
   9.159 +    struct task_struct *tsk = current;
   9.160 +    struct guest_trap_bounce *gtb = guest_trap_bounce+smp_processor_id();
   9.161 +
   9.162 +#ifdef XEN_DEBUGGER
   9.163 +    if ( pdb_initialized )
   9.164 +        return do_pdb_debug(regs, error_code);
   9.165 +#endif
   9.166 +
   9.167 +    __asm__ __volatile__("movl %%db6,%0" : "=r" (condition));
   9.168  
   9.169      /* Mask out spurious debug traps due to lazy DR7 setting */
   9.170      if ( (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)) &&
   9.171 @@ -574,37 +608,8 @@ asmlinkage void do_debug_orig(struct pt_
   9.172  }
   9.173  
   9.174  
   9.175 -asmlinkage void do_debug(struct pt_regs *regs, long error_code)
   9.176 -{
   9.177 -    unsigned int condition;
   9.178 -    struct task_struct *tsk = current;
   9.179 -    struct guest_trap_bounce *gtb = guest_trap_bounce+smp_processor_id();
   9.180 -
   9.181 -    /* This handler is broken! Only use it if PDB is enabled. */
   9.182 -    if ( !pdb_initialized )
   9.183 -    {
   9.184 -        do_debug_orig(regs, error_code);
   9.185 -        return;
   9.186 -    }
   9.187 -
   9.188 -    __asm__ __volatile__("movl %%db6,%0" : "=r" (condition));
   9.189 -    if ( (condition & (1 << 14)) != (1 << 14) )
   9.190 -        printk("\nwarning: debug trap w/o BS bit [0x%x]\n\n", condition);
   9.191 -    __asm__("movl %0,%%db6" : : "r" (0));
   9.192 -
   9.193 -    if ( pdb_handle_exception(1, regs) != 0 )
   9.194 -    {
   9.195 -        tsk->thread.debugreg[6] = condition;
   9.196 -
   9.197 -	gtb->flags = GTBF_TRAP_NOCODE;
   9.198 -	gtb->cs    = tsk->thread.traps[1].cs;
   9.199 -	gtb->eip   = tsk->thread.traps[1].address;
   9.200 -    }
   9.201 -}
   9.202 -
   9.203 -
   9.204  asmlinkage void do_spurious_interrupt_bug(struct pt_regs * regs,
   9.205 -					  long error_code)
   9.206 +                                          long error_code)
   9.207  { /* nothing */ }
   9.208  
   9.209  
   9.210 @@ -612,13 +617,13 @@ asmlinkage void do_spurious_interrupt_bu
   9.211  do { \
   9.212    int __d0, __d1; \
   9.213    __asm__ __volatile__ ("movw %%dx,%%ax\n\t" \
   9.214 -	"movw %4,%%dx\n\t" \
   9.215 -	"movl %%eax,%0\n\t" \
   9.216 -	"movl %%edx,%1" \
   9.217 -	:"=m" (*((long *) (gate_addr))), \
   9.218 -	 "=m" (*(1+(long *) (gate_addr))), "=&a" (__d0), "=&d" (__d1) \
   9.219 -	:"i" ((short) (0x8000+(dpl<<13)+(type<<8))), \
   9.220 -	 "3" ((char *) (addr)),"2" (__HYPERVISOR_CS << 16)); \
   9.221 + "movw %4,%%dx\n\t" \
   9.222 + "movl %%eax,%0\n\t" \
   9.223 + "movl %%edx,%1" \
   9.224 + :"=m" (*((long *) (gate_addr))), \
   9.225 +  "=m" (*(1+(long *) (gate_addr))), "=&a" (__d0), "=&d" (__d1) \
   9.226 + :"i" ((short) (0x8000+(dpl<<13)+(type<<8))), \
   9.227 +  "3" ((char *) (addr)),"2" (__HYPERVISOR_CS << 16)); \
   9.228  } while (0)
   9.229  
   9.230  void set_intr_gate(unsigned int n, void *addr)
   9.231 @@ -638,25 +643,25 @@ static void set_task_gate(unsigned int n
   9.232  }
   9.233  
   9.234  #define _set_seg_desc(gate_addr,type,dpl,base,limit) {\
   9.235 -	*((gate_addr)+1) = ((base) & 0xff000000) | \
   9.236 -		(((base) & 0x00ff0000)>>16) | \
   9.237 -		((limit) & 0xf0000) | \
   9.238 -		((dpl)<<13) | \
   9.239 -		(0x00408000) | \
   9.240 -		((type)<<8); \
   9.241 -	*(gate_addr) = (((base) & 0x0000ffff)<<16) | \
   9.242 -		((limit) & 0x0ffff); }
   9.243 + *((gate_addr)+1) = ((base) & 0xff000000) | \
   9.244 +  (((base) & 0x00ff0000)>>16) | \
   9.245 +  ((limit) & 0xf0000) | \
   9.246 +  ((dpl)<<13) | \
   9.247 +  (0x00408000) | \
   9.248 +  ((type)<<8); \
   9.249 + *(gate_addr) = (((base) & 0x0000ffff)<<16) | \
   9.250 +  ((limit) & 0x0ffff); }
   9.251  
   9.252  #define _set_tssldt_desc(n,addr,limit,type) \
   9.253  __asm__ __volatile__ ("movw %w3,0(%2)\n\t" \
   9.254 -	"movw %%ax,2(%2)\n\t" \
   9.255 -	"rorl $16,%%eax\n\t" \
   9.256 -	"movb %%al,4(%2)\n\t" \
   9.257 -	"movb %4,5(%2)\n\t" \
   9.258 -	"movb $0,6(%2)\n\t" \
   9.259 -	"movb %%ah,7(%2)\n\t" \
   9.260 -	"rorl $16,%%eax" \
   9.261 -	: "=m"(*(n)) : "a" (addr), "r"(n), "ir"(limit), "i"(type))
   9.262 + "movw %%ax,2(%2)\n\t" \
   9.263 + "rorl $16,%%eax\n\t" \
   9.264 + "movb %%al,4(%2)\n\t" \
   9.265 + "movb %4,5(%2)\n\t" \
   9.266 + "movb $0,6(%2)\n\t" \
   9.267 + "movb %%ah,7(%2)\n\t" \
   9.268 + "rorl $16,%%eax" \
   9.269 + : "=m"(*(n)) : "a" (addr), "r"(n), "ir"(limit), "i"(type))
   9.270  
   9.271  void set_tss_desc(unsigned int n, void *addr)
   9.272  {
    10.1 --- a/xen/common/Makefile	Wed Jun 09 07:49:35 2004 +0000
    10.2 +++ b/xen/common/Makefile	Wed Jun 09 12:41:57 2004 +0000
    10.3 @@ -1,12 +1,21 @@
    10.4  
    10.5  include $(BASEDIR)/Rules.mk
    10.6  
    10.7 -ifeq ($(nperfc),y)
    10.8 +ifneq ($(debugger),y)
    10.9 +OBJS := $(subst debug.o,,$(OBJS))
   10.10 +OBJS := $(subst debug-linux.o,,$(OBJS))
   10.11 +endif
   10.12 +
   10.13 +ifneq ($(old_drivers),y)
   10.14 +OBJS := $(subst network.o,,$(OBJS))
   10.15 +endif
   10.16 +
   10.17 +ifneq ($(perfc),y)
   10.18  OBJS := $(subst perfc.o,,$(OBJS))
   10.19  endif
   10.20  
   10.21 -ifeq ($(nodev),y)
   10.22 -OBJS := $(subst network.o,,$(OBJS))
   10.23 +ifneq ($(trace),y)
   10.24 +OBJS := $(subst trace.o,,$(OBJS))
   10.25  endif
   10.26  
   10.27  default: $(OBJS)
    11.1 --- a/xen/common/dom0_ops.c	Wed Jun 09 07:49:35 2004 +0000
    11.2 +++ b/xen/common/dom0_ops.c	Wed Jun 09 12:41:57 2004 +0000
    11.3 @@ -473,6 +473,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
    11.4      }
    11.5      break;
    11.6  
    11.7 +#ifdef XEN_DEBUGGER
    11.8      case DOM0_DEBUG:
    11.9      {
   11.10          pdb_do_debug(op);
   11.11 @@ -480,6 +481,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
   11.12          ret = 0;
   11.13      }
   11.14      break;
   11.15 +#endif
   11.16  
   11.17      case DOM0_SETTIME:
   11.18      {
    12.1 --- a/xen/common/domain.c	Wed Jun 09 07:49:35 2004 +0000
    12.2 +++ b/xen/common/domain.c	Wed Jun 09 12:41:57 2004 +0000
    12.3 @@ -299,10 +299,10 @@ struct pfn_info *alloc_domain_page(struc
    12.4      unsigned long flags, mask, pfn_stamp, cpu_stamp;
    12.5      int i;
    12.6  
    12.7 -#ifdef NO_DEVICES_IN_XEN
    12.8 +#ifdef OLD_DRIVERS
    12.9 +    ASSERT((p == NULL) || !in_irq());
   12.10 +#else
   12.11      ASSERT(!in_irq());
   12.12 -#else
   12.13 -    ASSERT((p == NULL) || !in_irq());
   12.14  #endif
   12.15  
   12.16      spin_lock_irqsave(&free_list_lock, flags);
   12.17 @@ -332,14 +332,14 @@ struct pfn_info *alloc_domain_page(struc
   12.18  
   12.19          if ( unlikely(mask != 0) )
   12.20          {
   12.21 -#ifdef NO_DEVICES_IN_XEN
   12.22 -            flush_tlb_mask(mask);
   12.23 -#else
   12.24 +#ifdef OLD_DRIVERS
   12.25              /* In IRQ ctxt, flushing is best-effort only, to avoid deadlock. */
   12.26              if ( likely(!in_irq()) )
   12.27                  flush_tlb_mask(mask);
   12.28              else if ( unlikely(!try_flush_tlb_mask(mask)) )
   12.29                  goto free_and_exit;
   12.30 +#else
   12.31 +            flush_tlb_mask(mask);
   12.32  #endif
   12.33              perfc_incrc(need_flush_tlb_flush);
   12.34          }
   12.35 @@ -815,7 +815,7 @@ int construct_dom0(struct task_struct *p
   12.36  
   12.37      extern void physdev_init_dom0(struct task_struct *);
   12.38  
   12.39 -#ifndef NO_DEVICES_IN_XEN
   12.40 +#ifdef OLD_DRIVERS
   12.41      extern void ide_probe_devices(xen_disk_info_t *);
   12.42      extern void scsi_probe_devices(xen_disk_info_t *);
   12.43      extern void cciss_probe_devices(xen_disk_info_t *);
   12.44 @@ -1078,7 +1078,7 @@ int construct_dom0(struct task_struct *p
   12.45      while ( num_vifs-- > 0 )
   12.46          (void)create_net_vif(0);
   12.47  
   12.48 -#ifndef NO_DEVICES_IN_XEN
   12.49 +#ifdef OLD_DRIVERS
   12.50      /* DOM0 gets access to all real block devices. */
   12.51  #define MAX_REAL_DISKS 256
   12.52      xd = kmalloc(MAX_REAL_DISKS * sizeof(xen_disk_t), GFP_KERNEL);
    13.1 --- a/xen/common/keyhandler.c	Wed Jun 09 07:49:35 2004 +0000
    13.2 +++ b/xen/common/keyhandler.c	Wed Jun 09 12:41:57 2004 +0000
    13.3 @@ -107,7 +107,7 @@ void do_task_queues(u_char key, void *de
    13.4  extern void dump_runq(u_char key, void *dev_id, struct pt_regs *regs);
    13.5  extern void print_sched_histo(u_char key, void *dev_id, struct pt_regs *regs);
    13.6  extern void reset_sched_histo(u_char key, void *dev_id, struct pt_regs *regs);
    13.7 -#ifndef NPERFC
    13.8 +#ifdef PERF_COUNTERS
    13.9  extern void perfc_printall (u_char key, void *dev_id, struct pt_regs *regs);
   13.10  extern void perfc_reset (u_char key, void *dev_id, struct pt_regs *regs);
   13.11  #endif
   13.12 @@ -134,7 +134,7 @@ void initialize_keytable(void)
   13.13      add_key_handler('r', dump_runq,      "dump run queues");
   13.14      add_key_handler('B', kill_dom0,      "reboot machine gracefully"); 
   13.15      add_key_handler('R', halt_machine,   "reboot machine ungracefully"); 
   13.16 -#ifndef NPERFC
   13.17 +#ifdef PERF_COUNTERS
   13.18      add_key_handler('p', perfc_printall, "print performance counters"); 
   13.19      add_key_handler('P', perfc_reset,    "reset performance counters"); 
   13.20  #endif
    14.1 --- a/xen/common/schedule.c	Wed Jun 09 07:49:35 2004 +0000
    14.2 +++ b/xen/common/schedule.c	Wed Jun 09 12:41:57 2004 +0000
    14.3 @@ -27,9 +27,6 @@
    14.4  #include <xen/perfc.h>
    14.5  #include <xen/sched-if.h>
    14.6  #include <hypervisor-ifs/sched_ctl.h>
    14.7 -
    14.8 -#undef  TRACE_BUFFER
    14.9 -
   14.10  #include <xen/trace.h>
   14.11  
   14.12  /*#define WAKEUP_HISTO*/
    15.1 --- a/xen/common/trace.c	Wed Jun 09 07:49:35 2004 +0000
    15.2 +++ b/xen/common/trace.c	Wed Jun 09 12:41:57 2004 +0000
    15.3 @@ -17,9 +17,6 @@
    15.4   */
    15.5  
    15.6  #include <xen/config.h>
    15.7 -
    15.8 -#ifdef TRACE_BUFFER
    15.9 -
   15.10  #include <asm/timex.h>
   15.11  #include <asm/types.h>
   15.12  #include <asm/io.h>
   15.13 @@ -127,5 +124,3 @@ int get_tb_info(dom0_gettbufs_t *st)
   15.14          return -ENODATA;
   15.15      }
   15.16  }
   15.17 -
   15.18 -#endif /* TRACE_BUFFER */
    16.1 --- a/xen/drivers/Makefile	Wed Jun 09 07:49:35 2004 +0000
    16.2 +++ b/xen/drivers/Makefile	Wed Jun 09 12:41:57 2004 +0000
    16.3 @@ -3,7 +3,7 @@ default:
    16.4  	$(MAKE) -C char
    16.5  	$(MAKE) -C acpi
    16.6  	$(MAKE) -C pci
    16.7 -	if [ "$(nodev)" != "y" ]; then \
    16.8 +	if [ "$(old_drivers)" == "y" ]; then \
    16.9  	$(MAKE) -C net ; \
   16.10  	$(MAKE) -C block ; \
   16.11  	$(MAKE) -C cdrom ; \
    17.1 --- a/xen/drivers/pci/pci.c	Wed Jun 09 07:49:35 2004 +0000
    17.2 +++ b/xen/drivers/pci/pci.c	Wed Jun 09 12:41:57 2004 +0000
    17.3 @@ -619,7 +619,7 @@ pci_match_device(const struct pci_device
    17.4  	return NULL;
    17.5  }
    17.6  
    17.7 -#ifndef NO_DEVICES_IN_XEN
    17.8 +#ifdef OLD_DRIVERS
    17.9  static int
   17.10  pci_announce_device(struct pci_driver *drv, struct pci_dev *dev)
   17.11  {
   17.12 @@ -644,7 +644,7 @@ pci_announce_device(struct pci_driver *d
   17.13  out:
   17.14  	return ret;
   17.15  }
   17.16 -#endif /* !NO_DEVICES_IN_XEN */
   17.17 +#endif /* OLD_DRIVERS */
   17.18  
   17.19  /**
   17.20   * pci_register_driver - register a new pci driver
   17.21 @@ -658,7 +658,7 @@ out:
   17.22  int
   17.23  pci_register_driver(struct pci_driver *drv)
   17.24  {
   17.25 -#ifndef NO_DEVICES_IN_XEN
   17.26 +#ifdef OLD_DRIVERS
   17.27  	struct pci_dev *dev;
   17.28  	int count = 0;
   17.29  
   17.30 @@ -686,7 +686,7 @@ pci_register_driver(struct pci_driver *d
   17.31  void
   17.32  pci_unregister_driver(struct pci_driver *drv)
   17.33  {
   17.34 -#ifndef NO_DEVICES_IN_XEN
   17.35 +#ifdef OLD_DRIVERS
   17.36  	struct pci_dev *dev;
   17.37  
   17.38  	list_del(&drv->node);
    18.1 --- a/xen/include/asm-i386/config.h	Wed Jun 09 07:49:35 2004 +0000
    18.2 +++ b/xen/include/asm-i386/config.h	Wed Jun 09 12:41:57 2004 +0000
    18.3 @@ -135,7 +135,6 @@
    18.4  
    18.5  #ifndef NDEBUG
    18.6  #define MEMORY_GUARD
    18.7 -#define TRACE_BUFFER
    18.8  #endif
    18.9  
   18.10  #ifndef __ASSEMBLY__
    19.1 --- a/xen/include/asm-i386/processor.h	Wed Jun 09 07:49:35 2004 +0000
    19.2 +++ b/xen/include/asm-i386/processor.h	Wed Jun 09 12:41:57 2004 +0000
    19.3 @@ -406,10 +406,16 @@ extern struct desc_struct *idt_tables[];
    19.4      (memset(idt_tables[smp_processor_id()] + (_p)->fast_trap_idx, \
    19.5       0, 8))
    19.6  
    19.7 +#ifdef XEN_DEBUGGER
    19.8  #define SET_FAST_TRAP(_p)   \
    19.9      (pdb_initialized ? (void *) 0 : \
   19.10         (memcpy(idt_tables[smp_processor_id()] + (_p)->fast_trap_idx, \
   19.11 -	       &((_p)->fast_trap_desc), 8)))
   19.12 +               &((_p)->fast_trap_desc), 8)))
   19.13 +#else
   19.14 +#define SET_FAST_TRAP(_p)   \
   19.15 +    (memcpy(idt_tables[smp_processor_id()] + (_p)->fast_trap_idx, \
   19.16 +            &((_p)->fast_trap_desc), 8))
   19.17 +#endif
   19.18  
   19.19  long set_fast_trap(struct task_struct *p, int idx);
   19.20  
    20.1 --- a/xen/include/asm-x86_64/config.h	Wed Jun 09 07:49:35 2004 +0000
    20.2 +++ b/xen/include/asm-x86_64/config.h	Wed Jun 09 12:41:57 2004 +0000
    20.3 @@ -281,7 +281,6 @@
    20.4  
    20.5  #ifndef NDEBUG
    20.6  #define MEMORY_GUARD
    20.7 -#define TRACE_BUFFER
    20.8  #endif
    20.9  
   20.10  #ifndef __ASSEMBLY__
    21.1 --- a/xen/include/xen/blkdev.h	Wed Jun 09 07:49:35 2004 +0000
    21.2 +++ b/xen/include/xen/blkdev.h	Wed Jun 09 12:41:57 2004 +0000
    21.3 @@ -26,7 +26,7 @@ typedef struct {
    21.4  
    21.5  extern kdev_t xendev_to_physdev(unsigned short xendev);
    21.6  
    21.7 -#ifndef NO_DEVICES_IN_XEN
    21.8 +#ifdef OLD_DRIVERS
    21.9  extern void init_blkdev_info(struct task_struct *);
   21.10  extern void unlink_blkdev_info(struct task_struct *);
   21.11  extern void destroy_blkdev_info(struct task_struct *);
    22.1 --- a/xen/include/xen/perfc.h	Wed Jun 09 07:49:35 2004 +0000
    22.2 +++ b/xen/include/xen/perfc.h	Wed Jun 09 12:41:57 2004 +0000
    22.3 @@ -2,7 +2,7 @@
    22.4  #ifndef __XEN_PERFC_H__
    22.5  #define __XEN_PERFC_H__
    22.6  
    22.7 -#ifndef NPERFC
    22.8 +#ifdef PERF_COUNTERS
    22.9  
   22.10  #include <asm/atomic.h>
   22.11  
   22.12 @@ -67,7 +67,7 @@ extern struct perfcounter_t perfcounters
   22.13  #define perfc_addc(x,y)   atomic_add((y), &perfcounters.x[smp_processor_id()])
   22.14  #define perfc_adda(x,y,z) atomic_add((z), &perfcounters.x[y])
   22.15  
   22.16 -#else /* !NPERFC */
   22.17 +#else /* PERF_COUNTERS */
   22.18  
   22.19  #define perfc_value(x)    ((void)0)
   22.20  #define perfc_valuec(x)   ((void)0)
   22.21 @@ -83,6 +83,6 @@ extern struct perfcounter_t perfcounters
   22.22  #define perfc_addc(x,y)   ((void)0)
   22.23  #define perfc_adda(x,y,z) ((void)0)
   22.24  
   22.25 -#endif /* !NPERFC */
   22.26 +#endif /* PERF_COUNTERS */
   22.27  
   22.28  #endif /* __XEN_PERFC_H__ */
    23.1 --- a/xen/include/xen/vif.h	Wed Jun 09 07:49:35 2004 +0000
    23.2 +++ b/xen/include/xen/vif.h	Wed Jun 09 12:41:57 2004 +0000
    23.3 @@ -95,7 +95,7 @@ do {                                    
    23.4  } while (0)                                                        \
    23.5  
    23.6  /* vif prototypes */
    23.7 -#ifndef NO_DEVICES_IN_XEN
    23.8 +#ifdef OLD_DRIVERS
    23.9  net_vif_t *create_net_vif(domid_t dom);
   23.10  void destroy_net_vif(net_vif_t *vif);
   23.11  void unlink_net_vif(net_vif_t *vif);