ia64/xen-unstable

changeset 4902:bb2558cbc4f8

bitkeeper revision 1.1401 (4284bba5zgcyWRg6WwOIZIaOia4E2g)

Merge http://xen.bkbits.net:8080/xeno-unstable.bk
into gandalf.hpl.hp.com:/var/bk/xeno-unstable.bk
author xenbk@gandalf.hpl.hp.com
date Fri May 13 14:37:25 2005 +0000 (2005-05-13)
parents d16ae85cb89e 451693d20478
children 940a73d4b2a6
files BitKeeper/etc/ignore Makefile buildconfigs/Rules.mk buildconfigs/mk.linux-2.4-xen0 buildconfigs/mk.linux-2.4-xenU buildconfigs/mk.linux-2.6-xen0 buildconfigs/mk.linux-2.6-xenU buildconfigs/mk.netbsd-2.0-xenU docs/src/user.tex linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/init.c linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/page.h xen/arch/x86/apic.c xen/arch/x86/setup.c xen/common/dom0_ops.c xen/common/domain.c xen/include/asm-x86/processor.h
line diff
     1.1 --- a/BitKeeper/etc/ignore	Fri May 13 14:30:20 2005 +0000
     1.2 +++ b/BitKeeper/etc/ignore	Fri May 13 14:37:25 2005 +0000
     1.3 @@ -58,6 +58,7 @@ netbsd-*-tools/*
     1.4  netbsd-*-xen0/*
     1.5  netbsd-*-xenU/*
     1.6  netbsd-*.patch
     1.7 +patches/*/.makedep
     1.8  patches/ebtables-brnf-5_vs_2.4.25.diff
     1.9  patches/ebtables.diff
    1.10  patches/tmp/*
     2.1 --- a/Makefile	Fri May 13 14:30:20 2005 +0000
     2.2 +++ b/Makefile	Fri May 13 14:37:25 2005 +0000
     2.3 @@ -15,8 +15,6 @@ KERNELS ?= linux-2.6-xen0 linux-2.6-xenU
     2.4  # linux-2.4-xen0 linux-2.4-xenU netbsd-2.0-xenU
     2.5  # You may use wildcards in the above e.g. KERNELS=*2.4*
     2.6  
     2.7 -ALLKERNELS = $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.*))
     2.8 -ALLSPARSETREES = $(patsubst %-xen-sparse,%,$(wildcard *-xen-sparse))
     2.9  XKERNELS := $(foreach kernel, $(KERNELS), $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.$(kernel))) )
    2.10  
    2.11  export DESTDIR
    2.12 @@ -87,7 +85,7 @@ world:
    2.13  	$(MAKE) dist
    2.14  
    2.15  # clean doesn't do a kclean
    2.16 -clean: 
    2.17 +clean:: 
    2.18  	$(MAKE) -C xen clean
    2.19  	$(MAKE) -C tools clean
    2.20  	$(MAKE) -C docs clean
     3.1 --- a/buildconfigs/Rules.mk	Fri May 13 14:30:20 2005 +0000
     3.2 +++ b/buildconfigs/Rules.mk	Fri May 13 14:37:25 2005 +0000
     3.3 @@ -6,6 +6,9 @@ include Config.mk
     3.4  DISTDIR	?= $(CURDIR)/dist
     3.5  DESTDIR	?= $(DISTDIR)/install
     3.6  
     3.7 +ALLKERNELS = $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.*))
     3.8 +ALLSPARSETREES = $(patsubst %-xen-sparse,%,$(wildcard *-xen-sparse))
     3.9 +
    3.10  .PHONY:	mkpatches mrproper
    3.11  
    3.12  # Setup pristine search path
    3.13 @@ -49,24 +52,30 @@ else
    3.14  OS_VER = $(NETBSD_VER)
    3.15  endif
    3.16  
    3.17 -pristine-%: %.tar.bz2
    3.18 -	rm -rf tmp-$(@F) $@
    3.19 -	mkdir -p tmp-$(@F)
    3.20 -	tar -C tmp-$(@F) -jxf $<
    3.21 -	mv tmp-$(@F)/* $@
    3.22 +$(patsubst %,pristine-%/.valid-pristine,$(ALLSPARSETREES)) : pristine-%/.valid-pristine: %.tar.bz2
    3.23 +	rm -rf tmp-pristine-$* $(@D)
    3.24 +	mkdir -p tmp-pristine-$*
    3.25 +	touch tmp-pristine-$*/.bk_skip
    3.26 +	tar -C tmp-pristine-$* -jxf $<
    3.27 +	mv tmp-pristine-$*/* $(@D)
    3.28 +	@rm -rf tmp-pristine-$*
    3.29  	touch $@ # update timestamp to avoid rebuild
    3.30 -	touch $@/.bk_skip
    3.31 -	@rm -rf tmp-$(@F)
    3.32  
    3.33 -OS_PATCHES = $(shell echo patches/$(OS)-$(OS_VER)/*.patch)
    3.34 +PATCHDIRS := $(wildcard patches/*-*)
    3.35  
    3.36 -ref-%: pristine-% $(OS_PATCHES)
    3.37 -	rm -rf $@
    3.38 -	cp -al $< tmp-$(@F)
    3.39 +-include $(patsubst %,%/.makedep,$(PATCHDIRS))
    3.40 +
    3.41 +$(patsubst patches/%,patches/%/.makedep,$(PATCHDIRS)): patches/%/.makedep: 
    3.42 +	@echo 'ref-$*/.valid-ref: $$(wildcard patches/$*/*.patch)' >$@
    3.43 +
    3.44 +clean::
    3.45 +	rm -f patches/*/.makedep
    3.46 +
    3.47 +ref-%/.valid-ref: pristine-%/.valid-pristine
    3.48 +	rm -rf $(@D)
    3.49 +	cp -al $(<D) $(@D)
    3.50  	[ -d patches/$* ] && \
    3.51 -	  for i in patches/$*/*.patch ; do ( cd tmp-$(@F) ; patch -p1 <../$$i ) ; done || \
    3.52 -	  true
    3.53 -	mv tmp-$(@F) $@
    3.54 +	  for i in patches/$*/*.patch ; do ( cd $(@D) ; patch -p1 <../$$i || exit 1 ) ; done
    3.55  	touch $@ # update timestamp to avoid rebuild
    3.56  
    3.57  %-build:
    3.58 @@ -81,11 +90,11 @@ ref-%: pristine-% $(OS_PATCHES)
    3.59  %-config:
    3.60  	$(MAKE) -f buildconfigs/mk.$* config
    3.61  
    3.62 -%-xen.patch: ref-%
    3.63 +%-xen.patch: ref-%/.valid-ref
    3.64  	rm -rf tmp-$@
    3.65 -	cp -al $< tmp-$@
    3.66 +	cp -al $(<D) tmp-$@
    3.67  	( cd $*-xen-sparse && ./mkbuildtree ../tmp-$@ )	
    3.68 -	diff -Nurp $< tmp-$@ > $@ || true
    3.69 +	diff -Nurp $(<D) tmp-$@ > $@ || true
    3.70  	rm -rf tmp-$@
    3.71  
    3.72  %-mrproper: %-mrproper-extra
     4.1 --- a/buildconfigs/mk.linux-2.4-xen0	Fri May 13 14:30:20 2005 +0000
     4.2 +++ b/buildconfigs/mk.linux-2.4-xen0	Fri May 13 14:37:25 2005 +0000
     4.3 @@ -5,9 +5,7 @@ LINUX_SERIES = 2.4
     4.4  
     4.5  EXTRAVERSION = xen0
     4.6  
     4.7 -FULLVERSION  = $(LINUX_VER)-$(EXTRAVERSION)
     4.8 -
     4.9 -LINUX_DIR    = $(OS)-$(FULLVERSION)
    4.10 +LINUX_DIR    = $(OS)-$(LINUX_VER)-$(EXTRAVERSION)
    4.11  
    4.12  include buildconfigs/Rules.mk
    4.13  
    4.14 @@ -26,9 +24,9 @@ patches/tmp/ebtables.diff:
    4.15  	wget http://www.cl.cam.ac.uk/netos/xen/downloads/ebtables-brnf-5_vs_2.4.27.diff.gz -O- | gunzip -c > $@
    4.16  
    4.17  $(LINUX_DIR)/include/linux/autoconf.h: patches/tmp/ebtables.diff
    4.18 -$(LINUX_DIR)/include/linux/autoconf.h: ref-$(OS)-$(LINUX_VER)
    4.19 +$(LINUX_DIR)/include/linux/autoconf.h: ref-$(OS)-$(LINUX_VER)/.valid-ref
    4.20  	rm -rf $(LINUX_DIR)
    4.21 -	cp -al $< $(LINUX_DIR)
    4.22 +	cp -al $(<D) $(LINUX_DIR)
    4.23  	# Apply arch-xen patches
    4.24  	( cd linux-$(LINUX_VER)-xen-sparse ; \
    4.25            ./mkbuildtree ../$(LINUX_DIR) )
    4.26 @@ -39,8 +37,9 @@ patches/tmp/ebtables.diff:
    4.27  	# add ebtables patch
    4.28  	( cd $(LINUX_DIR) ; patch -p1 -F3 < ../patches/tmp/ebtables.diff )
    4.29  	# Re-use config from install dir if one exits else use default config
    4.30 -	[ -r $(DESTDIR)/boot/config-$(FULLVERSION) ] && \
    4.31 -	  cp $(DESTDIR)/boot/config-$(FULLVERSION) $(LINUX_DIR)/.config \
    4.32 +	CONFIG_VERSION=$$(sed -ne 's/^EXTRAVERSION = //p' $(LINUX_DIR)/Makefile); \
    4.33 +	[ -r $(DESTDIR)/boot/config-$(LINUX_VER)$$CONFIG_VERSION ] && \
    4.34 +	  cp $(DESTDIR)/boot/config-$(LINUX_VER)$$CONFIG_VERSION $(LINUX_DIR)/.config \
    4.35  	  || cp $(LINUX_DIR)/arch/xen/defconfig-$(EXTRAVERSION) \
    4.36  		$(LINUX_DIR)/.config
    4.37  	make -C $(LINUX_DIR) ARCH=xen oldconfig
    4.38 @@ -51,7 +50,7 @@ config: $(LINUX_DIR)/include/linux/autoc
    4.39  	$(MAKE) -C $(LINUX_DIR) ARCH=xen $(CONFIGMODE)
    4.40  	$(MAKE) -C $(LINUX_DIR) ARCH=xen dep
    4.41  
    4.42 -clean:
    4.43 +clean::
    4.44  	$(MAKE) -C $(LINUX_DIR) ARCH=xen clean
    4.45  
    4.46  delete: 
     5.1 --- a/buildconfigs/mk.linux-2.4-xenU	Fri May 13 14:30:20 2005 +0000
     5.2 +++ b/buildconfigs/mk.linux-2.4-xenU	Fri May 13 14:37:25 2005 +0000
     5.3 @@ -5,9 +5,7 @@ LINUX_SERIES = 2.4
     5.4  
     5.5  EXTRAVERSION = xenU
     5.6  
     5.7 -FULLVERSION  = $(LINUX_VER)-$(EXTRAVERSION)
     5.8 -
     5.9 -LINUX_DIR    = $(OS)-$(FULLVERSION)
    5.10 +LINUX_DIR    = $(OS)-$(LINUX_VER)-$(EXTRAVERSION)
    5.11  
    5.12  include buildconfigs/Rules.mk
    5.13  
    5.14 @@ -21,9 +19,9 @@ build: $(LINUX_DIR)/include/linux/autoco
    5.15  	fi
    5.16  	$(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(DESTDIR) install
    5.17  
    5.18 -$(LINUX_DIR)/include/linux/autoconf.h: ref-linux-$(LINUX_VER)
    5.19 +$(LINUX_DIR)/include/linux/autoconf.h: ref-linux-$(LINUX_VER)/.valid-ref
    5.20  	rm -rf $(LINUX_DIR)
    5.21 -	cp -al $< $(LINUX_DIR)
    5.22 +	cp -al $(<D) $(LINUX_DIR)
    5.23  	# Apply arch-xen patches
    5.24  	( cd linux-$(LINUX_VER)-xen-sparse ; \
    5.25            ./mkbuildtree ../$(LINUX_DIR) )
    5.26 @@ -32,8 +30,9 @@ build: $(LINUX_DIR)/include/linux/autoco
    5.27  	  sed -e 's/^EXTRAVERSION.*/&-$(EXTRAVERSION)/' Makefile >Mk.tmp ; \
    5.28  	  rm -f Makefile ; mv Mk.tmp Makefile )
    5.29  	# Re-use config from install dir if one exits else use default config
    5.30 -	[ -r $(DESTDIR)/boot/config-$(FULLVERSION) ] && \
    5.31 -	  cp $(DESTDIR)/boot/config-$(FULLVERSION) $(LINUX_DIR)/.config \
    5.32 +	CONFIG_VERSION=$$(sed -ne 's/^EXTRAVERSION = //p' $(LINUX_DIR)/Makefile); \
    5.33 +	[ -r $(DESTDIR)/boot/config-$(LINUX_VER)$$CONFIG_VERSION ] && \
    5.34 +	  cp $(DESTDIR)/boot/config-$(LINUX_VER)$$CONFIG_VERSION $(LINUX_DIR)/.config \
    5.35  	  || cp $(LINUX_DIR)/arch/xen/defconfig-$(EXTRAVERSION) \
    5.36  		$(LINUX_DIR)/.config
    5.37  	make -C $(LINUX_DIR) ARCH=xen oldconfig
    5.38 @@ -44,7 +43,7 @@ config: $(LINUX_DIR)/include/linux/autoc
    5.39  	$(MAKE) -C $(LINUX_DIR) ARCH=xen $(CONFIGMODE)
    5.40  	$(MAKE) -C $(LINUX_DIR) ARCH=xen dep
    5.41  
    5.42 -clean:
    5.43 +clean::
    5.44  	$(MAKE) -C $(LINUX_DIR) ARCH=xen clean
    5.45  
    5.46  delete: 
     6.1 --- a/buildconfigs/mk.linux-2.6-xen0	Fri May 13 14:30:20 2005 +0000
     6.2 +++ b/buildconfigs/mk.linux-2.6-xen0	Fri May 13 14:37:25 2005 +0000
     6.3 @@ -5,9 +5,7 @@ LINUX_SERIES = 2.6
     6.4  
     6.5  EXTRAVERSION = xen0
     6.6  
     6.7 -FULLVERSION  = $(LINUX_VER)-$(EXTRAVERSION)
     6.8 -
     6.9 -LINUX_DIR    = $(OS)-$(FULLVERSION)
    6.10 +LINUX_DIR    = $(OS)-$(LINUX_VER)-$(EXTRAVERSION)
    6.11  
    6.12  include buildconfigs/Rules.mk
    6.13  
    6.14 @@ -21,9 +19,9 @@ build: $(LINUX_DIR)/include/linux/autoco
    6.15  	fi
    6.16  	$(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(DESTDIR) install
    6.17  
    6.18 -$(LINUX_DIR)/include/linux/autoconf.h: ref-$(OS)-$(LINUX_VER)
    6.19 +$(LINUX_DIR)/include/linux/autoconf.h: ref-$(OS)-$(LINUX_VER)/.valid-ref
    6.20  	rm -rf $(LINUX_DIR)
    6.21 -	cp -al $< $(LINUX_DIR)
    6.22 +	cp -al $(<D) $(LINUX_DIR)
    6.23  	# Apply arch-xen patches
    6.24  	( cd linux-$(LINUX_VER)-xen-sparse ; \
    6.25            ./mkbuildtree ../$(LINUX_DIR) )
    6.26 @@ -32,8 +30,9 @@ build: $(LINUX_DIR)/include/linux/autoco
    6.27  	  sed -e 's/^EXTRAVERSION.*/&-$(EXTRAVERSION)/' Makefile >Mk.tmp ; \
    6.28  	  rm -f Makefile ; mv Mk.tmp Makefile )
    6.29  	# Re-use config from install dir if one exits else use default config
    6.30 -	[ -r $(DESTDIR)/boot/config-$(FULLVERSION) ] && \
    6.31 -	  cp $(DESTDIR)/boot/config-$(FULLVERSION) $(LINUX_DIR)/.config \
    6.32 +	CONFIG_VERSION=$$(sed -ne 's/^EXTRAVERSION = //p' $(LINUX_DIR)/Makefile); \
    6.33 +	[ -r $(DESTDIR)/boot/config-$(LINUX_VER)$$CONFIG_VERSION ] && \
    6.34 +	  cp $(DESTDIR)/boot/config-$(LINUX_VER)$$CONFIG_VERSION $(LINUX_DIR)/.config \
    6.35  	  || cp $(LINUX_DIR)/arch/xen/configs/$(EXTRAVERSION)_defconfig_$(TARGET_SUBARCH) \
    6.36  		$(LINUX_DIR)/.config
    6.37  	$(MAKE) -C $(LINUX_DIR) ARCH=xen oldconfig
    6.38 @@ -42,7 +41,7 @@ config: CONFIGMODE = menuconfig
    6.39  config: $(LINUX_DIR)/include/linux/autoconf.h
    6.40  	$(MAKE) -C $(LINUX_DIR) ARCH=xen $(CONFIGMODE)
    6.41  
    6.42 -clean:
    6.43 +clean::
    6.44  	$(MAKE) -C $(LINUX_DIR) ARCH=xen clean
    6.45  
    6.46  delete: 
     7.1 --- a/buildconfigs/mk.linux-2.6-xenU	Fri May 13 14:30:20 2005 +0000
     7.2 +++ b/buildconfigs/mk.linux-2.6-xenU	Fri May 13 14:37:25 2005 +0000
     7.3 @@ -5,9 +5,7 @@ LINUX_SERIES = 2.6
     7.4  
     7.5  EXTRAVERSION = xenU
     7.6  
     7.7 -FULLVERSION  = $(LINUX_VER)-$(EXTRAVERSION)
     7.8 -
     7.9 -LINUX_DIR    = $(OS)-$(FULLVERSION)
    7.10 +LINUX_DIR    = $(OS)-$(LINUX_VER)-$(EXTRAVERSION)
    7.11  
    7.12  include buildconfigs/Rules.mk
    7.13  
    7.14 @@ -21,9 +19,9 @@ build: $(LINUX_DIR)/include/linux/autoco
    7.15  	fi
    7.16  	$(MAKE) -C $(LINUX_DIR) ARCH=xen INSTALL_PATH=$(DESTDIR) install
    7.17  
    7.18 -$(LINUX_DIR)/include/linux/autoconf.h: ref-$(OS)-$(LINUX_VER)
    7.19 +$(LINUX_DIR)/include/linux/autoconf.h: ref-$(OS)-$(LINUX_VER)/.valid-ref
    7.20  	rm -rf $(LINUX_DIR)
    7.21 -	cp -al $< $(LINUX_DIR)
    7.22 +	cp -al $(<D) $(LINUX_DIR)
    7.23  	# Apply arch-xen patches
    7.24  	( cd linux-$(LINUX_VER)-xen-sparse ; \
    7.25            ./mkbuildtree ../$(LINUX_DIR) )
    7.26 @@ -32,8 +30,9 @@ build: $(LINUX_DIR)/include/linux/autoco
    7.27  	  sed -e 's/^EXTRAVERSION.*/&-$(EXTRAVERSION)/' Makefile >Mk.tmp ; \
    7.28  	  rm -f Makefile ; mv Mk.tmp Makefile )
    7.29  	# Re-use config from install dir if one exits else use default config
    7.30 -	[ -r $(DESTDIR)/boot/config-$(FULLVERSION) ] && \
    7.31 -	  cp $(DESTDIR)/boot/config-$(FULLVERSION) $(LINUX_DIR)/.config \
    7.32 +	CONFIG_VERSION=$$(sed -ne 's/^EXTRAVERSION = //p' $(LINUX_DIR)/Makefile); \
    7.33 +	[ -r $(DESTDIR)/boot/config-$(LINUX_VER)$$CONFIG_VERSION ] && \
    7.34 +	  cp $(DESTDIR)/boot/config-$(LINUX_VER)$$CONFIG_VERSION $(LINUX_DIR)/.config \
    7.35  	  || cp $(LINUX_DIR)/arch/xen/configs/$(EXTRAVERSION)_defconfig_$(TARGET_SUBARCH) \
    7.36  		$(LINUX_DIR)/.config
    7.37  	$(MAKE) -C $(LINUX_DIR) ARCH=xen oldconfig
    7.38 @@ -42,7 +41,7 @@ config: CONFIGMODE = menuconfig
    7.39  config: $(LINUX_DIR)/include/linux/autoconf.h
    7.40  	$(MAKE) -C $(LINUX_DIR) ARCH=xen $(CONFIGMODE)
    7.41  
    7.42 -clean:
    7.43 +clean::
    7.44  	$(MAKE) -C $(LINUX_DIR) ARCH=xen clean
    7.45  
    7.46  delete: 
     8.1 --- a/buildconfigs/mk.netbsd-2.0-xenU	Fri May 13 14:30:20 2005 +0000
     8.2 +++ b/buildconfigs/mk.netbsd-2.0-xenU	Fri May 13 14:37:25 2005 +0000
     8.3 @@ -24,9 +24,9 @@ netbsd-%-tools: netbsd-%-tools.tar.bz2
     8.4  	tar -jxf $<
     8.5  	touch $@ # update timestamp to avoid rebuild
     8.6  
     8.7 -$(NETBSD_DIR)/.valid: ref-$(OS)-$(NETBSD_VER)
     8.8 +$(NETBSD_DIR)/.valid: ref-$(OS)-$(NETBSD_VER)/.valid-ref
     8.9  	$(RM) -rf $(NETBSD_DIR)
    8.10 -	cp -al $< $(NETBSD_DIR)
    8.11 +	cp -al $(<D) $(NETBSD_DIR)
    8.12  	# Apply arch-xen patches
    8.13  	( cd netbsd-$(NETBSD_VER)-xen-sparse ; \
    8.14            ./mkbuildtree ../$(NETBSD_DIR) )
    8.15 @@ -38,7 +38,7 @@ netbsd-xen%: $(NETBSD_DIR)/.valid netbsd
    8.16  	$(MAKE) -C netbsd-$(FULLVERSION) netbsd
    8.17  	$(MAKE) -C netbsd-$(FULLVERSION) INSTALL_PATH=$(DESTDIR) INSTALL_NAME=boot/netbsd-$(NETBSD_VER)-xen$* install
    8.18  
    8.19 -clean:
    8.20 +clean::
    8.21  	$(MAKE) -C netbsd-$(FULLVERSION) clean
    8.22  
    8.23  delete:
     9.1 --- a/docs/src/user.tex	Fri May 13 14:30:20 2005 +0000
     9.2 +++ b/docs/src/user.tex	Fri May 13 14:37:25 2005 +0000
     9.3 @@ -1791,6 +1791,9 @@ unchanged semantics.
     9.4   Instruct Xen (and domain 0) to ignore any IOAPICs that are present in
     9.5   the system, and instead continue to use the legacy PIC.
     9.6  
     9.7 +\item [apic=debug,verbose ]
     9.8 + Print more detailed information about local APIC and IOAPIC configuration.
     9.9 +
    9.10  \end{description} 
    9.11  
    9.12  \section{XenLinux Boot Options}
    10.1 --- a/linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/init.c	Fri May 13 14:30:20 2005 +0000
    10.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/x86_64/mm/init.c	Fri May 13 14:37:25 2005 +0000
    10.3 @@ -328,11 +328,11 @@ static void set_pte_phys_ma(unsigned lon
    10.4  		}
    10.5  	}
    10.6  
    10.7 -	new_pte = pfn_pte(phys >> PAGE_SHIFT, prot);
    10.8 +	new_pte = pfn_pte_ma(phys >> PAGE_SHIFT, prot);
    10.9  	pte = pte_offset_kernel(pmd, vaddr);
   10.10  
   10.11  	if (!pte_none(*pte) &&
   10.12 -	    pte_val(*pte) != (pte_val(new_pte) & __supported_pte_mask))
   10.13 +	    pte_val_ma(*pte) != (pte_val_ma(new_pte) & __supported_pte_mask))
   10.14  		pte_ERROR(*pte);
   10.15  
   10.16          /* 
    11.1 --- a/linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/page.h	Fri May 13 14:30:20 2005 +0000
    11.2 +++ b/linux-2.6.11-xen-sparse/include/asm-xen/asm-x86_64/page.h	Fri May 13 14:37:25 2005 +0000
    11.3 @@ -92,6 +92,7 @@ typedef struct { unsigned long pgprot; }
    11.4  
    11.5  #define pte_val(x)	(((x).pte & 1) ? machine_to_phys((x).pte) : \
    11.6  			 (x).pte)
    11.7 +#define pte_val_ma(x)	((x).pte)
    11.8  
    11.9  static inline unsigned long pmd_val(pmd_t x)
   11.10  {
    12.1 --- a/xen/arch/x86/apic.c	Fri May 13 14:30:20 2005 +0000
    12.2 +++ b/xen/arch/x86/apic.c	Fri May 13 14:37:25 2005 +0000
    12.3 @@ -1,5 +1,5 @@
    12.4  /*
    12.5 - *      based on linux-2.6.10/arch/i386/kernel/apic.c
    12.6 + *      based on linux-2.6.11/arch/i386/kernel/apic.c
    12.7   *
    12.8   *  Local APIC handling, local APIC timers
    12.9   *
   12.10 @@ -37,11 +37,14 @@
   12.11  #include <mach_apic.h>
   12.12  #include <io_ports.h>
   12.13  
   12.14 +/*
   12.15 + * Debug level
   12.16 + */
   12.17 +int apic_verbosity;
   12.18 +
   12.19  /* Using APIC to generate smp_local_timer_interrupt? */
   12.20  int using_apic_timer = 0;
   12.21  
   12.22 -int apic_verbosity;
   12.23 -
   12.24  static int enabled_via_apicbase;
   12.25  
   12.26  int get_physical_broadcast(void)
   12.27 @@ -126,7 +129,8 @@ void __init connect_bsp_APIC(void)
   12.28           * PIC mode, enable APIC mode in the IMCR, i.e.
   12.29           * connect BSP's local APIC to INT and NMI lines.
   12.30           */
   12.31 -        printk("leaving PIC mode, enabling APIC mode.\n");
   12.32 +        apic_printk(APIC_VERBOSE, "leaving PIC mode, "
   12.33 +                    "enabling APIC mode.\n");
   12.34          outb(0x70, 0x22);
   12.35          outb(0x01, 0x23);
   12.36      }
   12.37 @@ -141,7 +145,8 @@ void disconnect_bsp_APIC(void)
   12.38           * interrupts, including IPIs, won't work beyond
   12.39           * this point!  The only exception are INIT IPIs.
   12.40           */
   12.41 -        printk("disabling APIC mode, entering PIC mode.\n");
   12.42 +        apic_printk(APIC_VERBOSE, "disabling APIC mode, "
   12.43 +                    "entering PIC mode.\n");
   12.44          outb(0x70, 0x22);
   12.45          outb(0x00, 0x23);
   12.46      }
   12.47 @@ -182,10 +187,10 @@ int __init verify_local_APIC(void)
   12.48       * The version register is read-only in a real APIC.
   12.49       */
   12.50      reg0 = apic_read(APIC_LVR);
   12.51 -    Dprintk("Getting VERSION: %x\n", reg0);
   12.52 +    apic_printk(APIC_DEBUG, "Getting VERSION: %x\n", reg0);
   12.53      apic_write(APIC_LVR, reg0 ^ APIC_LVR_MASK);
   12.54      reg1 = apic_read(APIC_LVR);
   12.55 -    Dprintk("Getting VERSION: %x\n", reg1);
   12.56 +    apic_printk(APIC_DEBUG, "Getting VERSION: %x\n", reg1);
   12.57  
   12.58      /*
   12.59       * The two version reads above should print the same
   12.60 @@ -209,7 +214,7 @@ int __init verify_local_APIC(void)
   12.61       * The ID register is read/write in a real APIC.
   12.62       */
   12.63      reg0 = apic_read(APIC_ID);
   12.64 -    Dprintk("Getting ID: %x\n", reg0);
   12.65 +    apic_printk(APIC_DEBUG, "Getting ID: %x\n", reg0);
   12.66  
   12.67      /*
   12.68       * The next two are just to see if we have sane values.
   12.69 @@ -217,9 +222,9 @@ int __init verify_local_APIC(void)
   12.70       * compatibility mode, but most boxes are anymore.
   12.71       */
   12.72      reg0 = apic_read(APIC_LVT0);
   12.73 -    Dprintk("Getting LVT0: %x\n", reg0);
   12.74 +    apic_printk(APIC_DEBUG, "Getting LVT0: %x\n", reg0);
   12.75      reg1 = apic_read(APIC_LVT1);
   12.76 -    Dprintk("Getting LVT1: %x\n", reg1);
   12.77 +    apic_printk(APIC_DEBUG, "Getting LVT1: %x\n", reg1);
   12.78  
   12.79      return 1;
   12.80  }
   12.81 @@ -235,20 +240,23 @@ void __init sync_Arb_IDs(void)
   12.82       */
   12.83      apic_wait_icr_idle();
   12.84  
   12.85 -    Dprintk("Synchronizing Arb IDs.\n");
   12.86 +    apic_printk(APIC_DEBUG, "Synchronizing Arb IDs.\n");
   12.87      apic_write_around(APIC_ICR, APIC_DEST_ALLINC | APIC_INT_LEVELTRIG
   12.88                        | APIC_DM_INIT);
   12.89  }
   12.90  
   12.91  extern void __error_in_apic_c (void);
   12.92  
   12.93 +/*
   12.94 + * An initial setup of the virtual wire mode.
   12.95 + */
   12.96  void __init init_bsp_APIC(void)
   12.97  {
   12.98      unsigned long value, ver;
   12.99  
  12.100      /*
  12.101 -     * Don't do the setup now if we have a SMP BIOS as the through-I/O-APIC 
  12.102 -     * virtual wire mode might be active.
  12.103 +     * Don't do the setup now if we have a SMP BIOS as the
  12.104 +     * through-I/O-APIC virtual wire mode might be active.
  12.105       */
  12.106      if (smp_found_config || !cpu_has_apic)
  12.107          return;
  12.108 @@ -380,10 +388,12 @@ void __init setup_local_APIC (void)
  12.109      value = apic_read(APIC_LVT0) & APIC_LVT_MASKED;
  12.110      if (!smp_processor_id() && (pic_mode || !value)) {
  12.111          value = APIC_DM_EXTINT;
  12.112 -        printk("enabled ExtINT on CPU#%d\n", smp_processor_id());
  12.113 +        apic_printk(APIC_VERBOSE, "enabled ExtINT on CPU#%d\n",
  12.114 +                    smp_processor_id());
  12.115      } else {
  12.116          value = APIC_DM_EXTINT | APIC_LVT_MASKED;
  12.117 -        printk("masked ExtINT on CPU#%d\n", smp_processor_id());
  12.118 +        apic_printk(APIC_VERBOSE, "masked ExtINT on CPU#%d\n",
  12.119 +                    smp_processor_id());
  12.120      }
  12.121      apic_write_around(APIC_LVT0, value);
  12.122  
  12.123 @@ -413,8 +423,9 @@ void __init setup_local_APIC (void)
  12.124              apic_write(APIC_ESR, 0);
  12.125          value = apic_read(APIC_ESR);
  12.126          if (value != oldvalue)
  12.127 -            printk("ESR value before enabling vector: 0x%08lx "
  12.128 -                "after: 0x%08lx\n", oldvalue, value);
  12.129 +            apic_printk(APIC_VERBOSE, "ESR value before enabling "
  12.130 +                        "vector: 0x%08lx  after: 0x%08lx\n",
  12.131 +                        oldvalue, value);
  12.132      } else {
  12.133          if (esr_disable)    
  12.134              /* 
  12.135 @@ -424,8 +435,8 @@ void __init setup_local_APIC (void)
  12.136               * errors anyway - mbligh
  12.137               */
  12.138              printk("Leaving ESR disabled.\n");
  12.139 -        else 
  12.140 -        printk("No ESR for 82489DX.\n");
  12.141 +        else
  12.142 +            printk("No ESR for 82489DX.\n");
  12.143      }
  12.144  
  12.145      if (nmi_watchdog == NMI_LOCAL_APIC)
  12.146 @@ -437,6 +448,18 @@ void __init setup_local_APIC (void)
  12.147   * Original code written by Keir Fraser.
  12.148   */
  12.149  
  12.150 +static void __init apic_set_verbosity(char *str)
  12.151 +{
  12.152 +    if (strcmp("debug", str) == 0)
  12.153 +        apic_verbosity = APIC_DEBUG;
  12.154 +    else if (strcmp("verbose", str) == 0)
  12.155 +        apic_verbosity = APIC_VERBOSE;
  12.156 +    else
  12.157 +        printk(KERN_WARNING "APIC Verbosity level %s not recognised"
  12.158 +               " use apic=verbose or apic=debug", str);
  12.159 +}
  12.160 +custom_param("apic", apic_set_verbosity);
  12.161 +
  12.162  static int __init detect_init_APIC (void)
  12.163  {
  12.164      u32 h, l, features;
  12.165 @@ -476,8 +499,10 @@ static int __init detect_init_APIC (void
  12.166              enabled_via_apicbase = 1;
  12.167          }
  12.168      }
  12.169 -
  12.170 -    /* The APIC feature bit should now be enabled in `cpuid' */
  12.171 +    /*
  12.172 +     * The APIC feature bit should now be enabled
  12.173 +     * in `cpuid'
  12.174 +     */
  12.175      features = cpuid_edx(1);
  12.176      if (!(features & (1 << X86_FEATURE_APIC))) {
  12.177          printk("Could not enable APIC!\n");
  12.178 @@ -520,7 +545,8 @@ void __init init_apic_mappings(void)
  12.179          apic_phys = mp_lapic_addr;
  12.180  
  12.181      set_fixmap_nocache(FIX_APIC_BASE, apic_phys);
  12.182 -    Dprintk("mapped APIC to %08lx (%08lx)\n", APIC_BASE, apic_phys);
  12.183 +    apic_printk(APIC_VERBOSE, "mapped APIC to %08lx (%08lx)\n", APIC_BASE,
  12.184 +                apic_phys);
  12.185  
  12.186      /*
  12.187       * Fetch the APIC ID of the BSP in case we have a
  12.188 @@ -552,8 +578,8 @@ fake_ioapic_page:
  12.189                  ioapic_phys = __pa(ioapic_phys);
  12.190              }
  12.191              set_fixmap_nocache(idx, ioapic_phys);
  12.192 -            Dprintk("mapped IOAPIC to %08lx (%08lx)\n",
  12.193 -                    fix_to_virt(idx), ioapic_phys);
  12.194 +            apic_printk(APIC_VERBOSE, "mapped IOAPIC to %08lx (%08lx)\n",
  12.195 +                        __fix_to_virt(idx), ioapic_phys);
  12.196              idx++;
  12.197          }
  12.198      }
  12.199 @@ -604,37 +630,32 @@ static unsigned int __init get_8254_time
  12.200  /* next tick in 8254 can be caught by catching timer wraparound */
  12.201  static void __init wait_8254_wraparound(void)
  12.202  {
  12.203 -    unsigned int curr_count, prev_count=~0;
  12.204 -    int delta;
  12.205 -
  12.206 +    unsigned int curr_count, prev_count;
  12.207 +    
  12.208      curr_count = get_8254_timer_count();
  12.209 -
  12.210      do {
  12.211          prev_count = curr_count;
  12.212          curr_count = get_8254_timer_count();
  12.213 -        delta = curr_count-prev_count;
  12.214  
  12.215 -        /*
  12.216 -         * This limit for delta seems arbitrary, but it isn't, it's slightly
  12.217 -         * above the level of error a buggy Mercury/Neptune chipset timer can
  12.218 -         * cause.
  12.219 -         */
  12.220 -    } while (delta < 300);
  12.221 +        /* workaround for broken Mercury/Neptune */
  12.222 +        if (prev_count >= curr_count + 0x100)
  12.223 +            curr_count = get_8254_timer_count();
  12.224 +        
  12.225 +    } while (prev_count >= curr_count);
  12.226  }
  12.227  
  12.228  /*
  12.229   * Default initialization for 8254 timers. If we use other timers like HPET,
  12.230   * we override this later
  12.231   */
  12.232 -void (*wait_timer_tick)(void) = wait_8254_wraparound;
  12.233 +void (*wait_timer_tick)(void) __initdata = wait_8254_wraparound;
  12.234  
  12.235  /*
  12.236   * This function sets up the local APIC timer, with a timeout of
  12.237   * 'clocks' APIC bus clock. During calibration we actually call
  12.238 - * this function with a very large value and read the current time after
  12.239 - * a well defined period of time as expired.
  12.240 - *
  12.241 - * Calibration is only performed once, for CPU0!
  12.242 + * this function twice on the boot CPU, once with a bogus timeout
  12.243 + * value, second time for real. The other (noncalibrating) CPUs
  12.244 + * call this function only once, with the real, calibrated value.
  12.245   *
  12.246   * We do reads before writes even if unnecessary, to get around the
  12.247   * P5 APIC double write bug.
  12.248 @@ -693,7 +714,7 @@ int __init calibrate_APIC_clock(void)
  12.249      int i;
  12.250      const int LOOPS = HZ/10;
  12.251  
  12.252 -    printk("Calibrating APIC timer for CPU%d...\n",  smp_processor_id());
  12.253 +    apic_printk(APIC_VERBOSE, "calibrating APIC timer ...\n");
  12.254  
  12.255      /*
  12.256       * Put whatever arbitrary (but long enough) timeout
  12.257 @@ -730,26 +751,29 @@ int __init calibrate_APIC_clock(void)
  12.258       * The APIC bus clock counter is 32 bits only, it
  12.259       * might have overflown, but note that we use signed
  12.260       * longs, thus no extra care needed.
  12.261 -     * [underflown to be exact, as the timer counts down ;)]
  12.262 +     *
  12.263 +     * underflown to be exact, as the timer counts down ;)
  12.264       */
  12.265  
  12.266      result = (tt1-tt2)*APIC_DIVISOR/LOOPS;
  12.267  
  12.268      if (cpu_has_tsc)
  12.269 -        printk("..... CPU clock speed is %ld.%04ld MHz.\n",
  12.270 -            ((long)(t2-t1)/LOOPS)/(1000000/HZ),
  12.271 -            ((long)(t2-t1)/LOOPS)%(1000000/HZ));
  12.272 +        apic_printk(APIC_VERBOSE, "..... CPU clock speed is "
  12.273 +                    "%ld.%04ld MHz.\n",
  12.274 +                    ((long)(t2-t1)/LOOPS)/(1000000/HZ),
  12.275 +                    ((long)(t2-t1)/LOOPS)%(1000000/HZ));
  12.276  
  12.277 -    printk("..... host bus clock speed is %ld.%04ld MHz.\n",
  12.278 -        result/(1000000/HZ),
  12.279 -        result%(1000000/HZ));
  12.280 +    apic_printk(APIC_VERBOSE, "..... host bus clock speed is "
  12.281 +		"%ld.%04ld MHz.\n",
  12.282 +		result/(1000000/HZ),
  12.283 +		result%(1000000/HZ));
  12.284  
  12.285      /* set up multipliers for accurate timer code */
  12.286      bus_freq   = result*HZ;
  12.287      bus_cycle  = (u32) (1000000000000LL/bus_freq); /* in pico seconds */
  12.288      bus_scale  = (1000*262144)/bus_cycle;
  12.289  
  12.290 -    printk("..... bus_scale = 0x%08X\n", bus_scale);
  12.291 +    apic_printk(APIC_VERBOSE, "..... bus_scale = 0x%08X\n", bus_scale);
  12.292      /* reset APIC to zero timeout value */
  12.293      __setup_APIC_LVTT(0);
  12.294  
  12.295 @@ -762,7 +786,6 @@ int __init calibrate_APIC_clock(void)
  12.296   */
  12.297  void __init setup_APIC_clocks (void)
  12.298  {
  12.299 -    printk("Using local APIC timer interrupts.\n");
  12.300      using_apic_timer = 1;
  12.301      __cli();
  12.302      /* calibrate CPU0 for CPU speed and BUS speed */
  12.303 @@ -908,7 +931,7 @@ int __init APIC_init_uniprocessor (void)
  12.304       * Complain if the BIOS pretends there is one.
  12.305       */
  12.306      if (!cpu_has_apic && APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid])) {
  12.307 -        printk("BIOS bug, local APIC #%d not detected!...\n",
  12.308 +        printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n",
  12.309                 boot_cpu_physical_apicid);
  12.310          return -1;
  12.311      }
    13.1 --- a/xen/arch/x86/setup.c	Fri May 13 14:30:20 2005 +0000
    13.2 +++ b/xen/arch/x86/setup.c	Fri May 13 14:37:25 2005 +0000
    13.3 @@ -615,6 +615,13 @@ void __init __start_xen(multiboot_info_t
    13.4              strcat(cmdline, " acpi=");
    13.5              strcat(cmdline, acpi_param);
    13.6          }
    13.7 +        if ( !strstr(cmdline, "apic=") )
    13.8 +        {
    13.9 +            if ( apic_verbosity == APIC_VERBOSE )
   13.10 +                strcat(cmdline, " apic=verbose");
   13.11 +            else if ( apic_verbosity == APIC_DEBUG )
   13.12 +                strcat(cmdline, " apic=debug");
   13.13 +        }
   13.14      }
   13.15  
   13.16      /*
    14.1 --- a/xen/common/dom0_ops.c	Fri May 13 14:30:20 2005 +0000
    14.2 +++ b/xen/common/dom0_ops.c	Fri May 13 14:37:25 2005 +0000
    14.3 @@ -230,15 +230,15 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
    14.4              break;
    14.5          }
    14.6          
    14.7 -        if ( (op->u.pincpudomain.exec_domain >= MAX_VIRT_CPUS) ||
    14.8 -             !d->exec_domain[op->u.pincpudomain.exec_domain] )
    14.9 +        if ( (op->u.pincpudomain.vcpu >= MAX_VIRT_CPUS) ||
   14.10 +             !d->exec_domain[op->u.pincpudomain.vcpu] )
   14.11          {
   14.12              ret = -EINVAL;
   14.13              put_domain(d);
   14.14              break;
   14.15          }
   14.16  
   14.17 -        ed = d->exec_domain[op->u.pincpudomain.exec_domain];
   14.18 +        ed = d->exec_domain[op->u.pincpudomain.vcpu];
   14.19          if ( ed == NULL )
   14.20          {
   14.21              ret = -ESRCH;
   14.22 @@ -382,14 +382,14 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
   14.23              break;
   14.24          }
   14.25  
   14.26 -        if ( op->u.getvcpucontext.exec_domain >= MAX_VIRT_CPUS )
   14.27 +        if ( op->u.getvcpucontext.vcpu >= MAX_VIRT_CPUS )
   14.28          {
   14.29              ret = -EINVAL;
   14.30              put_domain(d);
   14.31              break;
   14.32          }
   14.33          
   14.34 -        ed = d->exec_domain[op->u.getvcpucontext.exec_domain];
   14.35 +        ed = d->exec_domain[op->u.getvcpucontext.vcpu];
   14.36          if ( ed == NULL )
   14.37          {
   14.38              ret = -ESRCH;
    15.1 --- a/xen/common/domain.c	Fri May 13 14:30:20 2005 +0000
    15.2 +++ b/xen/common/domain.c	Fri May 13 14:37:25 2005 +0000
    15.3 @@ -221,7 +221,7 @@ int set_info_guest(struct domain *d, dom
    15.4  {
    15.5      int rc = 0;
    15.6      struct vcpu_guest_context *c = NULL;
    15.7 -    unsigned long vcpu = setdomaininfo->exec_domain;
    15.8 +    unsigned long vcpu = setdomaininfo->vcpu;
    15.9      struct exec_domain *ed; 
   15.10  
   15.11      if ( (vcpu >= MAX_VIRT_CPUS) || ((ed = d->exec_domain[vcpu]) == NULL) )
    16.1 --- a/xen/include/asm-x86/processor.h	Fri May 13 14:30:20 2005 +0000
    16.2 +++ b/xen/include/asm-x86/processor.h	Fri May 13 14:37:25 2005 +0000
    16.3 @@ -377,7 +377,7 @@ extern struct tss_struct init_tss[NR_CPU
    16.4  #ifdef ARCH_HAS_FAST_TRAP
    16.5  
    16.6  #define SET_DEFAULT_FAST_TRAP(_p) \
    16.7 -    (_p)->guest_context.fast_trap_idx = 0x20;   \
    16.8 +    (_p)->guest_context.fast_trap_idx = 0x30;   \
    16.9      (_p)->fast_trap_desc.a = 0;   \
   16.10      (_p)->fast_trap_desc.b = 0;
   16.11