SOURCES: kernel-xen-xen.patch - update from http://xenbits.xensource.com/li...

glen glen at pld-linux.org
Sun May 18 23:51:24 CEST 2008


Author: glen                         Date: Sun May 18 21:51:24 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- update from http://xenbits.xensource.com/linux-2.6.18-xen.hg

---- Files affected:
SOURCES:
   kernel-xen-xen.patch (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/kernel-xen-xen.patch
diff -u SOURCES/kernel-xen-xen.patch:1.1 SOURCES/kernel-xen-xen.patch:1.2
--- SOURCES/kernel-xen-xen.patch:1.1	Thu Dec 27 11:24:39 2007
+++ SOURCES/kernel-xen-xen.patch	Sun May 18 23:51:18 2008
@@ -1,32 +1,35 @@
-diff -burN --exclude .hg --exclude .hgtags linux-2.6.18/arch/i386/boot/Makefile linux-2.6.18-xen.hg/arch/i386/boot/Makefile
---- linux-2.6.18/arch/i386/boot/Makefile	2006-09-20 05:42:06.000000000 +0200
-+++ linux-2.6.18-xen.hg/arch/i386/boot/Makefile	2007-12-23 11:14:54.372518519 +0100
-@@ -26,7 +26,7 @@
- #RAMDISK := -DRAMDISK=512
- 
- targets		:= vmlinux.bin bootsect bootsect.o \
--		   setup setup.o zImage bzImage
-+		   setup setup.o zImage bzImage vmlinuz vmlinux-stripped
- subdir- 	:= compressed
- 
- hostprogs-y	:= tools/build
-@@ -133,5 +133,13 @@
- 	cp System.map $(INSTALL_PATH)/
- 	if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
- 
-+$(obj)/vmlinuz: $(obj)/vmlinux-stripped FORCE
-+	$(call if_changed,gzip)
-+	@echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
-+
-+$(obj)/vmlinux-stripped: OBJCOPYFLAGS := -g --strip-unneeded
-+$(obj)/vmlinux-stripped: vmlinux FORCE
-+	$(call if_changed,objcopy)
-+
- install:
- 	sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
-diff -burN --exclude .hg --exclude .hgtags linux-2.6.18/arch/i386/Kconfig linux-2.6.18-xen.hg/arch/i386/Kconfig
---- linux-2.6.18/arch/i386/Kconfig	2006-09-20 05:42:06.000000000 +0200
-+++ linux-2.6.18-xen.hg/arch/i386/Kconfig	2007-12-23 11:14:54.369185012 +0100
+--- linux-2.6.18.8/Documentation/i2c/busses/i2c-i801	2006-09-20 06:42:06.000000000 +0300
++++ linux-2.6.18-xen.hg/Documentation/i2c/busses/i2c-i801	2008-05-19 00:32:37.654858195 +0300
+@@ -10,6 +10,11 @@
+   * Intel 6300ESB
+   * Intel 82801FB/FR/FW/FRW (ICH6)
+   * Intel ICH7
++  * Intel 82801G (ICH7)
++  * Intel 82801H (ICH9)
++  * Intel 82801I (ICH9)
++  * Intel Tolapai
++  * Intel ICH10
+     Datasheets: Publicly available at the Intel website
+ 
+ Authors: 
+--- linux-2.6.18.8/MAINTAINERS	2006-09-20 06:42:06.000000000 +0300
++++ linux-2.6.18-xen.hg/MAINTAINERS	2008-05-19 00:32:43.775210968 +0300
+@@ -2558,6 +2558,13 @@
+ L:	linux-ia64 at vger.kernel.org
+ S:	Supported
+ 
++SFC NETWORK DRIVER
++P:	Steve Hodgson
++P:	Ben Hutchings
++P:	Robert Stonehouse
++M:	linux-net-drivers at solarflare.com
++S:	Supported
++
+ SGI VISUAL WORKSTATION 320 AND 540
+ P:	Andrey Panin
+ M:	pazke at donpac.ru
+--- linux-2.6.18.8/arch/i386/Kconfig	2006-09-20 06:42:06.000000000 +0300
++++ linux-2.6.18-xen.hg/arch/i386/Kconfig	2008-05-19 00:33:01.816250845 +0300
 @@ -16,6 +16,7 @@
  
  config GENERIC_TIME
@@ -35,12 +38,13 @@
  	default y
  
  config LOCKDEP_SUPPORT
-@@ -103,6 +104,15 @@
+@@ -103,6 +104,16 @@
  	help
  	  Choose this option if your computer is a standard PC or compatible.
  
 +config X86_XEN
 +	bool "Xen-compatible"
++	select XEN
 +	select X86_UP_APIC if !SMP && XEN_PRIVILEGED_GUEST
 +	select X86_UP_IOAPIC if !SMP && XEN_PRIVILEGED_GUEST
 +	select SWIOTLB
@@ -51,7 +55,7 @@
  config X86_ELAN
  	bool "AMD Elan"
  	help
-@@ -213,6 +223,7 @@
+@@ -213,6 +224,7 @@
  
  config HPET_TIMER
  	bool "HPET Timer Support"
@@ -59,7 +63,7 @@
  	help
  	  This enables the use of the HPET for the kernel's internal timer.
  	  HPET is the next generation timer replacing legacy 8254s.
-@@ -263,7 +274,7 @@
+@@ -263,7 +275,7 @@
  
  config X86_UP_APIC
  	bool "Local APIC support on uniprocessors"
@@ -68,7 +72,7 @@
  	help
  	  A local APIC (Advanced Programmable Interrupt Controller) is an
  	  integrated interrupt controller in the CPU. If you have a single-CPU
-@@ -288,12 +299,12 @@
+@@ -288,12 +300,12 @@
  
  config X86_LOCAL_APIC
  	bool
@@ -83,7 +87,7 @@
  	default y
  
  config X86_VISWS_APIC
-@@ -303,7 +314,7 @@
+@@ -303,7 +315,7 @@
  
  config X86_MCE
  	bool "Machine Check Exception"
@@ -92,7 +96,7 @@
  	---help---
  	  Machine Check Exception support allows the processor to notify the
  	  kernel if it detects a problem (e.g. overheating, component failure).
-@@ -402,6 +413,7 @@
+@@ -402,6 +414,7 @@
  
  config MICROCODE
  	tristate "/dev/cpu/microcode - Intel IA32 CPU microcode support"
@@ -100,7 +104,7 @@
  	---help---
  	  If you say Y here and also to "/dev file system support" in the
  	  'File systems' section, you will be able to update the microcode on
-@@ -434,6 +446,10 @@
+@@ -434,6 +447,10 @@
  	  with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
  	  /dev/cpu/31/cpuid.
  
@@ -111,7 +115,7 @@
  source "drivers/firmware/Kconfig"
  
  choice
-@@ -616,6 +632,7 @@
+@@ -616,6 +633,7 @@
  
  config MATH_EMULATION
  	bool "Math emulation"
@@ -119,7 +123,7 @@
  	---help---
  	  Linux can emulate a math coprocessor (used for floating point
  	  operations) if you don't have one. 486DX and Pentium processors have
-@@ -641,6 +658,8 @@
+@@ -641,6 +659,8 @@
  
  config MTRR
  	bool "MTRR (Memory Type Range Register) support"
@@ -128,7 +132,7 @@
  	---help---
  	  On Intel P6 family processors (Pentium Pro, Pentium II and later)
  	  the Memory Type Range Registers (MTRRs) may be used to control
-@@ -675,7 +694,7 @@
+@@ -675,7 +695,7 @@
  
  config EFI
  	bool "Boot from EFI support"
@@ -137,7 +141,7 @@
  	default n
  	---help---
  	This enables the the kernel to boot on EFI platforms using
-@@ -693,7 +712,7 @@
+@@ -693,7 +713,7 @@
  
  config IRQBALANCE
   	bool "Enable kernel irq balancing"
@@ -146,7 +150,7 @@
  	default y
  	help
   	  The default yes will allow the kernel to do irq load balancing.
-@@ -741,7 +760,7 @@
+@@ -741,7 +761,7 @@
  
  config KEXEC
  	bool "kexec system call (EXPERIMENTAL)"
@@ -155,7 +159,7 @@
  	help
  	  kexec is a system call that implements the ability to shutdown your
  	  current kernel, and to start another kernel.  It is like a reboot
-@@ -793,6 +812,7 @@
+@@ -793,6 +813,7 @@
  
  config COMPAT_VDSO
  	bool "Compat VDSO support"
@@ -163,7 +167,7 @@
  	default y
  	help
  	  Map the VDSO to the predictable old-style address too.
-@@ -810,18 +830,18 @@
+@@ -810,18 +831,18 @@
  	depends on HIGHMEM
  
  menu "Power management options (ACPI, APM)"
@@ -186,7 +190,7 @@
  	---help---
  	  APM is a BIOS specification for saving power using several different
  	  techniques. This is mostly useful for battery powered laptops with
-@@ -1006,6 +1026,7 @@
+@@ -1006,6 +1027,7 @@
  
  config PCI_GOBIOS
  	bool "BIOS"
@@ -194,7 +198,7 @@
  
  config PCI_GOMMCONFIG
  	bool "MMConfig"
-@@ -1013,6 +1034,13 @@
+@@ -1013,6 +1035,13 @@
  config PCI_GODIRECT
  	bool "Direct"
  
@@ -208,7 +212,7 @@
  config PCI_GOANY
  	bool "Any"
  
-@@ -1020,7 +1048,7 @@
+@@ -1020,7 +1049,7 @@
  
  config PCI_BIOS
  	bool
@@ -217,13 +221,14 @@
  	default y
  
  config PCI_DIRECT
-@@ -1033,6 +1061,18 @@
+@@ -1033,6 +1062,19 @@
  	depends on PCI && ACPI && (PCI_GOMMCONFIG || PCI_GOANY)
  	default y
  
 +config XEN_PCIDEV_FRONTEND
 +	bool
 +	depends on PCI && X86_XEN && (PCI_GOXEN_FE || PCI_GOANY)
++	select HOTPLUG
 +	default y
 +
 +config XEN_PCIDEV_FE_DEBUG
@@ -236,7 +241,7 @@
  source "drivers/pci/pcie/Kconfig"
  
  source "drivers/pci/Kconfig"
-@@ -1043,7 +1083,7 @@
+@@ -1043,7 +1085,7 @@
  
  config ISA
  	bool "ISA support"
@@ -245,7 +250,7 @@
  	help
  	  Find out whether you have ISA slots on your motherboard.  ISA is the
  	  name of a bus system, i.e. the way the CPU talks to the other stuff
-@@ -1070,7 +1110,7 @@
+@@ -1070,7 +1112,7 @@
  source "drivers/eisa/Kconfig"
  
  config MCA
@@ -254,7 +259,7 @@
  	default y if X86_VOYAGER
  	help
  	  MicroChannel Architecture is found in some IBM PS/2 machines and
-@@ -1146,6 +1186,8 @@
+@@ -1146,6 +1188,8 @@
  
  source "crypto/Kconfig"
  
@@ -263,7 +268,7 @@
  source "lib/Kconfig"
  
  #
-@@ -1171,7 +1213,7 @@
+@@ -1171,7 +1215,7 @@
  
  config X86_HT
  	bool
@@ -272,10 +277,13 @@
  	default y
  
  config X86_BIOS_REBOOT
-@@ -1184,6 +1226,16 @@
+@@ -1182,6 +1226,17 @@
+ config X86_TRAMPOLINE
+ 	bool
  	depends on X86_SMP || (X86_VOYAGER && SMP)
- 	default y
- 
++	depends on !XEN
++	default y
++
 +config X86_NO_TSS
 +	bool
 +	depends on X86_XEN
@@ -284,14 +292,11 @@
 +config X86_NO_IDT
 +	bool
 +	depends on X86_XEN
-+	default y
-+
- config KTIME_SCALAR
- 	bool
  	default y
-diff -burN --exclude .hg --exclude .hgtags linux-2.6.18/arch/i386/Kconfig.cpu linux-2.6.18-xen.hg/arch/i386/Kconfig.cpu
---- linux-2.6.18/arch/i386/Kconfig.cpu	2007-12-23 11:26:51.000120088 +0100
-+++ linux-2.6.18-xen.hg/arch/i386/Kconfig.cpu	2007-12-23 11:14:54.369185012 +0100
+ 
+ config KTIME_SCALAR
+--- linux-2.6.18.8/arch/i386/Kconfig.cpu	2008-05-19 00:42:33.777222817 +0300
++++ linux-2.6.18-xen.hg/arch/i386/Kconfig.cpu	2008-05-19 00:33:01.816250845 +0300
 @@ -252,7 +252,7 @@
  
  config X86_F00F_BUG
@@ -308,9 +313,8 @@
 -	depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MGEODEGX1 || MGEODE_LX) && !X86_NUMAQ
 +	depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MGEODEGX1 || MGEODE_LX) && !X86_NUMAQ && !X86_XEN
  	default y
