ia64/xen-unstable

changeset 5946:1efe6f4163ee

Merge with latest xen-unstable
author djm@kirby.fc.hp.com
date Mon Aug 01 12:19:36 2005 -0700 (2005-08-01)
parents 24dd9a53dd95 0db6a59abb95
children 6e20607ca839
files .hgignore Makefile buildconfigs/Rules.mk buildconfigs/mk.linux-2.6-xen buildconfigs/mk.linux-2.6-xen0 buildconfigs/mk.linux-2.6-xenU docs/misc/shype4xen_readme.txt docs/src/user.tex linux-2.4-xen-sparse/arch/xen/Makefile linux-2.4-xen-sparse/arch/xen/kernel/time.c linux-2.4-xen-sparse/include/asm-xen/bugs.h linux-2.4-xen-sparse/include/asm-xen/fixmap.h linux-2.4-xen-sparse/include/asm-xen/highmem.h linux-2.4-xen-sparse/include/asm-xen/hw_irq.h linux-2.4-xen-sparse/include/asm-xen/io.h linux-2.4-xen-sparse/include/asm-xen/irq.h linux-2.4-xen-sparse/include/asm-xen/mmu_context.h linux-2.4-xen-sparse/include/asm-xen/page.h linux-2.4-xen-sparse/include/asm-xen/pci.h linux-2.4-xen-sparse/include/asm-xen/pgalloc.h linux-2.4-xen-sparse/include/asm-xen/pgtable.h linux-2.4-xen-sparse/include/asm-xen/processor.h linux-2.4-xen-sparse/include/asm-xen/segment.h linux-2.4-xen-sparse/include/asm-xen/smp.h linux-2.4-xen-sparse/include/asm-xen/system.h linux-2.4-xen-sparse/include/asm-xen/vga.h linux-2.4-xen-sparse/include/linux/blk.h linux-2.4-xen-sparse/include/linux/highmem.h linux-2.4-xen-sparse/include/linux/irq.h linux-2.4-xen-sparse/include/linux/mm.h linux-2.4-xen-sparse/include/linux/sched.h linux-2.4-xen-sparse/include/linux/skbuff.h linux-2.4-xen-sparse/include/linux/timer.h linux-2.4-xen-sparse/mkbuildtree linux-2.6-xen-sparse/arch/xen/Kconfig linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_32 linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32 linux-2.6-xen-sparse/arch/xen/i386/kernel/Makefile linux-2.6-xen-sparse/arch/xen/i386/kernel/entry.S linux-2.6-xen-sparse/arch/xen/i386/kernel/head.S linux-2.6-xen-sparse/arch/xen/i386/kernel/irq.c linux-2.6-xen-sparse/arch/xen/i386/kernel/mpparse.c linux-2.6-xen-sparse/arch/xen/i386/kernel/setup.c linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c linux-2.6-xen-sparse/arch/xen/i386/kernel/traps.c linux-2.6-xen-sparse/arch/xen/i386/mm/hypervisor.c linux-2.6-xen-sparse/arch/xen/i386/pci/irq.c linux-2.6-xen-sparse/arch/xen/kernel/gnttab.c linux-2.6-xen-sparse/arch/xen/kernel/reboot.c linux-2.6-xen-sparse/arch/xen/x86_64/kernel/Makefile linux-2.6-xen-sparse/drivers/xen/Makefile linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c linux-2.6-xen-sparse/drivers/xen/netback/common.h linux-2.6-xen-sparse/drivers/xen/netback/netback.c linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c linux-2.6-xen-sparse/drivers/xen/usbback/usbback.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_comms.h linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c linux-2.6-xen-sparse/include/asm-xen/asm-i386/hypercall.h linux-2.6-xen-sparse/include/asm-xen/asm-x86_64/io.h linux-2.6-xen-sparse/include/asm-xen/ctrl_if.h linux-2.6-xen-sparse/include/asm-xen/evtchn.h linux-2.6-xen-sparse/include/asm-xen/hypervisor.h linux-2.6-xen-sparse/include/asm-xen/xenbus.h linux-2.6-xen-sparse/include/linux/mm.h patches/linux-2.6.12/smp-alts.patch tools/Makefile tools/debugger/gdb/gdbbuild tools/debugger/libxendebug/xendebug.c tools/debugger/pdb/Makefile tools/debugger/pdb/PDB.ml tools/debugger/pdb/Process.ml tools/debugger/pdb/Process.mli tools/debugger/pdb/Util.ml tools/debugger/pdb/Xen_domain.ml tools/debugger/pdb/Xen_domain.mli tools/debugger/pdb/debugger.ml tools/debugger/pdb/linux-2.6-module/Makefile tools/debugger/pdb/linux-2.6-module/debug.c tools/debugger/pdb/linux-2.6-module/module.c tools/debugger/pdb/linux-2.6-module/pdb_debug.h tools/debugger/pdb/linux-2.6-module/pdb_module.h tools/debugger/pdb/linux-2.6-patches/Makefile tools/debugger/pdb/linux-2.6-patches/i386_ksyms.patch tools/debugger/pdb/linux-2.6-patches/kdebug.patch tools/debugger/pdb/linux-2.6-patches/makefile.patch tools/debugger/pdb/linux-2.6-patches/ptrace.patch tools/debugger/pdb/linux-2.6-patches/traps.patch tools/debugger/pdb/pdb_caml_process.c tools/debugger/pdb/pdb_caml_xcs.c tools/debugger/pdb/pdb_caml_xen.h tools/debugger/pdb/readme tools/debugger/pdb/server.ml tools/examples/xend-config.sxp tools/firmware/rombios/rombios.c tools/ioemu/monitor.c tools/ioemu/target-i386-dm/qemu-dm.debug tools/ioemu/vnc.c tools/libxc/Makefile tools/libxc/xc.h tools/libxc/xc_domain.c tools/libxc/xc_linux_build.c tools/libxc/xc_load_elf.c tools/libxc/xc_private.c tools/libxc/xc_private.h tools/libxc/xc_ptrace.c tools/misc/Makefile tools/misc/policyprocessor/XmlToBinInterface.java tools/python/setup.py tools/python/xen/lowlevel/xc/xc.c tools/python/xen/lowlevel/xs/xs.c tools/python/xen/lowlevel/xu/xu.c tools/python/xen/sv/CreateDomain.py tools/python/xen/sv/Daemon.py tools/python/xen/sv/DomInfo.py tools/python/xen/sv/DomList.py tools/python/xen/sv/GenTabbed.py tools/python/xen/sv/HTMLBase.py tools/python/xen/sv/Main.py tools/python/xen/sv/MigrateDomain.py tools/python/xen/sv/NodeInfo.py tools/python/xen/sv/RestoreDomain.py tools/python/xen/sv/SaveDomain.py tools/python/xen/sv/TabView.py tools/python/xen/sv/Wizard.py tools/python/xen/sv/__init__.py tools/python/xen/sv/params.py tools/python/xen/sv/util.py tools/python/xen/xend/XendCheckpoint.py tools/python/xen/xend/XendDomain.py tools/python/xen/xend/XendDomainInfo.py tools/python/xen/xend/XendRoot.py tools/python/xen/xend/image.py tools/python/xen/xend/server/SrvDaemon.py tools/python/xen/xend/server/channel.py tools/python/xen/xend/xenstore/xsnode.py tools/python/xen/xm/create.py tools/python/xen/xm/main.py tools/sv/Makefile tools/sv/images/destroy.png tools/sv/images/finish.png tools/sv/images/internet.jpg tools/sv/images/internet.psd tools/sv/images/next.png tools/sv/images/orb_01.jpg tools/sv/images/orb_02.jpg tools/sv/images/pause.png tools/sv/images/previous.png tools/sv/images/reboot.png tools/sv/images/seperator-left-highlight.jpg tools/sv/images/seperator-right-highlight.jpg tools/sv/images/seperator.jpg tools/sv/images/shutdown.png tools/sv/images/small-destroy.png tools/sv/images/small-pause.png tools/sv/images/small-unpause.png tools/sv/images/unpause.png tools/sv/images/xen.png tools/sv/inc/script.js tools/sv/inc/style.css tools/sv/index.psp tools/xcs/xcs.h tools/xenstore/Makefile tools/xenstore/TODO tools/xenstore/testsuite/02directory.sh tools/xenstore/testsuite/07watch.sh tools/xenstore/testsuite/08transaction.sh tools/xenstore/testsuite/09domain.sh tools/xenstore/testsuite/10domain-homedir.sh tools/xenstore/testsuite/11domain-watch.sh tools/xenstore/testsuite/12readonly.sh tools/xenstore/testsuite/13watch-ack.sh tools/xenstore/testsuite/test.sh tools/xenstore/xenstored_core.c tools/xenstore/xenstored_core.h tools/xenstore/xenstored_domain.c tools/xenstore/xenstored_domain.h tools/xenstore/xenstored_transaction.c tools/xenstore/xenstored_transaction.h tools/xenstore/xenstored_watch.c tools/xenstore/xenstored_watch.h tools/xenstore/xs.c tools/xenstore/xs.h tools/xenstore/xs_random.c tools/xenstore/xs_test.c xen/Makefile xen/acm/acm_core.c xen/acm/acm_policy.c xen/arch/ia64/Makefile xen/arch/ia64/asm-offsets.c xen/arch/ia64/dom_fw.c xen/arch/ia64/domain.c xen/arch/ia64/hypercall.c xen/arch/ia64/hyperprivop.S xen/arch/ia64/patch/linux-2.6.11/kregs.h xen/arch/ia64/pcdp.c xen/arch/ia64/process.c xen/arch/ia64/regionreg.c xen/arch/ia64/vcpu.c xen/arch/ia64/vmmu.c xen/arch/ia64/vtlb.c xen/arch/ia64/xenasm.S xen/arch/ia64/xenmem.c xen/arch/ia64/xenmisc.c xen/arch/ia64/xensetup.c xen/arch/ia64/xentime.c xen/arch/x86/Makefile xen/arch/x86/acpi/boot.c xen/arch/x86/apic.c xen/arch/x86/cpu/common.c xen/arch/x86/domain.c xen/arch/x86/domain_build.c xen/arch/x86/genapic/es7000plat.c xen/arch/x86/i8259.c xen/arch/x86/io_apic.c xen/arch/x86/mpparse.c xen/arch/x86/setup.c xen/arch/x86/shadow.c xen/arch/x86/shadow32.c xen/arch/x86/smpboot.c xen/arch/x86/time.c xen/arch/x86/traps.c xen/arch/x86/vmx.c xen/arch/x86/vmx_intercept.c xen/arch/x86/vmx_io.c xen/arch/x86/vmx_platform.c xen/arch/x86/vmx_vmcs.c xen/arch/x86/x86_32/mm.c xen/arch/x86/x86_32/traps.c xen/arch/x86/x86_64/entry.S xen/arch/x86/x86_64/mm.c xen/arch/x86/x86_64/traps.c xen/common/ac_timer.c xen/common/dom_mem_ops.c xen/common/domain.c xen/common/grant_table.c xen/common/page_alloc.c xen/common/policy_ops.c xen/common/sched_sedf.c xen/common/symbols.c xen/common/xmalloc.c xen/drivers/char/console.c xen/include/acm/acm_core.h xen/include/acm/acm_hooks.h xen/include/asm-ia64/config.h xen/include/asm-ia64/event.h xen/include/asm-ia64/regionreg.h xen/include/asm-ia64/vcpu.h xen/include/asm-ia64/vmx.h xen/include/asm-ia64/vmx_vpd.h xen/include/asm-ia64/xensystem.h xen/include/asm-x86/apicdef.h xen/include/asm-x86/config.h xen/include/asm-x86/fixmap.h xen/include/asm-x86/genapic.h xen/include/asm-x86/hpet.h xen/include/asm-x86/mach-bigsmp/mach_apic.h xen/include/asm-x86/mach-default/mach_apic.h xen/include/asm-x86/mach-es7000/mach_apic.h xen/include/asm-x86/mach-generic/mach_apic.h xen/include/asm-x86/mach-summit/mach_apic.h xen/include/asm-x86/mach-summit/mach_mpparse.h xen/include/asm-x86/shadow.h xen/include/asm-x86/shadow_64.h xen/include/asm-x86/shadow_public.h xen/include/asm-x86/time.h xen/include/asm-x86/types.h xen/include/asm-x86/vmx.h xen/include/asm-x86/vmx_virpit.h xen/include/asm-x86/vmx_vmcs.h xen/include/public/arch-ia64.h xen/include/public/grant_table.h xen/include/public/io/blkif.h xen/include/public/io/netif.h xen/include/public/xen.h xen/include/xen/mm.h xen/include/xen/sched.h xen/include/xen/symbols.h xen/include/xen/time.h xen/tools/Makefile xen/tools/symbols.c
line diff
     1.1 --- a/linux-2.4-xen-sparse/arch/xen/Makefile	Mon Aug 01 12:11:00 2005 -0700
     1.2 +++ b/linux-2.4-xen-sparse/arch/xen/Makefile	Mon Aug 01 12:19:36 2005 -0700
     1.3 @@ -61,7 +61,7 @@ SUBDIRS += arch/xen/drivers/console
     1.4  SUBDIRS += arch/xen/drivers/evtchn
     1.5  SUBDIRS += arch/xen/drivers/blkif
     1.6  SUBDIRS += arch/xen/drivers/netif
     1.7 -SUBDIRS += arch/xen/drivers/usbif
     1.8 +#SUBDIRS += arch/xen/drivers/usbif
     1.9  SUBDIRS += arch/xen/drivers/balloon
    1.10  ifdef CONFIG_XEN_PRIVILEGED_GUEST
    1.11  SUBDIRS += arch/xen/drivers/dom0 
     2.1 --- a/linux-2.4-xen-sparse/arch/xen/kernel/time.c	Mon Aug 01 12:11:00 2005 -0700
     2.2 +++ b/linux-2.4-xen-sparse/arch/xen/kernel/time.c	Mon Aug 01 12:19:36 2005 -0700
     2.3 @@ -225,22 +225,31 @@ static int set_rtc_mmss(unsigned long no
     2.4   */
     2.5  static void __get_time_values_from_xen(void)
     2.6  {
     2.7 -    do {
     2.8 -        shadow_time_version = HYPERVISOR_shared_info->time_version2;
     2.9 -        rmb();
    2.10 -        shadow_tv.tv_sec    = HYPERVISOR_shared_info->wc_sec;
    2.11 -        shadow_tv.tv_usec   = HYPERVISOR_shared_info->wc_usec;
    2.12 -        shadow_tsc_stamp    = 
    2.13 -            (u32)(HYPERVISOR_shared_info->tsc_timestamp >> rdtsc_bitshift);
    2.14 -        shadow_system_time  = HYPERVISOR_shared_info->system_time;
    2.15 -        rmb();
    2.16 -    }
    2.17 -    while ( shadow_time_version != HYPERVISOR_shared_info->time_version1 );
    2.18 +	shared_info_t           *s = HYPERVISOR_shared_info;
    2.19 +	struct vcpu_time_info   *src;
    2.20 +	struct shadow_time_info *dst;
    2.21 +
    2.22 +	src = &s->vcpu_time[smp_processor_id()];
    2.23 +	dst = &per_cpu(shadow_time, smp_processor_id());
    2.24 +
    2.25 +	do {
    2.26 +		dst->version = src->time_version2;
    2.27 +		rmb();
    2.28 +		dst->tsc_timestamp     = src->tsc_timestamp;
    2.29 +		dst->system_timestamp  = src->system_time;
    2.30 +		dst->tsc_to_nsec_mul   = src->tsc_to_system_mul;
    2.31 +		dst->tsc_shift         = src->tsc_shift;
    2.32 +		rmb();
    2.33 +	}
    2.34 +	while (dst->version != src->time_version1);
    2.35 +
    2.36 +	dst->tsc_to_usec_mul = dst->tsc_to_nsec_mul / 1000;
    2.37 +
    2.38 +	if ((shadow_tv.tv_sec != s->wc_sec) ||
    2.39 +	    (shadow_tv.tv_usec != s->wc_usec))
    2.40 +		update_wallclock();
    2.41  }
    2.42  
    2.43 -#define TIME_VALUES_UP_TO_DATE \
    2.44 - ({ rmb(); (shadow_time_version == HYPERVISOR_shared_info->time_version2); })
    2.45 -
    2.46  
    2.47  /*
    2.48   * Returns the system time elapsed, in ns, since the current shadow_timestamp
    2.49 @@ -263,6 +272,17 @@ static inline unsigned long __get_time_d
    2.50      return (unsigned long)delta;
    2.51  }
    2.52  
    2.53 +static inline int time_values_up_to_date()
    2.54 +{
    2.55 +	struct vcpu_time_info   *src;
    2.56 +	struct shadow_time_info *dst;
    2.57 +
    2.58 +	src = &HYPERVISOR_shared_info->vcpu_time[smp_processor_id()];
    2.59 +	dst = &per_cpu(shadow_time, smp_processor_id());
    2.60 +
    2.61 +	return (dst->version == src->time_version2);
    2.62 +}
    2.63 +
    2.64  
    2.65  /*
    2.66   * Returns the current time-of-day in UTC timeval format.
    2.67 @@ -286,7 +306,7 @@ void do_gettimeofday(struct timeval *tv)
    2.68      __normalize_time(&_tv.tv_sec, &nsec);
    2.69      _tv.tv_usec += (long)nsec / 1000L;
    2.70  
    2.71 -    if ( unlikely(!TIME_VALUES_UP_TO_DATE) )
    2.72 +    if ( unlikely(!time_values_up_to_date()) )
    2.73      {
    2.74          /*
    2.75           * We may have blocked for a long time, rendering our calculations
     3.1 --- a/linux-2.4-xen-sparse/mkbuildtree	Mon Aug 01 12:11:00 2005 -0700
     3.2 +++ b/linux-2.4-xen-sparse/mkbuildtree	Mon Aug 01 12:19:36 2005 -0700
     3.3 @@ -102,8 +102,8 @@ for i in `find . -type l`; do rm -f $i; 
     3.4  relative_lndir ${RS}
     3.5  rm -f mkbuildtree
     3.6  
     3.7 -set ${RS}/../linux-2.6.*-xen-sparse
     3.8 -[ "$1" == "${RS}/../linux-2.6.*-xen-parse" ] && { echo "no Linux 2.6 sparse tree at ${RS}/../linux-2.6.*-xen-sparse"; exit 1; }
     3.9 +set ${RS}/../linux-2.6-xen-sparse
    3.10 +[ "$1" == "${RS}/../linux-2.6-xen-parse" ] && { echo "no Linux 2.6 sparse tree at ${RS}/../linux-2.6-xen-sparse"; exit 1; }
    3.11  LINUX_26="$1"
    3.12  
    3.13  
     4.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_32	Mon Aug 01 12:11:00 2005 -0700
     4.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xen0_defconfig_x86_32	Mon Aug 01 12:19:36 2005 -0700
     4.3 @@ -18,8 +18,8 @@ CONFIG_XEN_BLKDEV_GRANT=y
     4.4  CONFIG_XEN_NETDEV_BACKEND=y
     4.5  CONFIG_XEN_BLKDEV_FRONTEND=y
     4.6  CONFIG_XEN_NETDEV_FRONTEND=y
     4.7 -# CONFIG_XEN_NETDEV_GRANT_TX is not set
     4.8 -# CONFIG_XEN_NETDEV_GRANT_RX is not set
     4.9 +CONFIG_XEN_NETDEV_GRANT_TX=y
    4.10 + CONFIG_XEN_NETDEV_GRANT_RX=y
    4.11  # CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
    4.12  # CONFIG_XEN_BLKDEV_TAP is not set
    4.13  # CONFIG_XEN_SHADOW_MODE is not set
     5.1 --- a/linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32	Mon Aug 01 12:11:00 2005 -0700
     5.2 +++ b/linux-2.6-xen-sparse/arch/xen/configs/xenU_defconfig_x86_32	Mon Aug 01 12:19:36 2005 -0700
     5.3 @@ -15,8 +15,8 @@ CONFIG_NO_IDLE_HZ=y
     5.4  CONFIG_XEN_BLKDEV_GRANT=y
     5.5  CONFIG_XEN_BLKDEV_FRONTEND=y
     5.6  CONFIG_XEN_NETDEV_FRONTEND=y
     5.7 -# CONFIG_XEN_NETDEV_GRANT_TX is not set
     5.8 -# CONFIG_XEN_NETDEV_GRANT_RX is not set
     5.9 +CONFIG_XEN_NETDEV_GRANT_TX=y
    5.10 +CONFIG_XEN_NETDEV_GRANT_RX=y
    5.11  # CONFIG_XEN_NETDEV_FRONTEND_PIPELINED_TRANSMITTER is not set
    5.12  # CONFIG_XEN_BLKDEV_TAP is not set
    5.13  # CONFIG_XEN_SHADOW_MODE is not set
     6.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c	Mon Aug 01 12:11:00 2005 -0700
     6.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c	Mon Aug 01 12:19:36 2005 -0700
     6.3 @@ -295,15 +295,12 @@ static inline int time_values_up_to_date
     6.4  	struct vcpu_time_info   *src;
     6.5  	struct shadow_time_info *dst;
     6.6  
     6.7 -	src = &HYPERVISOR_shared_info->vcpu_time[smp_processor_id()];
     6.8 -	dst = &per_cpu(shadow_time, smp_processor_id());
     6.9 +	src = &HYPERVISOR_shared_info->vcpu_time[cpu]; 
    6.10 +	dst = &per_cpu(shadow_time, cpu); 
    6.11  
    6.12  	return (dst->version == src->time_version2);
    6.13  }
    6.14  
    6.15 -#define TIME_VALUES_UP_TO_DATE \
    6.16 - ({ rmb(); (shadow_time_version == HYPERVISOR_shared_info->time_version2); })
    6.17 -
    6.18  /*
    6.19   * This is a special lock that is owned by the CPU and holds the index
    6.20   * register we are working with.  It is required for NMI access to the
     7.1 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/traps.c	Mon Aug 01 12:11:00 2005 -0700
     7.2 +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/traps.c	Mon Aug 01 12:19:36 2005 -0700
     7.3 @@ -90,9 +90,7 @@ asmlinkage void machine_check(void);
     7.4  
     7.5  static int kstack_depth_to_print = 24;
     7.6  struct notifier_block *i386die_chain;
     7.7 -DEFINE_SPINLOCK(die_notifier_lock);
     7.8 -EXPORT_SYMBOL(die_notifier_lock);
     7.9 -EXPORT_SYMBOL(i386die_chain);
    7.10 +static DEFINE_SPINLOCK(die_notifier_lock);
    7.11  
    7.12  int register_die_notifier(struct notifier_block *nb)
    7.13  {
     8.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Mon Aug 01 12:11:00 2005 -0700
     8.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c	Mon Aug 01 12:19:36 2005 -0700
     8.3 @@ -329,11 +329,11 @@ static int blkif_queue_request(struct re
     8.4                  buffer_ma >> PAGE_SHIFT;
     8.5  
     8.6              ring_req->frame_and_sects[ring_req->nr_segments++] =
     8.7 -                (((u32) ref) << 16) | (fsect << 3) | lsect;
     8.8 +                blkif_fas_from_gref(ref, fsect, lsect);
     8.9  
    8.10  #else
    8.11              ring_req->frame_and_sects[ring_req->nr_segments++] =
    8.12 -                buffer_ma | (fsect << 3) | lsect;
    8.13 +                blkif_fas(buffer_ma, fsect, lsect);
    8.14  #endif
    8.15          }
    8.16      }
    8.17 @@ -832,10 +832,10 @@ static int blkif_queue_request(unsigned 
    8.18                  buffer_ma >> PAGE_SHIFT;
    8.19  
    8.20              req->frame_and_sects[req->nr_segments] =
    8.21 -                (((u32) ref ) << 16) | (fsect << 3) | lsect;
    8.22 +                blkif_fas_from_gref(ref, fsect, lsect);
    8.23  #else
    8.24              req->frame_and_sects[req->nr_segments] =
    8.25 -                buffer_ma | (fsect << 3) | lsect;
    8.26 +                blkif_fas(buffer_ma, fsect, lsect);
    8.27  #endif
    8.28              if ( ++req->nr_segments < BLKIF_MAX_SEGMENTS_PER_REQUEST )
    8.29                  sg_next_sect += nr_sectors;
    8.30 @@ -887,9 +887,9 @@ static int blkif_queue_request(unsigned 
    8.31  
    8.32      blk_shadow[xid].frame[0] = buffer_ma >> PAGE_SHIFT;
    8.33  
    8.34 -    req->frame_and_sects[0] = (((u32) ref)<<16)  | (fsect<<3) | lsect;
    8.35 +    req->frame_and_sects[0] = blkif_fas_from_gref(ref, fsect, lsect);
    8.36  #else
    8.37 -    req->frame_and_sects[0] = buffer_ma | (fsect<<3) | lsect;
    8.38 +    req->frame_and_sects[0] = blkif_fas(buffer_ma, fsect, lsect);
    8.39  #endif
    8.40  
    8.41      /* Keep a private copy so we can reissue requests when recovering. */    
    8.42 @@ -1057,7 +1057,7 @@ void blkif_control_probe_send(blkif_requ
    8.43  
    8.44      gnttab_grant_foreign_access_ref( ref, rdomid, address >> PAGE_SHIFT, 0 );
    8.45  
    8.46 -    req->frame_and_sects[0] = (((u32) ref) << 16) | 7;
    8.47 +    req->frame_and_sects[0] = blkif_fas_from_gref(ref, 0, (PAGE_SIZE/512)-1);
    8.48  
    8.49      blkif_control_send(req, rsp);
    8.50  }
     9.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c	Mon Aug 01 12:11:00 2005 -0700
     9.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c	Mon Aug 01 12:19:36 2005 -0700
     9.3 @@ -137,7 +137,7 @@ static vdisk_t *xlvbd_probe(int *ret)
     9.4      blkif_control_probe_send(&req, &rsp,
     9.5                               (unsigned long)(virt_to_machine(buf)));
     9.6  #else
     9.7 -    req.frame_and_sects[0] = virt_to_machine(buf) | 7;
     9.8 +    req.frame_and_sects[0] = blkif_fas(virt_to_machine(buf), 0, ((PAGE_SIZE/512)-1);
     9.9  
    9.10      blkif_control_send(&req, &rsp);
    9.11  #endif
    10.1 --- a/linux-2.6-xen-sparse/include/asm-xen/hypervisor.h	Mon Aug 01 12:11:00 2005 -0700
    10.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/hypervisor.h	Mon Aug 01 12:19:36 2005 -0700
    10.3 @@ -46,6 +46,8 @@
    10.4  #  else
    10.5  #   include <asm-generic/pgtable-nopmd.h>
    10.6  #  endif
    10.7 +# else
    10.8 +#  define pud_t pgd_t
    10.9  # endif
   10.10  #endif
   10.11  
    11.1 --- a/tools/debugger/pdb/Makefile	Mon Aug 01 12:11:00 2005 -0700
    11.2 +++ b/tools/debugger/pdb/Makefile	Mon Aug 01 12:19:36 2005 -0700
    11.3 @@ -33,7 +33,7 @@ LIBDIRS    += ../libxendebug
    11.4  LIBS       += unix str
    11.5  
    11.6  # bc = byte-code, dc = debug byte-code
    11.7 -all : dc
    11.8 +all : patches dc
    11.9  
   11.10  SOURCES    += pdb_caml_xc.c 
   11.11  SOURCES    += pdb_caml_domain.c pdb_caml_process.c
   11.12 @@ -50,3 +50,6 @@ RESULT      = pdb
   11.13  
   11.14  include $(OCAMLMAKEFILE)
   11.15  
   11.16 +PATCHDIR    = ./linux-2.6-patches
   11.17 +patches :
   11.18 +	make -C $(PATCHDIR) patches
    12.1 --- a/tools/debugger/pdb/linux-2.6-module/module.c	Mon Aug 01 12:11:00 2005 -0700
    12.2 +++ b/tools/debugger/pdb/linux-2.6-module/module.c	Mon Aug 01 12:19:36 2005 -0700
    12.3 @@ -278,14 +278,10 @@ pdb_initialize (void)
    12.4      return err;
    12.5  }
    12.6  
    12.7 -extern struct notifier_block *i386die_chain;
    12.8 -extern spinlock_t die_notifier_lock;
    12.9 -
   12.10  static void __exit
   12.11  pdb_terminate(void)
   12.12  {
   12.13      int err = 0;
   12.14 -    unsigned long flags;
   12.15  
   12.16      printk("pdb cleanup\n");
   12.17  
   12.18 @@ -305,9 +301,8 @@ pdb_terminate(void)
   12.19  
   12.20      pdb_send_connection_status(PDB_CONNECTION_STATUS_DOWN, 0);
   12.21  
   12.22 -	spin_lock_irqsave(&die_notifier_lock, flags);
   12.23 -    err = notifier_chain_unregister(&i386die_chain, &pdb_exceptions_nb);
   12.24 -	spin_unlock_irqrestore(&die_notifier_lock, flags);
   12.25 +    /* handler for int1 & int3 */
   12.26 +    err = unregister_die_notifier(&pdb_exceptions_nb);
   12.27  
   12.28  	return;
   12.29  }
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/tools/debugger/pdb/linux-2.6-patches/Makefile	Mon Aug 01 12:19:36 2005 -0700
    13.3 @@ -0,0 +1,10 @@
    13.4 +XEN_ROOT   = ../../../..
    13.5 +LINUX_DIR  = linux-2.6.12-xenU
    13.6 +KDIR       = $(XEN_ROOT)/$(LINUX_DIR)
    13.7 +PATCH_DIR  = $(CURDIR)
    13.8 +
    13.9 +patches : patches-done
   13.10 +
   13.11 +patches-done :
   13.12 +	( for i in *.patch ; do ( cd $(KDIR) ; patch -p1 < $(PATCH_DIR)/$$i || exit 1 ) ; done )
   13.13 +	touch $@
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/tools/debugger/pdb/linux-2.6-patches/i386_ksyms.patch	Mon Aug 01 12:19:36 2005 -0700
    14.3 @@ -0,0 +1,11 @@
    14.4 +diff -u linux-2.6.12/arch/xen/i386/kernel/i386_ksyms.c linux-2.6.12-pdb/arch/xen/i386/kernel/i386_ksyms.c
    14.5 +--- linux-2.6.12/arch/xen/i386/kernel/i386_ksyms.c	2005-07-31 22:36:50.000000000 +0100
    14.6 ++++ linux-2.6.12-pdb/arch/xen/i386/kernel/i386_ksyms.c	2005-08-01 10:57:31.000000000 +0100
    14.7 +@@ -172,6 +172,7 @@
    14.8 + EXPORT_SYMBOL_GPL(unset_nmi_callback);
    14.9 + 
   14.10 + EXPORT_SYMBOL(register_die_notifier);
   14.11 ++EXPORT_SYMBOL(unregister_die_notifier);
   14.12 + #ifdef CONFIG_HAVE_DEC_LOCK
   14.13 + EXPORT_SYMBOL(_atomic_dec_and_lock);
   14.14 + #endif
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/tools/debugger/pdb/linux-2.6-patches/kdebug.patch	Mon Aug 01 12:19:36 2005 -0700
    15.3 @@ -0,0 +1,11 @@
    15.4 +diff -u linux-2.6.12/include/asm-i386/kdebug.h linux-2.6.12-pdb/include/asm-i386/kdebug.h
    15.5 +--- linux-2.6.12/include/asm-i386/kdebug.h	2005-06-17 20:48:29.000000000 +0100
    15.6 ++++ linux-2.6.12-pdb/include/asm-i386/kdebug.h	2005-08-01 11:11:53.000000000 +0100
    15.7 +@@ -21,6 +21,7 @@
    15.8 +    If you really want to do it first unregister - then synchronize_kernel - then free.
    15.9 +   */
   15.10 + int register_die_notifier(struct notifier_block *nb);
   15.11 ++int unregister_die_notifier(struct notifier_block *nb);
   15.12 + extern struct notifier_block *i386die_chain;
   15.13 + 
   15.14 + 
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/tools/debugger/pdb/linux-2.6-patches/makefile.patch	Mon Aug 01 12:19:36 2005 -0700
    16.3 @@ -0,0 +1,12 @@
    16.4 +diff -Naur linux-2.6.12/Makefile linux-2.6.12-pdb/Makefile
    16.5 +--- linux-2.6.12/Makefile	2005-08-01 01:21:21.000000000 +0100
    16.6 ++++ linux-2.6.12-pdb/Makefile	2005-08-01 10:28:10.000000000 +0100
    16.7 +@@ -508,7 +508,7 @@
    16.8 + ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
    16.9 + CFLAGS		+= -Os
   16.10 + else
   16.11 +-CFLAGS		+= -O2
   16.12 ++CFLAGS		+= -O
   16.13 + endif
   16.14 + 
   16.15 + #Add align options if CONFIG_CC_* is not equal to 0
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/tools/debugger/pdb/linux-2.6-patches/ptrace.patch	Mon Aug 01 12:19:36 2005 -0700
    17.3 @@ -0,0 +1,11 @@
    17.4 +diff -u linux-2.6.12/kernel/ptrace.c linux-2.6.12-pdb/kernel/ptrace.c
    17.5 +--- linux-2.6.12/kernel/ptrace.c       2005-06-17 20:48:29.000000000 +0100
    17.6 ++++ linux-2.6.12-pdb/kernel/ptrace.c   2005-07-22 13:23:16.000000000 +0100
    17.7 +@@ -239,6 +239,7 @@
    17.8 + 
    17.9 +        return buf - old_buf;
   17.10 + }
   17.11 ++EXPORT_SYMBOL(access_process_vm);
   17.12 + 
   17.13 + int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len)
   17.14 + {
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/tools/debugger/pdb/linux-2.6-patches/traps.patch	Mon Aug 01 12:19:36 2005 -0700
    18.3 @@ -0,0 +1,20 @@
    18.4 +diff -u linux-2.6.12/arch/xen/i386/kernel/traps.c linux-2.6.12-pdb/arch/xen/i386/kernel/traps.c
    18.5 +--- linux-2.6.12/arch/xen/i386/kernel/traps.c	2005-07-31 22:47:00.000000000 +0100
    18.6 ++++ linux-2.6.12-pdb/arch/xen/i386/kernel/traps.c	2005-07-31 22:47:32.000000000 +0100
    18.7 +@@ -102,6 +102,16 @@
    18.8 + 	return err;
    18.9 + }
   18.10 + 
   18.11 ++int unregister_die_notifier(struct notifier_block *nb)
   18.12 ++{
   18.13 ++	int err = 0;
   18.14 ++	unsigned long flags;
   18.15 ++	spin_lock_irqsave(&die_notifier_lock, flags);
   18.16 ++	err = notifier_chain_unregister(&i386die_chain, nb);
   18.17 ++	spin_unlock_irqrestore(&die_notifier_lock, flags);
   18.18 ++	return err;
   18.19 ++}
   18.20 ++
   18.21 + static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)
   18.22 + {
   18.23 + 	return	p > (void *)tinfo &&
    19.1 --- a/xen/arch/x86/vmx_intercept.c	Mon Aug 01 12:11:00 2005 -0700
    19.2 +++ b/xen/arch/x86/vmx_intercept.c	Mon Aug 01 12:19:36 2005 -0700
    19.3 @@ -197,8 +197,7 @@ int intercept_pit_io(ioreq_t *p)
    19.4  static void pit_timer_fn(void *data)
    19.5  {
    19.6      struct vmx_virpit_t *vpit = data;
    19.7 -    s_time_t   next;
    19.8 -    int        missed_ticks;
    19.9 +    int missed_ticks;
   19.10  
   19.11      missed_ticks = (NOW() - vpit->scheduled) / MILLISECS(vpit->period);
   19.12  
   19.13 @@ -208,12 +207,11 @@ static void pit_timer_fn(void *data)
   19.14  
   19.15      /* pick up missed timer tick */
   19.16      if ( missed_ticks > 0 ) {
   19.17 -        vpit->pending_intr_nr+= missed_ticks;
   19.18 +        vpit->pending_intr_nr += missed_ticks;
   19.19          vpit->scheduled += missed_ticks * MILLISECS(vpit->period);
   19.20      }
   19.21 -    next = vpit->scheduled + MILLISECS(vpit->period);
   19.22 -    set_ac_timer(&vpit->pit_timer, next);
   19.23 -    vpit->scheduled = next;
   19.24 +    vpit->scheduled += MILLISECS(vpit->period);
   19.25 +    set_ac_timer(&vpit->pit_timer, vpit->scheduled);
   19.26  }
   19.27  
   19.28  
    20.1 --- a/xen/include/public/io/blkif.h	Mon Aug 01 12:11:00 2005 -0700
    20.2 +++ b/xen/include/public/io/blkif.h	Mon Aug 01 12:19:36 2005 -0700
    20.3 @@ -36,7 +36,7 @@ typedef struct blkif_request {
    20.4      blkif_vdev_t   device;       /* only for read/write requests         */
    20.5      unsigned long  id;           /* private guest value, echoed in resp  */
    20.6      blkif_sector_t sector_number;/* start sector idx on disk (r/w only)  */
    20.7 -    /* @f_a_s[2:0]=last_sect ; @f_a_s[5:3]=first_sect                        */
    20.8 +    /* @f_a_s[4:0]=last_sect ; @f_a_s[9:5]=first_sect                        */
    20.9  #ifdef CONFIG_XEN_BLKDEV_GRANT
   20.10      /* @f_a_s[:16]= grant reference (16 bits)                                */
   20.11  #else
   20.12 @@ -47,10 +47,12 @@ typedef struct blkif_request {
   20.13      unsigned long  frame_and_sects[BLKIF_MAX_SEGMENTS_PER_REQUEST];
   20.14  } blkif_request_t;
   20.15  
   20.16 -#define blkif_first_sect(_fas) (((_fas)>>3)&7)
   20.17 -#define blkif_last_sect(_fas)  ((_fas)&7)
   20.18 +#define blkif_fas(_addr, _fs, _ls) ((addr)|((_fs)<<5)|(_ls))
   20.19 +#define blkif_first_sect(_fas) (((_fas)>>5)&31)
   20.20 +#define blkif_last_sect(_fas)  ((_fas)&31)
   20.21  
   20.22  #ifdef CONFIG_XEN_BLKDEV_GRANT
   20.23 +#define blkif_fas_from_gref(_gref, _fs, _ls) (((_gref)<<16)|((_fs)<<5)|(_ls))
   20.24  #define blkif_gref_from_fas(_fas) ((_fas)>>16)
   20.25  #endif
   20.26  
    21.1 --- a/xen/include/xen/time.h	Mon Aug 01 12:11:00 2005 -0700
    21.2 +++ b/xen/include/xen/time.h	Mon Aug 01 12:19:36 2005 -0700
    21.3 @@ -51,9 +51,9 @@ typedef s64 s_time_t;
    21.4  s_time_t get_s_time(void);
    21.5  
    21.6  #define NOW()           ((s_time_t)get_s_time())
    21.7 -#define SECONDS(_s)     (((s_time_t)(_s))  * 1000000000ULL )
    21.8 -#define MILLISECS(_ms)  (((s_time_t)(_ms)) * 1000000ULL )
    21.9 -#define MICROSECS(_us)  (((s_time_t)(_us)) * 1000ULL )
   21.10 +#define SECONDS(_s)     ((s_time_t)((_s)  * 1000000000ULL))
   21.11 +#define MILLISECS(_ms)  ((s_time_t)((_ms) * 1000000ULL))
   21.12 +#define MICROSECS(_us)  ((s_time_t)((_us) * 1000ULL))
   21.13  
   21.14  extern void update_dom_time(struct vcpu *v);
   21.15  extern void do_settime(