-diff -burN --exclude .hg --exclude .hgtags linux-2.6.18/arch/i386/Kconfig.debug linux-2.6.18-xen.hg/arch/i386/Kconfig.debug
---- linux-2.6.18/arch/i386/Kconfig.debug	2006-09-20 05:42:06.000000000 +0200
-+++ linux-2.6.18-xen.hg/arch/i386/Kconfig.debug	2007-12-23 11:14:54.369185012 +0100
+--- linux-2.6.18.8/arch/i386/Kconfig.debug	2006-09-20 06:42:06.000000000 +0300
++++ linux-2.6.18-xen.hg/arch/i386/Kconfig.debug	2008-05-19 00:33:01.864253612 +0300
 @@ -79,6 +79,7 @@
  config DOUBLEFAULT
  	default y
@@ -319,9 +323,105 @@
  	help
            This option allows trapping of rare doublefault exceptions that
            would otherwise cause a system to silently reboot. Disabling this
-diff -burN --exclude .hg --exclude .hgtags linux-2.6.18/arch/i386/kernel/acpi/boot-xen.c linux-2.6.18-xen.hg/arch/i386/kernel/acpi/boot-xen.c
---- linux-2.6.18/arch/i386/kernel/acpi/boot-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-xen.hg/arch/i386/kernel/acpi/boot-xen.c	2007-12-23 11:14:54.382519030 +0100
+--- linux-2.6.18.8/arch/i386/Makefile	2006-09-20 06:42:06.000000000 +0300
++++ linux-2.6.18-xen.hg/arch/i386/Makefile	2008-05-19 00:33:01.868253842 +0300
+@@ -71,6 +71,10 @@
+ mflags-$(CONFIG_X86_SUMMIT) := -Iinclude/asm-i386/mach-summit
+ mcore-$(CONFIG_X86_SUMMIT)  := mach-default
+ 
++# Xen subarch support
++mflags-$(CONFIG_X86_XEN)	:= -Iinclude/asm-i386/mach-xen
++mcore-$(CONFIG_X86_XEN)		:= mach-xen
++
+ # generic subarchitecture
+ mflags-$(CONFIG_X86_GENERICARCH) := -Iinclude/asm-i386/mach-generic
+ mcore-$(CONFIG_X86_GENERICARCH) := mach-default
+@@ -102,9 +106,20 @@
+ 
+ boot := arch/i386/boot
+ 
+-PHONY += zImage bzImage compressed zlilo bzlilo \
++PHONY += zImage bzImage vmlinuz compressed zlilo bzlilo \
+          zdisk bzdisk fdimage fdimage144 fdimage288 isoimage install
+ 
++ifdef CONFIG_XEN
++CPPFLAGS := -D__XEN_INTERFACE_VERSION__=$(CONFIG_XEN_INTERFACE_VERSION) \
++	-Iinclude$(if $(KBUILD_SRC),2)/asm/mach-xen $(CPPFLAGS)
++all: vmlinuz
++
++# KBUILD_IMAGE specifies the target image being built
++KBUILD_IMAGE := $(boot)/vmlinuz
++
++vmlinuz: vmlinux
++	$(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
++else
+ all: bzImage
+ 
+ # KBUILD_IMAGE specify target image being built
+@@ -124,6 +139,7 @@
+ 
+ fdimage fdimage144 fdimage288 isoimage: vmlinux
+ 	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
++endif
+ 
+ install:
+ 	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
+--- linux-2.6.18.8/arch/i386/boot/Makefile	2006-09-20 06:42:06.000000000 +0300
++++ linux-2.6.18-xen.hg/arch/i386/boot/Makefile	2008-05-19 00:33:01.952258684 +0300
+@@ -26,7 +26,7 @@
+ #RAMDISK := -DRAMDISK=512
+ 
+ targets		:= vmlinux.bin bootsect bootsect.o \
+-		   setup setup.o zImage bzImage
++		   setup setup.o zImage bzImage vmlinuz vmlinux-stripped
+ subdir- 	:= compressed
+ 
+ hostprogs-y	:= tools/build
+@@ -133,5 +133,13 @@
+ 	cp System.map $(INSTALL_PATH)/
+ 	if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
+ 
++$(obj)/vmlinuz: $(obj)/vmlinux-stripped FORCE
++	$(call if_changed,gzip)
++	@echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
++
++$(obj)/vmlinux-stripped: OBJCOPYFLAGS := -g --strip-unneeded
++$(obj)/vmlinux-stripped: vmlinux FORCE
++	$(call if_changed,objcopy)
++
+ install:
+ 	sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
+--- linux-2.6.18.8/arch/i386/kernel/Makefile	2006-09-20 06:42:06.000000000 +0300
++++ linux-2.6.18-xen.hg/arch/i386/kernel/Makefile	2008-05-19 00:33:02.540292579 +0300
+@@ -43,6 +43,7 @@
+ EXTRA_AFLAGS   := -traditional
+ 
+ obj-$(CONFIG_SCx200)		+= scx200.o
++obj-$(CONFIG_XEN)		+= fixup.o
+ 
+ # vsyscall.o contains the vsyscall DSO images as __initdata.
+ # We must build both images before we can assemble it.
+@@ -80,5 +81,8 @@
+ 			$(obj)/vsyscall-sysenter.o $(obj)/vsyscall-note.o FORCE
+ 	$(call if_changed,syscall)
+ 
++early_printk-y            += ../../x86_64/kernel/early_printk.o
+ k8-y                      += ../../x86_64/kernel/k8.o
+ 
++disabled-obj-$(CONFIG_XEN) := i8259.o reboot.o smpboot.o
++%/head.o %/head.s: $(if $(CONFIG_XEN),EXTRA_AFLAGS,dummy) :=
+--- linux-2.6.18.8/arch/i386/kernel/acpi/Makefile	2006-09-20 06:42:06.000000000 +0300
++++ linux-2.6.18-xen.hg/arch/i386/kernel/acpi/Makefile	2008-05-19 00:33:02.540292579 +0300
+@@ -4,5 +4,7 @@
+ 
+ ifneq ($(CONFIG_ACPI_PROCESSOR),)
+ obj-y				+= cstate.o processor.o
++obj-$(CONFIG_XEN)		+= processor_extcntl_xen.o
+ endif
+ 
++disabled-obj-$(CONFIG_XEN)	:= cstate.o wakeup.o
+--- linux-2.6.18.8/arch/i386/kernel/acpi/boot-xen.c	1970-01-01 03:00:00.000000000 +0300
++++ linux-2.6.18-xen.hg/arch/i386/kernel/acpi/boot-xen.c	2008-05-19 00:33:02.560293731 +0300
 @@ -0,0 +1,1168 @@
 +/*
 + *  boot.c - Architecture-Specific Low-Level ACPI Boot Support
@@ -1491,18 +1591,268 @@
 +
 +	return 0;
 +}
-diff -burN --exclude .hg --exclude .hgtags linux-2.6.18/arch/i386/kernel/acpi/Makefile linux-2.6.18-xen.hg/arch/i386/kernel/acpi/Makefile
---- linux-2.6.18/arch/i386/kernel/acpi/Makefile	2006-09-20 05:42:06.000000000 +0200
-+++ linux-2.6.18-xen.hg/arch/i386/kernel/acpi/Makefile	2007-12-23 11:14:54.382519030 +0100
-@@ -6,3 +6,4 @@
- obj-y				+= cstate.o processor.o
- endif
+--- linux-2.6.18.8/arch/i386/kernel/acpi/processor.c	2006-09-20 06:42:06.000000000 +0300
++++ linux-2.6.18-xen.hg/arch/i386/kernel/acpi/processor.c	2008-05-19 00:33:02.676300418 +0300
+@@ -62,7 +62,18 @@
+ /* Initialize _PDC data based on the CPU vendor */
+ void arch_acpi_processor_init_pdc(struct acpi_processor *pr)
+ {
++#ifdef CONFIG_XEN
++	/* 
++	 * As a work-around, just use cpu0's cpuinfo for all processors.
++	 * Further work is required to expose xen hypervisor interface of
++	 * getting physical cpuinfo to dom0 kernel and then
++	 * arch_acpi_processor_init_pdc can set _PDC parameters according
++	 * to Xen's phys information.
++	 */
++	unsigned int cpu = 0;
++#else
+ 	unsigned int cpu = pr->id;
++#endif /* CONFIG_XEN */
+ 	struct cpuinfo_x86 *c = cpu_data + cpu;
  
-+disabled-obj-$(CONFIG_XEN)	:= cstate.o wakeup.o
-diff -burN --exclude .hg --exclude .hgtags linux-2.6.18/arch/i386/kernel/acpi/sleep-xen.c linux-2.6.18-xen.hg/arch/i386/kernel/acpi/sleep-xen.c
---- linux-2.6.18/arch/i386/kernel/acpi/sleep-xen.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.18-xen.hg/arch/i386/kernel/acpi/sleep-xen.c	2007-12-23 11:14:54.385852540 +0100
-@@ -0,0 +1,134 @@
+ 	pr->pdc = NULL;
+--- linux-2.6.18.8/arch/i386/kernel/acpi/processor_extcntl_xen.c	1970-01-01 03:00:00.000000000 +0300
++++ linux-2.6.18-xen.hg/arch/i386/kernel/acpi/processor_extcntl_xen.c	2008-05-19 00:33:02.676300418 +0300
+@@ -0,0 +1,235 @@
++/*
++ * processor_extcntl_xen.c - interface to notify Xen
++ *
++ *  Copyright (C) 2008, Intel corporation
++ *
++ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
++ *
++ *  This program is free software; you can redistribute it and/or modify
++ *  it under the terms of the GNU General Public License as published by
++ *  the Free Software Foundation; either version 2 of the License, or (at
++ *  your option) any later version.
++ *
++ *  This program is distributed in the hope that it will be useful, but
++ *  WITHOUT ANY WARRANTY; without even the implied warranty of
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ *  General Public License for more details.
++ *
++ *  You should have received a copy of the GNU General Public License along
++ *  with this program; if not, write to the Free Software Foundation, Inc.,
++ *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
++ *
++ */
++
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/types.h>
++#include <linux/acpi.h>
++#include <linux/pm.h>
++#include <linux/cpu.h>
++
++#include <linux/cpufreq.h>
++#include <acpi/processor.h>
++#include <asm/hypercall.h>
++
++static int xen_processor_pmbits;
++static int __init set_xen_processor_pmbits(char *str)
++{
++	get_option(&str, &xen_processor_pmbits);
++
++	return 1;
++}
++__setup("xen_processor_pmbits=", set_xen_processor_pmbits);
++EXPORT_SYMBOL(xen_processor_pmbits);
++
++static int xen_cx_notifier(struct acpi_processor *pr, int action)
++{
++	int ret, count = 0, i;
++	xen_platform_op_t op = {
++		.cmd			= XENPF_set_processor_pminfo,
++		.interface_version	= XENPF_INTERFACE_VERSION,
++		.u.set_pminfo.id	= pr->acpi_id,
++		.u.set_pminfo.type	= XEN_PM_CX,
++	};
++	struct xen_processor_cx *data, *buf;
++	struct acpi_processor_cx *cx;
++
++	if (action == PROCESSOR_PM_CHANGE)
++		return -EINVAL;
++
++	/* Convert to Xen defined structure and hypercall */
++	buf = kzalloc(pr->power.count * sizeof(struct xen_processor_cx),
++			GFP_KERNEL);
++	if (!buf)
++		return -ENOMEM;
++
++	data = buf;
++	for (i = 1; i <= pr->power.count; i++) {
++		cx = &pr->power.states[i];
++		/* Skip invalid cstate entry */
++		if (!cx->valid)
++			continue;
++
++		data->type = cx->type;
++		data->latency = cx->latency;
++		data->power = cx->power;
++		data->reg.space_id = cx->reg.space_id;
++		data->reg.bit_width = cx->reg.bit_width;
++		data->reg.bit_offset = cx->reg.bit_offset;
++		data->reg.access_size = cx->reg.reserved;
++		data->reg.address = cx->reg.address;
++
++		/* Get dependency relationships */
++		if (cx->csd_count) {
++			printk("Wow! _CSD is found. Not support for now!\n");
++			kfree(buf);
++			return -EINVAL;
++		} else {
++			data->dpcnt = 0;
++			set_xen_guest_handle(data->dp, NULL);
++		}
++
++		data++;
++		count++;
++	}
++
++	if (!count) {
++		printk("No available Cx info for cpu %d\n", pr->acpi_id);
++		kfree(buf);
++		return -EINVAL;
++	}
++
++	op.u.set_pminfo.power.count = count;
++	op.u.set_pminfo.power.flags.bm_control = pr->flags.bm_control;
++	op.u.set_pminfo.power.flags.bm_check = pr->flags.bm_check;
++	op.u.set_pminfo.power.flags.has_cst = pr->flags.has_cst;
++	op.u.set_pminfo.power.flags.power_setup_done = pr->flags.power_setup_done;
++
++	set_xen_guest_handle(op.u.set_pminfo.power.states, buf);
++	ret = HYPERVISOR_platform_op(&op);
++	kfree(buf);
++	return ret;
++}
++
++static void convert_pct_reg(struct xen_pct_register *xpct,
++	struct acpi_pct_register *apct)
++{
++	xpct->descriptor = apct->descriptor;
++	xpct->length     = apct->length;
++	xpct->space_id   = apct->space_id;
++	xpct->bit_width  = apct->bit_width;
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/kernel-xen-xen.patch?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list