diff options
Diffstat (limited to 'arch/ia64')
108 files changed, 409 insertions, 5638 deletions
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 7740ab10a17..2f3abcf8f6b 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig @@ -6,6 +6,8 @@ menu "Processor type and features"  config IA64  	bool +	select ARCH_MIGHT_HAVE_PC_PARPORT +	select ARCH_MIGHT_HAVE_PC_SERIO  	select PCI if (!IA64_HP_SIM)  	select ACPI if (!IA64_HP_SIM)  	select PM if (!IA64_HP_SIM) @@ -19,6 +21,7 @@ config IA64  	select HAVE_FUNCTION_TRACER  	select HAVE_DMA_ATTRS  	select HAVE_KVM +	select TTY  	select HAVE_ARCH_TRACEHOOK  	select HAVE_DMA_API_DEBUG  	select HAVE_MEMBLOCK @@ -29,6 +32,7 @@ config IA64  	select GENERIC_IRQ_PROBE  	select GENERIC_PENDING_IRQ if SMP  	select GENERIC_IRQ_SHOW +	select GENERIC_IRQ_LEGACY  	select ARCH_WANT_OPTIONAL_GPIOLIB  	select ARCH_HAVE_NMI_SAFE_CMPXCHG  	select GENERIC_IOMAP @@ -42,6 +46,7 @@ config IA64  	select HAVE_MOD_ARCH_SPECIFIC  	select MODULES_USE_ELF_RELA  	select ARCH_USE_CMPXCHG_LOCKREF +	select HAVE_ARCH_AUDITSYSCALL  	default y  	help  	  The Itanium Processor Family is Intel's 64-bit successor to @@ -103,6 +108,7 @@ config HAVE_SETUP_PER_CPU_AREA  config DMI  	bool  	default y +	select DMI_SCAN_MACHINE_NON_EFI_FALLBACK  config EFI  	bool @@ -146,9 +152,6 @@ config PARAVIRT  	  over full virtualization.  However, when run without a hypervisor  	  the kernel is theoretically slower and slightly larger. - -source "arch/ia64/xen/Kconfig" -  endif  choice @@ -174,7 +177,6 @@ config IA64_GENERIC  	  SGI-SN2		For SGI Altix systems  	  SGI-UV		For SGI UV systems  	  Ski-simulator		For the HP simulator <http://www.hpl.hp.com/research/linux/ski/> -	  Xen-domU		For xen domU system  	  If you don't know what to do, choose "generic". @@ -230,14 +232,6 @@ config IA64_HP_SIM  	bool "Ski-simulator"  	select SWIOTLB -config IA64_XEN_GUEST -	bool "Xen guest" -	select SWIOTLB -	depends on XEN -	help -	  Build a kernel that runs on Xen guest domain. At this moment only -	  16KB page size in supported. -  endchoice  choice @@ -343,7 +337,6 @@ config FORCE_MAX_ZONEORDER  config SMP  	bool "Symmetric multi-processing support" -	select USE_GENERIC_SMP_HELPERS  	help  	  This enables support for systems with more than one CPU. If you have  	  a system with only one CPU, say N.  If you have a system with more diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile index be7bfa12b70..f37238f45bc 100644 --- a/arch/ia64/Makefile +++ b/arch/ia64/Makefile @@ -51,11 +51,9 @@ core-$(CONFIG_IA64_DIG_VTD) 	+= arch/ia64/dig/  core-$(CONFIG_IA64_GENERIC) 	+= arch/ia64/dig/  core-$(CONFIG_IA64_HP_ZX1)	+= arch/ia64/dig/  core-$(CONFIG_IA64_HP_ZX1_SWIOTLB) += arch/ia64/dig/ -core-$(CONFIG_IA64_XEN_GUEST)	+= arch/ia64/dig/  core-$(CONFIG_IA64_SGI_SN2)	+= arch/ia64/sn/  core-$(CONFIG_IA64_SGI_UV)	+= arch/ia64/uv/  core-$(CONFIG_KVM) 		+= arch/ia64/kvm/ -core-$(CONFIG_XEN)		+= arch/ia64/xen/  drivers-$(CONFIG_PCI)		+= arch/ia64/pci/  drivers-$(CONFIG_IA64_HP_SIM)	+= arch/ia64/hp/sim/ diff --git a/arch/ia64/configs/bigsur_defconfig b/arch/ia64/configs/bigsur_defconfig index cf5993f05d4..4c4ac163c60 100644 --- a/arch/ia64/configs/bigsur_defconfig +++ b/arch/ia64/configs/bigsur_defconfig @@ -75,7 +75,6 @@ CONFIG_SND_PCM_OSS=m  CONFIG_SND_CS4281=m  CONFIG_USB_HIDDEV=y  CONFIG_USB=m -CONFIG_USB_DEVICEFS=y  CONFIG_USB_MON=m  CONFIG_USB_UHCI_HCD=m  CONFIG_USB_ACM=m diff --git a/arch/ia64/configs/generic_defconfig b/arch/ia64/configs/generic_defconfig index efbd2929aeb..e8ed3ae70aa 100644 --- a/arch/ia64/configs/generic_defconfig +++ b/arch/ia64/configs/generic_defconfig @@ -25,14 +25,13 @@ CONFIG_KEXEC=y  CONFIG_CRASH_DUMP=y  CONFIG_EFI_VARS=y  CONFIG_BINFMT_MISC=m -CONFIG_ACPI_PROCFS=y  CONFIG_ACPI_BUTTON=m  CONFIG_ACPI_FAN=m  CONFIG_ACPI_DOCK=y  CONFIG_ACPI_PROCESSOR=m -CONFIG_ACPI_CONTAINER=m +CONFIG_ACPI_CONTAINER=y  CONFIG_HOTPLUG_PCI=y -CONFIG_HOTPLUG_PCI_ACPI=m +CONFIG_HOTPLUG_PCI_ACPI=y  CONFIG_PACKET=y  CONFIG_UNIX=y  CONFIG_INET=y @@ -144,7 +143,6 @@ CONFIG_HID_SAMSUNG=m  CONFIG_HID_SONY=m  CONFIG_HID_SUNPLUS=m  CONFIG_USB=m -CONFIG_USB_DEVICEFS=y  CONFIG_USB_MON=m  CONFIG_USB_EHCI_HCD=m  CONFIG_USB_OHCI_HCD=m diff --git a/arch/ia64/configs/gensparse_defconfig b/arch/ia64/configs/gensparse_defconfig index f64980dd20c..d663efd1e4d 100644 --- a/arch/ia64/configs/gensparse_defconfig +++ b/arch/ia64/configs/gensparse_defconfig @@ -126,7 +126,6 @@ CONFIG_SND_CS46XX=m  CONFIG_SND_EMU10K1=m  CONFIG_SND_FM801=m  CONFIG_USB=m -CONFIG_USB_DEVICEFS=y  CONFIG_USB_MON=m  CONFIG_USB_EHCI_HCD=m  CONFIG_USB_OHCI_HCD=m diff --git a/arch/ia64/configs/tiger_defconfig b/arch/ia64/configs/tiger_defconfig index 0f4e9e41f13..c8a3f40e77f 100644 --- a/arch/ia64/configs/tiger_defconfig +++ b/arch/ia64/configs/tiger_defconfig @@ -26,7 +26,6 @@ CONFIG_IA64_PALINFO=y  CONFIG_KEXEC=y  CONFIG_EFI_VARS=y  CONFIG_BINFMT_MISC=m -CONFIG_ACPI_PROCFS=y  CONFIG_ACPI_BUTTON=m  CONFIG_ACPI_FAN=m  CONFIG_ACPI_PROCESSOR=m @@ -103,7 +102,6 @@ CONFIG_DRM_RADEON=m  CONFIG_DRM_MGA=m  CONFIG_DRM_SIS=m  CONFIG_USB=y -CONFIG_USB_DEVICEFS=y  CONFIG_USB_EHCI_HCD=m  CONFIG_USB_OHCI_HCD=m  CONFIG_USB_UHCI_HCD=y diff --git a/arch/ia64/configs/xen_domu_defconfig b/arch/ia64/configs/xen_domu_defconfig deleted file mode 100644 index b025acfde5c..00000000000 --- a/arch/ia64/configs/xen_domu_defconfig +++ /dev/null @@ -1,199 +0,0 @@ -CONFIG_EXPERIMENTAL=y -CONFIG_SYSVIPC=y -CONFIG_POSIX_MQUEUE=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_LOG_BUF_SHIFT=20 -CONFIG_SYSFS_DEPRECATED_V2=y -CONFIG_BLK_DEV_INITRD=y -CONFIG_KALLSYMS_ALL=y -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -CONFIG_MODVERSIONS=y -CONFIG_MODULE_SRCVERSION_ALL=y -# CONFIG_BLK_DEV_BSG is not set -CONFIG_PARAVIRT_GUEST=y -CONFIG_IA64_XEN_GUEST=y -CONFIG_MCKINLEY=y -CONFIG_IA64_CYCLONE=y -CONFIG_SMP=y -CONFIG_NR_CPUS=16 -CONFIG_HOTPLUG_CPU=y -CONFIG_PERMIT_BSP_REMOVE=y -CONFIG_FORCE_CPEI_RETARGET=y -CONFIG_IA64_MCA_RECOVERY=y -CONFIG_PERFMON=y -CONFIG_IA64_PALINFO=y -CONFIG_KEXEC=y -CONFIG_EFI_VARS=y -CONFIG_BINFMT_MISC=m -CONFIG_ACPI_PROCFS=y -CONFIG_ACPI_BUTTON=m -CONFIG_ACPI_FAN=m -CONFIG_ACPI_PROCESSOR=m -CONFIG_ACPI_CONTAINER=m -CONFIG_HOTPLUG_PCI=y -CONFIG_HOTPLUG_PCI_ACPI=m -CONFIG_PACKET=y -CONFIG_UNIX=y -CONFIG_INET=y -CONFIG_IP_MULTICAST=y -CONFIG_ARPD=y -CONFIG_SYN_COOKIES=y -# CONFIG_INET_LRO is not set -# CONFIG_IPV6 is not set -CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" -CONFIG_BLK_DEV_LOOP=m -CONFIG_BLK_DEV_CRYPTOLOOP=m -CONFIG_BLK_DEV_NBD=m -CONFIG_BLK_DEV_RAM=y -CONFIG_IDE=y -CONFIG_BLK_DEV_IDECD=y -CONFIG_BLK_DEV_GENERIC=y -CONFIG_BLK_DEV_CMD64X=y -CONFIG_BLK_DEV_PIIX=y -CONFIG_SCSI=y -CONFIG_BLK_DEV_SD=y -CONFIG_CHR_DEV_ST=m -CONFIG_BLK_DEV_SR=m -CONFIG_CHR_DEV_SG=m -CONFIG_SCSI_SYM53C8XX_2=y -CONFIG_SCSI_QLOGIC_1280=y -CONFIG_MD=y -CONFIG_BLK_DEV_MD=m -CONFIG_MD_LINEAR=m -CONFIG_MD_RAID0=m -CONFIG_MD_RAID1=m -CONFIG_MD_MULTIPATH=m -CONFIG_BLK_DEV_DM=m -CONFIG_DM_CRYPT=m -CONFIG_DM_SNAPSHOT=m -CONFIG_DM_MIRROR=m -CONFIG_DM_ZERO=m -CONFIG_FUSION=y -CONFIG_FUSION_SPI=y -CONFIG_FUSION_FC=y -CONFIG_FUSION_CTL=y -CONFIG_NETDEVICES=y -CONFIG_DUMMY=m -CONFIG_NET_ETHERNET=y -CONFIG_NET_TULIP=y -CONFIG_TULIP=m -CONFIG_NET_PCI=y -CONFIG_NET_VENDOR_INTEL=y -CONFIG_E100=m -CONFIG_E1000=y -CONFIG_TIGON3=y -CONFIG_NETCONSOLE=y -# CONFIG_SERIO_SERPORT is not set -CONFIG_GAMEPORT=m -CONFIG_SERIAL_NONSTANDARD=y -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_SERIAL_8250_NR_UARTS=6 -CONFIG_SERIAL_8250_EXTENDED=y -CONFIG_SERIAL_8250_SHARE_IRQ=y -# CONFIG_HW_RANDOM is not set -CONFIG_EFI_RTC=y -CONFIG_RAW_DRIVER=m -CONFIG_HPET=y -CONFIG_AGP=m -CONFIG_DRM=m -CONFIG_DRM_TDFX=m -CONFIG_DRM_R128=m -CONFIG_DRM_RADEON=m -CONFIG_DRM_MGA=m -CONFIG_DRM_SIS=m -CONFIG_HID_GYRATION=y -CONFIG_HID_NTRIG=y -CONFIG_HID_PANTHERLORD=y -CONFIG_HID_PETALYNX=y -CONFIG_HID_SAMSUNG=y -CONFIG_HID_SONY=y -CONFIG_HID_SUNPLUS=y -CONFIG_HID_TOPSEED=y -CONFIG_USB=y -CONFIG_USB_DEVICEFS=y -CONFIG_USB_EHCI_HCD=m -CONFIG_USB_OHCI_HCD=m -CONFIG_USB_UHCI_HCD=y -CONFIG_USB_STORAGE=m -CONFIG_EXT2_FS=y -CONFIG_EXT2_FS_XATTR=y -CONFIG_EXT2_FS_POSIX_ACL=y -CONFIG_EXT2_FS_SECURITY=y -CONFIG_EXT3_FS=y -CONFIG_EXT3_FS_POSIX_ACL=y -CONFIG_EXT3_FS_SECURITY=y -CONFIG_REISERFS_FS=y -CONFIG_REISERFS_FS_XATTR=y -CONFIG_REISERFS_FS_POSIX_ACL=y -CONFIG_REISERFS_FS_SECURITY=y -CONFIG_XFS_FS=y -CONFIG_AUTOFS_FS=y -CONFIG_AUTOFS4_FS=y -CONFIG_ISO9660_FS=m -CONFIG_JOLIET=y -CONFIG_UDF_FS=m -CONFIG_VFAT_FS=y -CONFIG_NTFS_FS=m -CONFIG_PROC_KCORE=y -CONFIG_TMPFS=y -CONFIG_HUGETLBFS=y -CONFIG_NFS_FS=m -CONFIG_NFS_V3=y -CONFIG_NFS_V4=y -CONFIG_NFSD=m -CONFIG_NFSD_V4=y -CONFIG_SMB_FS=m -CONFIG_SMB_NLS_DEFAULT=y -CONFIG_CIFS=m -CONFIG_PARTITION_ADVANCED=y -CONFIG_SGI_PARTITION=y -CONFIG_EFI_PARTITION=y -CONFIG_NLS_CODEPAGE_437=y -CONFIG_NLS_CODEPAGE_737=m -CONFIG_NLS_CODEPAGE_775=m -CONFIG_NLS_CODEPAGE_850=m -CONFIG_NLS_CODEPAGE_852=m -CONFIG_NLS_CODEPAGE_855=m -CONFIG_NLS_CODEPAGE_857=m -CONFIG_NLS_CODEPAGE_860=m -CONFIG_NLS_CODEPAGE_861=m -CONFIG_NLS_CODEPAGE_862=m -CONFIG_NLS_CODEPAGE_863=m -CONFIG_NLS_CODEPAGE_864=m -CONFIG_NLS_CODEPAGE_865=m -CONFIG_NLS_CODEPAGE_866=m -CONFIG_NLS_CODEPAGE_869=m -CONFIG_NLS_CODEPAGE_936=m -CONFIG_NLS_CODEPAGE_950=m -CONFIG_NLS_CODEPAGE_932=m -CONFIG_NLS_CODEPAGE_949=m -CONFIG_NLS_CODEPAGE_874=m -CONFIG_NLS_ISO8859_8=m -CONFIG_NLS_CODEPAGE_1250=m -CONFIG_NLS_CODEPAGE_1251=m -CONFIG_NLS_ISO8859_1=y -CONFIG_NLS_ISO8859_2=m -CONFIG_NLS_ISO8859_3=m -CONFIG_NLS_ISO8859_4=m -CONFIG_NLS_ISO8859_5=m -CONFIG_NLS_ISO8859_6=m -CONFIG_NLS_ISO8859_7=m -CONFIG_NLS_ISO8859_9=m -CONFIG_NLS_ISO8859_13=m -CONFIG_NLS_ISO8859_14=m -CONFIG_NLS_ISO8859_15=m -CONFIG_NLS_KOI8_R=m -CONFIG_NLS_KOI8_U=m -CONFIG_NLS_UTF8=m -CONFIG_MAGIC_SYSRQ=y -CONFIG_DEBUG_KERNEL=y -CONFIG_DEBUG_MUTEXES=y -# CONFIG_RCU_CPU_STALL_DETECTOR is not set -CONFIG_IA64_GRANULE_16MB=y -CONFIG_CRYPTO_ECB=m -CONFIG_CRYPTO_PCBC=m -CONFIG_CRYPTO_MD5=y -# CONFIG_CRYPTO_ANSI_CPRNG is not set diff --git a/arch/ia64/configs/zx1_defconfig b/arch/ia64/configs/zx1_defconfig index fc7aba07c2b..54bc72eda30 100644 --- a/arch/ia64/configs/zx1_defconfig +++ b/arch/ia64/configs/zx1_defconfig @@ -16,7 +16,6 @@ CONFIG_IA64_PALINFO=y  CONFIG_CRASH_DUMP=y  CONFIG_EFI_VARS=y  CONFIG_BINFMT_MISC=y -CONFIG_ACPI_PROCFS=y  CONFIG_HOTPLUG_PCI=y  CONFIG_HOTPLUG_PCI_ACPI=y  CONFIG_PACKET=y diff --git a/arch/ia64/hp/common/aml_nfw.c b/arch/ia64/hp/common/aml_nfw.c index 916ffe770bc..84715fcbba0 100644 --- a/arch/ia64/hp/common/aml_nfw.c +++ b/arch/ia64/hp/common/aml_nfw.c @@ -23,8 +23,7 @@   */  #include <linux/module.h> -#include <acpi/acpi_bus.h> -#include <acpi/acpi_drivers.h> +#include <linux/acpi.h>  #include <asm/sal.h>  MODULE_AUTHOR("Bjorn Helgaas <bjorn.helgaas@hp.com>"); diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c index d43daf192b2..344387a5540 100644 --- a/arch/ia64/hp/common/sba_iommu.c +++ b/arch/ia64/hp/common/sba_iommu.c @@ -242,7 +242,7 @@ struct ioc {  	struct pci_dev	*sac_only_dev;  }; -static struct ioc *ioc_list; +static struct ioc *ioc_list, *ioc_found;  static int reserve_sba_gart = 1;  static SBA_INLINE void sba_mark_invalid(struct ioc *, dma_addr_t, size_t); @@ -255,7 +255,7 @@ static u64 prefetch_spill_page;  #endif  #ifdef CONFIG_PCI -# define GET_IOC(dev)	(((dev)->bus == &pci_bus_type)						\ +# define GET_IOC(dev)	((dev_is_pci(dev))						\  			 ? ((struct ioc *) PCI_CONTROLLER(to_pci_dev(dev))->iommu) : NULL)  #else  # define GET_IOC(dev)	NULL @@ -1140,11 +1140,13 @@ sba_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,  #ifdef CONFIG_NUMA  	{ +		int node = ioc->node;  		struct page *page; -		page = alloc_pages_exact_node(ioc->node == MAX_NUMNODES ? -		                        numa_node_id() : ioc->node, flags, -		                        get_order(size)); +		if (node == NUMA_NO_NODE) +			node = numa_node_id(); + +		page = alloc_pages_exact_node(node, flags, get_order(size));  		if (unlikely(!page))  			return NULL; @@ -1596,7 +1598,7 @@ static void sba_unmap_sg_attrs(struct device *dev, struct scatterlist *sglist,  *  ***************************************************************/ -static void __init +static void  ioc_iova_init(struct ioc *ioc)  {  	int tcnfg; @@ -1807,20 +1809,13 @@ static struct ioc_iommu ioc_iommu_info[] __initdata = {  	{ SX2000_IOC_ID, "sx2000", NULL },  }; -static struct ioc * __init -ioc_init(unsigned long hpa, void *handle) +static void ioc_init(unsigned long hpa, struct ioc *ioc)  { -	struct ioc *ioc;  	struct ioc_iommu *info; -	ioc = kzalloc(sizeof(*ioc), GFP_KERNEL); -	if (!ioc) -		return NULL; -  	ioc->next = ioc_list;  	ioc_list = ioc; -	ioc->handle = handle;  	ioc->ioc_hpa = ioremap(hpa, 0x1000);  	ioc->func_id = READ_REG(ioc->ioc_hpa + IOC_FUNC_ID); @@ -1861,8 +1856,6 @@ ioc_init(unsigned long hpa, void *handle)  		"%s %d.%d HPA 0x%lx IOVA space %dMb at 0x%lx\n",  		ioc->name, (ioc->rev >> 4) & 0xF, ioc->rev & 0xF,  		hpa, ioc->iov_size >> 20, ioc->ibase); - -	return ioc;  } @@ -1914,7 +1907,7 @@ ioc_show(struct seq_file *s, void *v)  	seq_printf(s, "Hewlett Packard %s IOC rev %d.%d\n",  		ioc->name, ((ioc->rev >> 4) & 0xF), (ioc->rev & 0xF));  #ifdef CONFIG_NUMA -	if (ioc->node != MAX_NUMNODES) +	if (ioc->node != NUMA_NO_NODE)  		seq_printf(s, "NUMA node       : %d\n", ioc->node);  #endif  	seq_printf(s, "IOVA size       : %ld MB\n", ((ioc->pdir_size >> 3) * iovp_size)/(1024*1024)); @@ -1992,7 +1985,7 @@ sba_connect_bus(struct pci_bus *bus)  	if (PCI_CONTROLLER(bus)->iommu)  		return; -	handle = PCI_CONTROLLER(bus)->acpi_handle; +	handle = acpi_device_handle(PCI_CONTROLLER(bus)->companion);  	if (!handle)  		return; @@ -2015,48 +2008,35 @@ sba_connect_bus(struct pci_bus *bus)  	printk(KERN_WARNING "No IOC for PCI Bus %04x:%02x in ACPI\n", pci_domain_nr(bus), bus->number);  } -#ifdef CONFIG_NUMA  static void __init  sba_map_ioc_to_node(struct ioc *ioc, acpi_handle handle)  { +#ifdef CONFIG_NUMA  	unsigned int node; -	int pxm; -	ioc->node = MAX_NUMNODES; - -	pxm = acpi_get_pxm(handle); - -	if (pxm < 0) -		return; - -	node = pxm_to_node(pxm); - -	if (node >= MAX_NUMNODES || !node_online(node)) -		return; +	node = acpi_get_node(handle); +	if (node != NUMA_NO_NODE && !node_online(node)) +		node = NUMA_NO_NODE;  	ioc->node = node; -	return; -} -#else -#define sba_map_ioc_to_node(ioc, handle)  #endif +} -static int __init -acpi_sba_ioc_add(struct acpi_device *device, -		 const struct acpi_device_id *not_used) +static void acpi_sba_ioc_add(struct ioc *ioc)  { -	struct ioc *ioc; +	acpi_handle handle = ioc->handle;  	acpi_status status;  	u64 hpa, length;  	struct acpi_device_info *adi; -	status = hp_acpi_csr_space(device->handle, &hpa, &length); +	ioc_found = ioc->next; +	status = hp_acpi_csr_space(handle, &hpa, &length);  	if (ACPI_FAILURE(status)) -		return 1; +		goto err; -	status = acpi_get_object_info(device->handle, &adi); +	status = acpi_get_object_info(handle, &adi);  	if (ACPI_FAILURE(status)) -		return 1; +		goto err;  	/*  	 * For HWP0001, only SBA appears in ACPI namespace.  It encloses the PCI @@ -2077,13 +2057,13 @@ acpi_sba_ioc_add(struct acpi_device *device,  	if (!iovp_shift)  		iovp_shift = 12; -	ioc = ioc_init(hpa, device->handle); -	if (!ioc) -		return 1; - +	ioc_init(hpa, ioc);  	/* setup NUMA node association */ -	sba_map_ioc_to_node(ioc, device->handle); -	return 0; +	sba_map_ioc_to_node(ioc, handle); +	return; + + err: +	kfree(ioc);  }  static const struct acpi_device_id hp_ioc_iommu_device_ids[] = { @@ -2091,9 +2071,26 @@ static const struct acpi_device_id hp_ioc_iommu_device_ids[] = {  	{"HWP0004", 0},  	{"", 0},  }; + +static int acpi_sba_ioc_attach(struct acpi_device *device, +			       const struct acpi_device_id *not_used) +{ +	struct ioc *ioc; + +	ioc = kzalloc(sizeof(*ioc), GFP_KERNEL); +	if (!ioc) +		return -ENOMEM; + +	ioc->next = ioc_found; +	ioc_found = ioc; +	ioc->handle = device->handle; +	return 1; +} + +  static struct acpi_scan_handler acpi_sba_ioc_handler = {  	.ids	= hp_ioc_iommu_device_ids, -	.attach	= acpi_sba_ioc_add, +	.attach	= acpi_sba_ioc_attach,  };  static int __init acpi_sba_ioc_init_acpi(void) @@ -2128,9 +2125,12 @@ sba_init(void)  #endif  	/* -	 * ioc_list should be populated by the acpi_sba_ioc_handler's .attach() +	 * ioc_found should be populated by the acpi_sba_ioc_handler's .attach()  	 * routine, but that only happens if acpi_scan_init() has already run.  	 */ +	while (ioc_found) +		acpi_sba_ioc_add(ioc_found); +  	if (!ioc_list) {  #ifdef CONFIG_IA64_GENERIC  		/* diff --git a/arch/ia64/include/asm/Kbuild b/arch/ia64/include/asm/Kbuild index a3456f34f67..0da4aa2602a 100644 --- a/arch/ia64/include/asm/Kbuild +++ b/arch/ia64/include/asm/Kbuild @@ -1,6 +1,9 @@  generic-y += clkdev.h  generic-y += exec.h +generic-y += hash.h  generic-y += kvm_para.h +generic-y += mcs_spinlock.h +generic-y += preempt.h  generic-y += trace_clock.h -generic-y += vtime.h
\ No newline at end of file +generic-y += vtime.h diff --git a/arch/ia64/include/asm/acenv.h b/arch/ia64/include/asm/acenv.h new file mode 100644 index 00000000000..3f9eaeec987 --- /dev/null +++ b/arch/ia64/include/asm/acenv.h @@ -0,0 +1,56 @@ +/* + * IA64 specific ACPICA environments and implementation + * + * Copyright (C) 2014, Intel Corporation + *   Author: Lv Zheng <lv.zheng@intel.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef _ASM_IA64_ACENV_H +#define _ASM_IA64_ACENV_H + +#include <asm/intrinsics.h> + +#define COMPILER_DEPENDENT_INT64	long +#define COMPILER_DEPENDENT_UINT64	unsigned long + +/* Asm macros */ + +#ifdef CONFIG_ACPI + +static inline int +ia64_acpi_acquire_global_lock(unsigned int *lock) +{ +	unsigned int old, new, val; +	do { +		old = *lock; +		new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1)); +		val = ia64_cmpxchg4_acq(lock, new, old); +	} while (unlikely (val != old)); +	return (new < 3) ? -1 : 0; +} + +static inline int +ia64_acpi_release_global_lock(unsigned int *lock) +{ +	unsigned int old, new, val; +	do { +		old = *lock; +		new = old & ~0x3; +		val = ia64_cmpxchg4_acq(lock, new, old); +	} while (unlikely (val != old)); +	return old & 0x1; +} + +#define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq)				\ +	((Acq) = ia64_acpi_acquire_global_lock(&facs->global_lock)) + +#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq)				\ +	((Acq) = ia64_acpi_release_global_lock(&facs->global_lock)) + +#endif + +#endif /* _ASM_IA64_ACENV_H */ diff --git a/arch/ia64/include/asm/acpi.h b/arch/ia64/include/asm/acpi.h index faa1bf0da81..75dc59a793d 100644 --- a/arch/ia64/include/asm/acpi.h +++ b/arch/ia64/include/asm/acpi.h @@ -34,57 +34,8 @@  #include <linux/numa.h>  #include <asm/numa.h> -#define COMPILER_DEPENDENT_INT64	long -#define COMPILER_DEPENDENT_UINT64	unsigned long - -/* - * Calling conventions: - * - * ACPI_SYSTEM_XFACE        - Interfaces to host OS (handlers, threads) - * ACPI_EXTERNAL_XFACE      - External ACPI interfaces - * ACPI_INTERNAL_XFACE      - Internal ACPI interfaces - * ACPI_INTERNAL_VAR_XFACE  - Internal variable-parameter list interfaces - */ -#define ACPI_SYSTEM_XFACE -#define ACPI_EXTERNAL_XFACE -#define ACPI_INTERNAL_XFACE -#define ACPI_INTERNAL_VAR_XFACE - -/* Asm macros */ - -#define ACPI_FLUSH_CPU_CACHE() - -static inline int -ia64_acpi_acquire_global_lock (unsigned int *lock) -{ -	unsigned int old, new, val; -	do { -		old = *lock; -		new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1)); -		val = ia64_cmpxchg4_acq(lock, new, old); -	} while (unlikely (val != old)); -	return (new < 3) ? -1 : 0; -} - -static inline int -ia64_acpi_release_global_lock (unsigned int *lock) -{ -	unsigned int old, new, val; -	do { -		old = *lock; -		new = old & ~0x3; -		val = ia64_cmpxchg4_acq(lock, new, old); -	} while (unlikely (val != old)); -	return old & 0x1; -} - -#define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq)				\ -	((Acq) = ia64_acpi_acquire_global_lock(&facs->global_lock)) - -#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq)				\ -	((Acq) = ia64_acpi_release_global_lock(&facs->global_lock)) -  #ifdef	CONFIG_ACPI +extern int acpi_lapic;  #define acpi_disabled 0	/* ACPI always enabled on IA64 */  #define acpi_noirq 0	/* ACPI always enabled on IA64 */  #define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */ @@ -92,7 +43,6 @@ ia64_acpi_release_global_lock (unsigned int *lock)  #endif  #define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */  static inline void disable_acpi(void) { } -static inline void pci_acpi_crs_quirks(void) { }  #ifdef CONFIG_IA64_GENERIC  const char *acpi_get_sysname (void); @@ -111,8 +61,6 @@ static inline const char *acpi_get_sysname (void)  	return "uv";  # elif defined (CONFIG_IA64_DIG)  	return "dig"; -# elif defined (CONFIG_IA64_XEN_GUEST) -	return "xen";  # elif defined(CONFIG_IA64_DIG_VTD)  	return "dig_vtd";  # else diff --git a/arch/ia64/include/asm/atomic.h b/arch/ia64/include/asm/atomic.h index 6e6fe1839f5..0f8bf48dadf 100644 --- a/arch/ia64/include/asm/atomic.h +++ b/arch/ia64/include/asm/atomic.h @@ -15,6 +15,7 @@  #include <linux/types.h>  #include <asm/intrinsics.h> +#include <asm/barrier.h>  #define ATOMIC_INIT(i)		{ (i) } @@ -208,10 +209,4 @@ atomic64_add_negative (__s64 i, atomic64_t *v)  #define atomic64_inc(v)			atomic64_add(1, (v))  #define atomic64_dec(v)			atomic64_sub(1, (v)) -/* Atomic operations are already serializing */ -#define smp_mb__before_atomic_dec()	barrier() -#define smp_mb__after_atomic_dec()	barrier() -#define smp_mb__before_atomic_inc()	barrier() -#define smp_mb__after_atomic_inc()	barrier() -  #endif /* _ASM_IA64_ATOMIC_H */ diff --git a/arch/ia64/include/asm/barrier.h b/arch/ia64/include/asm/barrier.h index 60576e06b6f..a48957c7b44 100644 --- a/arch/ia64/include/asm/barrier.h +++ b/arch/ia64/include/asm/barrier.h @@ -45,13 +45,39 @@  # define smp_rmb()	rmb()  # define smp_wmb()	wmb()  # define smp_read_barrier_depends()	read_barrier_depends() +  #else +  # define smp_mb()	barrier()  # define smp_rmb()	barrier()  # define smp_wmb()	barrier()  # define smp_read_barrier_depends()	do { } while(0) +  #endif +#define smp_mb__before_atomic()	barrier() +#define smp_mb__after_atomic()	barrier() + +/* + * IA64 GCC turns volatile stores into st.rel and volatile loads into ld.acq no + * need for asm trickery! + */ + +#define smp_store_release(p, v)						\ +do {									\ +	compiletime_assert_atomic_type(*p);				\ +	barrier();							\ +	ACCESS_ONCE(*p) = (v);						\ +} while (0) + +#define smp_load_acquire(p)						\ +({									\ +	typeof(*p) ___p1 = ACCESS_ONCE(*p);				\ +	compiletime_assert_atomic_type(*p);				\ +	barrier();							\ +	___p1;								\ +}) +  /*   * XXX check on this ---I suspect what Linus really wants here is   * acquire vs release semantics but we can't discuss this stuff with diff --git a/arch/ia64/include/asm/bitops.h b/arch/ia64/include/asm/bitops.h index c27eccd3334..71e8145243e 100644 --- a/arch/ia64/include/asm/bitops.h +++ b/arch/ia64/include/asm/bitops.h @@ -16,6 +16,7 @@  #include <linux/compiler.h>  #include <linux/types.h>  #include <asm/intrinsics.h> +#include <asm/barrier.h>  /**   * set_bit - Atomically set a bit in memory @@ -65,12 +66,6 @@ __set_bit (int nr, volatile void *addr)  	*((__u32 *) addr + (nr >> 5)) |= (1 << (nr & 31));  } -/* - * clear_bit() has "acquire" semantics. - */ -#define smp_mb__before_clear_bit()	smp_mb() -#define smp_mb__after_clear_bit()	do { /* skip */; } while (0) -  /**   * clear_bit - Clears a bit in memory   * @nr: Bit to clear @@ -78,7 +73,7 @@ __set_bit (int nr, volatile void *addr)   *   * clear_bit() is atomic and may not be reordered.  However, it does   * not contain a memory barrier, so if it is used for locking purposes, - * you should call smp_mb__before_clear_bit() and/or smp_mb__after_clear_bit() + * you should call smp_mb__before_atomic() and/or smp_mb__after_atomic()   * in order to ensure changes are visible on other processors.   */  static __inline__ void diff --git a/arch/ia64/include/asm/dmi.h b/arch/ia64/include/asm/dmi.h index 185d3d18d0e..f365a61f5c7 100644 --- a/arch/ia64/include/asm/dmi.h +++ b/arch/ia64/include/asm/dmi.h @@ -5,8 +5,10 @@  #include <asm/io.h>  /* Use normal IO mappings for DMI */ -#define dmi_ioremap ioremap -#define dmi_iounmap(x,l) iounmap(x) -#define dmi_alloc(l) kzalloc(l, GFP_ATOMIC) +#define dmi_early_remap		ioremap +#define dmi_early_unmap(x, l)	iounmap(x) +#define dmi_remap		ioremap +#define dmi_unmap		iounmap +#define dmi_alloc(l)		kzalloc(l, GFP_ATOMIC)  #endif diff --git a/arch/ia64/include/asm/hw_irq.h b/arch/ia64/include/asm/hw_irq.h index a681d02cb32..029bab36cd9 100644 --- a/arch/ia64/include/asm/hw_irq.h +++ b/arch/ia64/include/asm/hw_irq.h @@ -132,7 +132,6 @@ extern int reserve_irq_vector (int vector);  extern void __setup_vector_irq(int cpu);  extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect);  extern void ia64_native_register_percpu_irq (ia64_vector vec, struct irqaction *action); -extern int check_irq_used (int irq);  extern void destroy_and_reserve_irq (unsigned int irq);  #if defined(CONFIG_SMP) && (defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_DIG)) diff --git a/arch/ia64/include/asm/io.h b/arch/ia64/include/asm/io.h index 74a7cc3293b..0d2bcb37ec3 100644 --- a/arch/ia64/include/asm/io.h +++ b/arch/ia64/include/asm/io.h @@ -424,6 +424,7 @@ extern void __iomem * ioremap(unsigned long offset, unsigned long size);  extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size);  extern void iounmap (volatile void __iomem *addr);  extern void __iomem * early_ioremap (unsigned long phys_addr, unsigned long size); +#define early_memremap(phys_addr, size)        early_ioremap(phys_addr, size)  extern void early_iounmap (volatile void __iomem *addr, unsigned long size);  static inline void __iomem * ioremap_cache (unsigned long phys_addr, unsigned long size)  { diff --git a/arch/ia64/include/asm/irq.h b/arch/ia64/include/asm/irq.h index 91b920fd7d5..820667cbea7 100644 --- a/arch/ia64/include/asm/irq.h +++ b/arch/ia64/include/asm/irq.h @@ -31,4 +31,7 @@ bool is_affinity_mask_valid(const struct cpumask *cpumask);  #define is_affinity_mask_valid is_affinity_mask_valid +int create_irq(void); +void destroy_irq(unsigned int irq); +  #endif /* _ASM_IA64_IRQ_H */ diff --git a/arch/ia64/include/asm/irq_remapping.h b/arch/ia64/include/asm/irq_remapping.h index a8687b1d890..e3b3556e2e1 100644 --- a/arch/ia64/include/asm/irq_remapping.h +++ b/arch/ia64/include/asm/irq_remapping.h @@ -1,4 +1,6 @@  #ifndef __IA64_INTR_REMAPPING_H  #define __IA64_INTR_REMAPPING_H  #define irq_remapping_enabled 0 +#define dmar_alloc_hwirq	create_irq +#define dmar_free_hwirq		destroy_irq  #endif diff --git a/arch/ia64/include/asm/kvm_host.h b/arch/ia64/include/asm/kvm_host.h index 989dd3fe8de..db95f570705 100644 --- a/arch/ia64/include/asm/kvm_host.h +++ b/arch/ia64/include/asm/kvm_host.h @@ -234,10 +234,6 @@ struct kvm_vm_data {  #define KVM_REQ_PTC_G		32  #define KVM_REQ_RESUME		33 -#define KVM_HPAGE_GFN_SHIFT(x)	0 -#define KVM_NR_PAGE_SIZES	1 -#define KVM_PAGES_PER_HPAGE(x)	1 -  struct kvm;  struct kvm_vcpu; @@ -480,7 +476,7 @@ struct kvm_arch {  	struct list_head assigned_dev_head;  	struct iommu_domain *iommu_domain; -	int iommu_flags; +	bool iommu_noncoherent;  	unsigned long irq_sources_bitmap;  	unsigned long irq_states[KVM_IOAPIC_NUM_PINS]; diff --git a/arch/ia64/include/asm/machvec.h b/arch/ia64/include/asm/machvec.h index 2d1ad4b11a8..9c39bdfc2da 100644 --- a/arch/ia64/include/asm/machvec.h +++ b/arch/ia64/include/asm/machvec.h @@ -113,8 +113,6 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *);  #  include <asm/machvec_sn2.h>  # elif defined (CONFIG_IA64_SGI_UV)  #  include <asm/machvec_uv.h> -# elif defined (CONFIG_IA64_XEN_GUEST) -#  include <asm/machvec_xen.h>  # elif defined (CONFIG_IA64_GENERIC)  # ifdef MACHVEC_PLATFORM_HEADER diff --git a/arch/ia64/include/asm/machvec_xen.h b/arch/ia64/include/asm/machvec_xen.h deleted file mode 100644 index 8b8bd0eb392..00000000000 --- a/arch/ia64/include/asm/machvec_xen.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef _ASM_IA64_MACHVEC_XEN_h -#define _ASM_IA64_MACHVEC_XEN_h - -extern ia64_mv_setup_t			dig_setup; -extern ia64_mv_cpu_init_t		xen_cpu_init; -extern ia64_mv_irq_init_t		xen_irq_init; -extern ia64_mv_send_ipi_t		xen_platform_send_ipi; - -/* - * This stuff has dual use! - * - * For a generic kernel, the macros are used to initialize the - * platform's machvec structure.  When compiling a non-generic kernel, - * the macros are used directly. - */ -#define ia64_platform_name			"xen" -#define platform_setup				dig_setup -#define platform_cpu_init			xen_cpu_init -#define platform_irq_init			xen_irq_init -#define platform_send_ipi			xen_platform_send_ipi - -#endif /* _ASM_IA64_MACHVEC_XEN_h */ diff --git a/arch/ia64/include/asm/meminit.h b/arch/ia64/include/asm/meminit.h index 61c7b1750b1..092f1c91b36 100644 --- a/arch/ia64/include/asm/meminit.h +++ b/arch/ia64/include/asm/meminit.h @@ -18,7 +18,6 @@   * 	- crash dumping code reserved region   * 	- Kernel memory map built from EFI memory map   * 	- ELF core header - *	- xen start info if CONFIG_XEN   *   * More could be added if necessary   */ diff --git a/arch/ia64/include/asm/paravirt.h b/arch/ia64/include/asm/paravirt.h index b149b88ea79..b53518a9802 100644 --- a/arch/ia64/include/asm/paravirt.h +++ b/arch/ia64/include/asm/paravirt.h @@ -75,7 +75,6 @@ void *paravirt_get_gate_section(void);  #ifdef CONFIG_PARAVIRT_GUEST  #define PARAVIRT_HYPERVISOR_TYPE_DEFAULT	0 -#define PARAVIRT_HYPERVISOR_TYPE_XEN		1  #ifndef __ASSEMBLY__ diff --git a/arch/ia64/include/asm/pci.h b/arch/ia64/include/asm/pci.h index 80775f55f03..52af5ed9f60 100644 --- a/arch/ia64/include/asm/pci.h +++ b/arch/ia64/include/asm/pci.h @@ -50,12 +50,6 @@ struct pci_dev;  extern unsigned long ia64_max_iommu_merge_mask;  #define PCI_DMA_BUS_IS_PHYS	(ia64_max_iommu_merge_mask == ~0UL) -static inline void -pcibios_penalize_isa_irq (int irq, int active) -{ -	/* We don't do dynamic PCI IRQ allocation */ -} -  #include <asm-generic/pci-dma-compat.h>  #ifdef CONFIG_PCI @@ -95,10 +89,10 @@ struct iospace_resource {  };  struct pci_controller { -	void *acpi_handle; +	struct acpi_device *companion;  	void *iommu;  	int segment; -	int node;		/* nearest node with memory or -1 for global allocation */ +	int node;		/* nearest node with memory or NUMA_NO_NODE for global allocation */  	void *platform_data;  }; diff --git a/arch/ia64/include/asm/pgalloc.h b/arch/ia64/include/asm/pgalloc.h index 96a8d927db2..5767cdfc08d 100644 --- a/arch/ia64/include/asm/pgalloc.h +++ b/arch/ia64/include/asm/pgalloc.h @@ -91,7 +91,10 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long addr)  	if (!pg)  		return NULL;  	page = virt_to_page(pg); -	pgtable_page_ctor(page); +	if (!pgtable_page_ctor(page)) { +		quicklist_free(0, NULL, pg); +		return NULL; +	}  	return page;  } diff --git a/arch/ia64/include/asm/processor.h b/arch/ia64/include/asm/processor.h index e0a899a1a8a..efd1b927ccb 100644 --- a/arch/ia64/include/asm/processor.h +++ b/arch/ia64/include/asm/processor.h @@ -71,6 +71,7 @@  #include <linux/compiler.h>  #include <linux/threads.h>  #include <linux/types.h> +#include <linux/bitops.h>  #include <asm/fpu.h>  #include <asm/page.h> @@ -319,7 +320,7 @@ struct thread_struct {  	regs->loadrs = 0;									\  	regs->r8 = get_dumpable(current->mm);	/* set "don't zap registers" flag */		\  	regs->r12 = new_sp - 16;	/* allocate 16 byte scratch area */			\ -	if (unlikely(!get_dumpable(current->mm))) {							\ +	if (unlikely(get_dumpable(current->mm) != SUID_DUMP_USER)) {	\  		/*										\  		 * Zap scratch regs to avoid leaking bits between processes with different	\  		 * uid/privileges.								\ diff --git a/arch/ia64/include/asm/pvclock-abi.h b/arch/ia64/include/asm/pvclock-abi.h index 44ef9ef8f5b..42b233bedeb 100644 --- a/arch/ia64/include/asm/pvclock-abi.h +++ b/arch/ia64/include/asm/pvclock-abi.h @@ -11,7 +11,7 @@  /*   * These structs MUST NOT be changed.   * They are the ABI between hypervisor and guest OS. - * Both Xen and KVM are using this. + * KVM is using this.   *   * pvclock_vcpu_time_info holds the system time and the tsc timestamp   * of the last update. So the guest can use the tsc delta to get a diff --git a/arch/ia64/include/asm/sync_bitops.h b/arch/ia64/include/asm/sync_bitops.h deleted file mode 100644 index 593c12eeb27..00000000000 --- a/arch/ia64/include/asm/sync_bitops.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef _ASM_IA64_SYNC_BITOPS_H -#define _ASM_IA64_SYNC_BITOPS_H - -/* - * Copyright (C) 2008 Isaku Yamahata <yamahata at valinux co jp> - * - * Based on synch_bitops.h which Dan Magenhaimer wrote. - * - * bit operations which provide guaranteed strong synchronisation - * when communicating with Xen or other guest OSes running on other CPUs. - */ - -static inline void sync_set_bit(int nr, volatile void *addr) -{ -	set_bit(nr, addr); -} - -static inline void sync_clear_bit(int nr, volatile void *addr) -{ -	clear_bit(nr, addr); -} - -static inline void sync_change_bit(int nr, volatile void *addr) -{ -	change_bit(nr, addr); -} - -static inline int sync_test_and_set_bit(int nr, volatile void *addr) -{ -	return test_and_set_bit(nr, addr); -} - -static inline int sync_test_and_clear_bit(int nr, volatile void *addr) -{ -	return test_and_clear_bit(nr, addr); -} - -static inline int sync_test_and_change_bit(int nr, volatile void *addr) -{ -	return test_and_change_bit(nr, addr); -} - -static inline int sync_test_bit(int nr, const volatile void *addr) -{ -	return test_bit(nr, addr); -} - -#define sync_cmpxchg(ptr, old, new)				\ -	((__typeof__(*(ptr)))cmpxchg_acq((ptr), (old), (new))) - -#endif /* _ASM_IA64_SYNC_BITOPS_H */ diff --git a/arch/ia64/include/asm/thread_info.h b/arch/ia64/include/asm/thread_info.h index cade13dd029..5b17418b422 100644 --- a/arch/ia64/include/asm/thread_info.h +++ b/arch/ia64/include/asm/thread_info.h @@ -11,9 +11,6 @@  #include <asm/processor.h>  #include <asm/ptrace.h> -#define PREEMPT_ACTIVE_BIT 30 -#define PREEMPT_ACTIVE	(1 << PREEMPT_ACTIVE_BIT) -  #ifndef __ASSEMBLY__  /* @@ -110,6 +107,7 @@ struct thread_info {  #define TIF_MCA_INIT		18	/* this task is processing MCA or INIT */  #define TIF_DB_DISABLED		19	/* debug trap disabled for fsyscall */  #define TIF_RESTORE_RSE		21	/* user RBS is newer than kernel RBS */ +#define TIF_POLLING_NRFLAG	22	/* idle is polling for TIF_NEED_RESCHED */  #define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)  #define _TIF_SYSCALL_AUDIT	(1 << TIF_SYSCALL_AUDIT) @@ -121,6 +119,7 @@ struct thread_info {  #define _TIF_MCA_INIT		(1 << TIF_MCA_INIT)  #define _TIF_DB_DISABLED	(1 << TIF_DB_DISABLED)  #define _TIF_RESTORE_RSE	(1 << TIF_RESTORE_RSE) +#define _TIF_POLLING_NRFLAG	(1 << TIF_POLLING_NRFLAG)  /* "work to do on user-return" bits */  #define TIF_ALLWORK_MASK	(_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SYSCALL_AUDIT|\ @@ -128,7 +127,6 @@ struct thread_info {  /* like TIF_ALLWORK_BITS but sans TIF_SYSCALL_TRACE or TIF_SYSCALL_AUDIT */  #define TIF_WORK_MASK		(TIF_ALLWORK_MASK&~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT)) -#define TS_POLLING		1 	/* true if in idle loop and not sleeping */  #define TS_RESTORE_SIGMASK	2	/* restore signal mask in do_signal() */  #ifndef __ASSEMBLY__ diff --git a/arch/ia64/include/asm/tlb.h b/arch/ia64/include/asm/tlb.h index bc5efc7c3f3..39d64e0df1d 100644 --- a/arch/ia64/include/asm/tlb.h +++ b/arch/ia64/include/asm/tlb.h @@ -91,18 +91,9 @@ extern struct ia64_tr_entry *ia64_idtrs[NR_CPUS];  #define RR_RID_MASK	0x00000000ffffff00L  #define RR_TO_RID(val) 	((val >> 8) & 0xffffff) -/* - * Flush the TLB for address range START to END and, if not in fast mode, release the - * freed pages that where gathered up to this point. - */  static inline void -ia64_tlb_flush_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long end) +ia64_tlb_flush_mmu_tlbonly(struct mmu_gather *tlb, unsigned long start, unsigned long end)  { -	unsigned long i; -	unsigned int nr; - -	if (!tlb->need_flush) -		return;  	tlb->need_flush = 0;  	if (tlb->fullmm) { @@ -135,6 +126,14 @@ ia64_tlb_flush_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long e  		flush_tlb_range(&vma, ia64_thash(start), ia64_thash(end));  	} +} + +static inline void +ia64_tlb_flush_mmu_free(struct mmu_gather *tlb) +{ +	unsigned long i; +	unsigned int nr; +  	/* lastly, release the freed pages */  	nr = tlb->nr; @@ -144,6 +143,19 @@ ia64_tlb_flush_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long e  		free_page_and_swap_cache(tlb->pages[i]);  } +/* + * Flush the TLB for address range START to END and, if not in fast mode, release the + * freed pages that where gathered up to this point. + */ +static inline void +ia64_tlb_flush_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long end) +{ +	if (!tlb->need_flush) +		return; +	ia64_tlb_flush_mmu_tlbonly(tlb, start, end); +	ia64_tlb_flush_mmu_free(tlb); +} +  static inline void __tlb_alloc_page(struct mmu_gather *tlb)  {  	unsigned long addr = __get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0); @@ -206,6 +218,16 @@ static inline int __tlb_remove_page(struct mmu_gather *tlb, struct page *page)  	return tlb->max - tlb->nr;  } +static inline void tlb_flush_mmu_tlbonly(struct mmu_gather *tlb) +{ +	ia64_tlb_flush_mmu_tlbonly(tlb, tlb->start_addr, tlb->end_addr); +} + +static inline void tlb_flush_mmu_free(struct mmu_gather *tlb) +{ +	ia64_tlb_flush_mmu_free(tlb); +} +  static inline void tlb_flush_mmu(struct mmu_gather *tlb)  {  	ia64_tlb_flush_mmu(tlb, tlb->start_addr, tlb->end_addr); diff --git a/arch/ia64/include/asm/topology.h b/arch/ia64/include/asm/topology.h index a2496e449b7..6437ca21f61 100644 --- a/arch/ia64/include/asm/topology.h +++ b/arch/ia64/include/asm/topology.h @@ -21,7 +21,8 @@  #define PENALTY_FOR_NODE_WITH_CPUS 255  /* - * Distance above which we begin to use zone reclaim + * Nodes within this distance are eligible for reclaim by zone_reclaim() when + * zone_reclaim_mode is enabled.   */  #define RECLAIM_DISTANCE 15 @@ -46,30 +47,6 @@  void build_cpu_to_node_map(void); -#define SD_CPU_INIT (struct sched_domain) {		\ -	.parent			= NULL,			\ -	.child			= NULL,			\ -	.groups			= NULL,			\ -	.min_interval		= 1,			\ -	.max_interval		= 4,			\ -	.busy_factor		= 64,			\ -	.imbalance_pct		= 125,			\ -	.cache_nice_tries	= 2,			\ -	.busy_idx		= 2,			\ -	.idle_idx		= 1,			\ -	.newidle_idx		= 0,			\ -	.wake_idx		= 0,			\ -	.forkexec_idx		= 0,			\ -	.flags			= SD_LOAD_BALANCE	\ -				| SD_BALANCE_NEWIDLE	\ -				| SD_BALANCE_EXEC	\ -				| SD_BALANCE_FORK	\ -				| SD_WAKE_AFFINE,	\ -	.last_balance		= jiffies,		\ -	.balance_interval	= 1,			\ -	.nr_balance_failed	= 0,			\ -} -  #endif /* CONFIG_NUMA */  #ifdef CONFIG_SMP @@ -77,7 +54,6 @@ void build_cpu_to_node_map(void);  #define topology_core_id(cpu)			(cpu_data(cpu)->core_id)  #define topology_core_cpumask(cpu)		(&cpu_core_map[cpu])  #define topology_thread_cpumask(cpu)		(&per_cpu(cpu_sibling_map, cpu)) -#define smt_capable() 				(smp_num_siblings > 1)  #endif  extern void arch_fix_phys_package_id(int num, u32 slot); diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h index afd45e0d552..fb13dc5e8f8 100644 --- a/arch/ia64/include/asm/unistd.h +++ b/arch/ia64/include/asm/unistd.h @@ -11,7 +11,7 @@ -#define NR_syscalls			312 /* length of syscall table */ +#define NR_syscalls			315 /* length of syscall table */  /*   * The following defines stop scripts/checksyscalls.sh from complaining about diff --git a/arch/ia64/include/asm/xen/events.h b/arch/ia64/include/asm/xen/events.h deleted file mode 100644 index baa74c82aa7..00000000000 --- a/arch/ia64/include/asm/xen/events.h +++ /dev/null @@ -1,41 +0,0 @@ -/****************************************************************************** - * arch/ia64/include/asm/xen/events.h - * - * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp> - *                    VA Linux Systems Japan K.K. - * - * 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 - * - */ -#ifndef _ASM_IA64_XEN_EVENTS_H -#define _ASM_IA64_XEN_EVENTS_H - -enum ipi_vector { -	XEN_RESCHEDULE_VECTOR, -	XEN_IPI_VECTOR, -	XEN_CMCP_VECTOR, -	XEN_CPEP_VECTOR, - -	XEN_NR_IPIS, -}; - -static inline int xen_irqs_disabled(struct pt_regs *regs) -{ -	return !(ia64_psr(regs)->i); -} - -#define irq_ctx_init(cpu)	do { } while (0) - -#endif /* _ASM_IA64_XEN_EVENTS_H */ diff --git a/arch/ia64/include/asm/xen/hypercall.h b/arch/ia64/include/asm/xen/hypercall.h deleted file mode 100644 index ed28bcd5bb8..00000000000 --- a/arch/ia64/include/asm/xen/hypercall.h +++ /dev/null @@ -1,265 +0,0 @@ -/****************************************************************************** - * hypercall.h - * - * Linux-specific hypervisor handling. - * - * Copyright (c) 2002-2004, K A Fraser - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation; or, when distributed - * separately from the Linux kernel or incorporated into other - * software packages, subject to the following license: - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this source file (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, modify, - * merge, publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -#ifndef _ASM_IA64_XEN_HYPERCALL_H -#define _ASM_IA64_XEN_HYPERCALL_H - -#include <xen/interface/xen.h> -#include <xen/interface/physdev.h> -#include <xen/interface/sched.h> -#include <asm/xen/xcom_hcall.h> -struct xencomm_handle; -extern unsigned long __hypercall(unsigned long a1, unsigned long a2, -				 unsigned long a3, unsigned long a4, -				 unsigned long a5, unsigned long cmd); - -/* - * Assembler stubs for hyper-calls. - */ - -#define _hypercall0(type, name)					\ -({								\ -	long __res;						\ -	__res = __hypercall(0, 0, 0, 0, 0, __HYPERVISOR_##name);\ -	(type)__res;						\ -}) - -#define _hypercall1(type, name, a1)				\ -({								\ -	long __res;						\ -	__res = __hypercall((unsigned long)a1,			\ -			     0, 0, 0, 0, __HYPERVISOR_##name);	\ -	(type)__res;						\ -}) - -#define _hypercall2(type, name, a1, a2)				\ -({								\ -	long __res;						\ -	__res = __hypercall((unsigned long)a1,			\ -			    (unsigned long)a2,			\ -			    0, 0, 0, __HYPERVISOR_##name);	\ -	(type)__res;						\ -}) - -#define _hypercall3(type, name, a1, a2, a3)			\ -({								\ -	long __res;						\ -	__res = __hypercall((unsigned long)a1,			\ -			    (unsigned long)a2,			\ -			    (unsigned long)a3,			\ -			    0, 0, __HYPERVISOR_##name);		\ -	(type)__res;						\ -}) - -#define _hypercall4(type, name, a1, a2, a3, a4)			\ -({								\ -	long __res;						\ -	__res = __hypercall((unsigned long)a1,			\ -			    (unsigned long)a2,			\ -			    (unsigned long)a3,			\ -			    (unsigned long)a4,			\ -			    0, __HYPERVISOR_##name);		\ -	(type)__res;						\ -}) - -#define _hypercall5(type, name, a1, a2, a3, a4, a5)		\ -({								\ -	long __res;						\ -	__res = __hypercall((unsigned long)a1,			\ -			    (unsigned long)a2,			\ -			    (unsigned long)a3,			\ -			    (unsigned long)a4,			\ -			    (unsigned long)a5,			\ -			    __HYPERVISOR_##name);		\ -	(type)__res;						\ -}) - - -static inline int -xencomm_arch_hypercall_sched_op(int cmd, struct xencomm_handle *arg) -{ -	return _hypercall2(int, sched_op, cmd, arg); -} - -static inline long -HYPERVISOR_set_timer_op(u64 timeout) -{ -	unsigned long timeout_hi = (unsigned long)(timeout >> 32); -	unsigned long timeout_lo = (unsigned long)timeout; -	return _hypercall2(long, set_timer_op, timeout_lo, timeout_hi); -} - -static inline int -xencomm_arch_hypercall_multicall(struct xencomm_handle *call_list, -				 int nr_calls) -{ -	return _hypercall2(int, multicall, call_list, nr_calls); -} - -static inline int -xencomm_arch_hypercall_memory_op(unsigned int cmd, struct xencomm_handle *arg) -{ -	return _hypercall2(int, memory_op, cmd, arg); -} - -static inline int -xencomm_arch_hypercall_event_channel_op(int cmd, struct xencomm_handle *arg) -{ -	return _hypercall2(int, event_channel_op, cmd, arg); -} - -static inline int -xencomm_arch_hypercall_xen_version(int cmd, struct xencomm_handle *arg) -{ -	return _hypercall2(int, xen_version, cmd, arg); -} - -static inline int -xencomm_arch_hypercall_console_io(int cmd, int count, -				  struct xencomm_handle *str) -{ -	return _hypercall3(int, console_io, cmd, count, str); -} - -static inline int -xencomm_arch_hypercall_physdev_op(int cmd, struct xencomm_handle *arg) -{ -	return _hypercall2(int, physdev_op, cmd, arg); -} - -static inline int -xencomm_arch_hypercall_grant_table_op(unsigned int cmd, -				      struct xencomm_handle *uop, -				      unsigned int count) -{ -	return _hypercall3(int, grant_table_op, cmd, uop, count); -} - -int HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count); - -extern int xencomm_arch_hypercall_suspend(struct xencomm_handle *arg); - -static inline int -xencomm_arch_hypercall_callback_op(int cmd, struct xencomm_handle *arg) -{ -	return _hypercall2(int, callback_op, cmd, arg); -} - -static inline long -xencomm_arch_hypercall_vcpu_op(int cmd, int cpu, void *arg) -{ -	return _hypercall3(long, vcpu_op, cmd, cpu, arg); -} - -static inline int -HYPERVISOR_physdev_op(int cmd, void *arg) -{ -	switch (cmd) { -	case PHYSDEVOP_eoi: -		return _hypercall1(int, ia64_fast_eoi, -				   ((struct physdev_eoi *)arg)->irq); -	default: -		return xencomm_hypercall_physdev_op(cmd, arg); -	} -} - -static inline long -xencomm_arch_hypercall_opt_feature(struct xencomm_handle *arg) -{ -	return _hypercall1(long, opt_feature, arg); -} - -/* for balloon driver */ -#define HYPERVISOR_update_va_mapping(va, new_val, flags) (0) - -/* Use xencomm to do hypercalls.  */ -#define HYPERVISOR_sched_op xencomm_hypercall_sched_op -#define HYPERVISOR_event_channel_op xencomm_hypercall_event_channel_op -#define HYPERVISOR_callback_op xencomm_hypercall_callback_op -#define HYPERVISOR_multicall xencomm_hypercall_multicall -#define HYPERVISOR_xen_version xencomm_hypercall_xen_version -#define HYPERVISOR_console_io xencomm_hypercall_console_io -#define HYPERVISOR_memory_op xencomm_hypercall_memory_op -#define HYPERVISOR_suspend xencomm_hypercall_suspend -#define HYPERVISOR_vcpu_op xencomm_hypercall_vcpu_op -#define HYPERVISOR_opt_feature xencomm_hypercall_opt_feature - -/* to compile gnttab_copy_grant_page() in drivers/xen/core/gnttab.c */ -#define HYPERVISOR_mmu_update(req, count, success_count, domid) ({ BUG(); 0; }) - -static inline int -HYPERVISOR_shutdown( -	unsigned int reason) -{ -	struct sched_shutdown sched_shutdown = { -		.reason = reason -	}; - -	int rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown); - -	return rc; -} - -/* for netfront.c, netback.c */ -#define MULTI_UVMFLAGS_INDEX 0 /* XXX any value */ - -static inline void -MULTI_update_va_mapping( -	struct multicall_entry *mcl, unsigned long va, -	pte_t new_val, unsigned long flags) -{ -	mcl->op = __HYPERVISOR_update_va_mapping; -	mcl->result = 0; -} - -static inline void -MULTI_grant_table_op(struct multicall_entry *mcl, unsigned int cmd, -	void *uop, unsigned int count) -{ -	mcl->op = __HYPERVISOR_grant_table_op; -	mcl->args[0] = cmd; -	mcl->args[1] = (unsigned long)uop; -	mcl->args[2] = count; -} - -static inline void -MULTI_mmu_update(struct multicall_entry *mcl, struct mmu_update *req, -		 int count, int *success_count, domid_t domid) -{ -	mcl->op = __HYPERVISOR_mmu_update; -	mcl->args[0] = (unsigned long)req; -	mcl->args[1] = count; -	mcl->args[2] = (unsigned long)success_count; -	mcl->args[3] = domid; -} - -#endif /* _ASM_IA64_XEN_HYPERCALL_H */ diff --git a/arch/ia64/include/asm/xen/hypervisor.h b/arch/ia64/include/asm/xen/hypervisor.h deleted file mode 100644 index 67455c2ed2b..00000000000 --- a/arch/ia64/include/asm/xen/hypervisor.h +++ /dev/null @@ -1,61 +0,0 @@ -/****************************************************************************** - * hypervisor.h - * - * Linux-specific hypervisor handling. - * - * Copyright (c) 2002-2004, K A Fraser - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation; or, when distributed - * separately from the Linux kernel or incorporated into other - * software packages, subject to the following license: - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this source file (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, modify, - * merge, publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -#ifndef _ASM_IA64_XEN_HYPERVISOR_H -#define _ASM_IA64_XEN_HYPERVISOR_H - -#include <linux/err.h> -#include <xen/interface/xen.h> -#include <xen/interface/version.h>	/* to compile feature.c */ -#include <xen/features.h>		/* to comiple xen-netfront.c */ -#include <xen/xen.h> -#include <asm/xen/hypercall.h> - -#ifdef CONFIG_XEN -extern struct shared_info *HYPERVISOR_shared_info; -extern struct start_info *xen_start_info; - -void __init xen_setup_vcpu_info_placement(void); -void force_evtchn_callback(void); - -/* for drivers/xen/balloon/balloon.c */ -#ifdef CONFIG_XEN_SCRUB_PAGES -#define scrub_pages(_p, _n) memset((void *)(_p), 0, (_n) << PAGE_SHIFT) -#else -#define scrub_pages(_p, _n) ((void)0) -#endif - -/* For setup_arch() in arch/ia64/kernel/setup.c */ -void xen_ia64_enable_opt_feature(void); -#endif - -#endif /* _ASM_IA64_XEN_HYPERVISOR_H */ diff --git a/arch/ia64/include/asm/xen/inst.h b/arch/ia64/include/asm/xen/inst.h deleted file mode 100644 index c53a4761120..00000000000 --- a/arch/ia64/include/asm/xen/inst.h +++ /dev/null @@ -1,486 +0,0 @@ -/****************************************************************************** - * arch/ia64/include/asm/xen/inst.h - * - * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp> - *                    VA Linux Systems Japan K.K. - * - * 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 <asm/xen/privop.h> - -#define ia64_ivt				xen_ivt -#define DO_SAVE_MIN				XEN_DO_SAVE_MIN - -#define __paravirt_switch_to			xen_switch_to -#define __paravirt_leave_syscall		xen_leave_syscall -#define __paravirt_work_processed_syscall	xen_work_processed_syscall -#define __paravirt_leave_kernel			xen_leave_kernel -#define __paravirt_pending_syscall_end		xen_work_pending_syscall_end -#define __paravirt_work_processed_syscall_target \ -						xen_work_processed_syscall - -#define paravirt_fsyscall_table			xen_fsyscall_table -#define paravirt_fsys_bubble_down		xen_fsys_bubble_down - -#define MOV_FROM_IFA(reg)	\ -	movl reg = XSI_IFA;	\ -	;;			\ -	ld8 reg = [reg] - -#define MOV_FROM_ITIR(reg)	\ -	movl reg = XSI_ITIR;	\ -	;;			\ -	ld8 reg = [reg] - -#define MOV_FROM_ISR(reg)	\ -	movl reg = XSI_ISR;	\ -	;;			\ -	ld8 reg = [reg] - -#define MOV_FROM_IHA(reg)	\ -	movl reg = XSI_IHA;	\ -	;;			\ -	ld8 reg = [reg] - -#define MOV_FROM_IPSR(pred, reg)	\ -(pred)	movl reg = XSI_IPSR;		\ -	;;				\ -(pred)	ld8 reg = [reg] - -#define MOV_FROM_IIM(reg)	\ -	movl reg = XSI_IIM;	\ -	;;			\ -	ld8 reg = [reg] - -#define MOV_FROM_IIP(reg)	\ -	movl reg = XSI_IIP;	\ -	;;			\ -	ld8 reg = [reg] - -.macro __MOV_FROM_IVR reg, clob -	.ifc "\reg", "r8" -		XEN_HYPER_GET_IVR -		.exitm -	.endif -	.ifc "\clob", "r8" -		XEN_HYPER_GET_IVR -		;; -		mov \reg = r8 -		.exitm -	.endif - -	mov \clob = r8 -	;; -	XEN_HYPER_GET_IVR -	;; -	mov \reg = r8 -	;; -	mov r8 = \clob -.endm -#define MOV_FROM_IVR(reg, clob)	__MOV_FROM_IVR reg, clob - -.macro __MOV_FROM_PSR pred, reg, clob -	.ifc "\reg", "r8" -		(\pred)	XEN_HYPER_GET_PSR; -		.exitm -	.endif -	.ifc "\clob", "r8" -		(\pred)	XEN_HYPER_GET_PSR -		;; -		(\pred)	mov \reg = r8 -		.exitm -	.endif - -	(\pred)	mov \clob = r8 -	(\pred)	XEN_HYPER_GET_PSR -	;; -	(\pred)	mov \reg = r8 -	(\pred)	mov r8 = \clob -.endm -#define MOV_FROM_PSR(pred, reg, clob)	__MOV_FROM_PSR pred, reg, clob - -/* assuming ar.itc is read with interrupt disabled. */ -#define MOV_FROM_ITC(pred, pred_clob, reg, clob)		\ -(pred)	movl clob = XSI_ITC_OFFSET;				\ -	;;							\ -(pred)	ld8 clob = [clob];					\ -(pred)	mov reg = ar.itc;					\ -	;;							\ -(pred)	add reg = reg, clob;					\ -	;;							\ -(pred)	movl clob = XSI_ITC_LAST;				\ -	;;							\ -(pred)	ld8 clob = [clob];					\ -	;;							\ -(pred)	cmp.geu.unc pred_clob, p0 = clob, reg;			\ -	;;							\ -(pred_clob)	add reg = 1, clob;				\ -	;;							\ -(pred)	movl clob = XSI_ITC_LAST;				\ -	;;							\ -(pred)	st8 [clob] = reg - - -#define MOV_TO_IFA(reg, clob)	\ -	movl clob = XSI_IFA;	\ -	;;			\ -	st8 [clob] = reg	\ - -#define MOV_TO_ITIR(pred, reg, clob)	\ -(pred)	movl clob = XSI_ITIR;		\ -	;;				\ -(pred)	st8 [clob] = reg - -#define MOV_TO_IHA(pred, reg, clob)	\ -(pred)	movl clob = XSI_IHA;		\ -	;;				\ -(pred)	st8 [clob] = reg - -#define MOV_TO_IPSR(pred, reg, clob)	\ -(pred)	movl clob = XSI_IPSR;		\ -	;;				\ -(pred)	st8 [clob] = reg;		\ -	;; - -#define MOV_TO_IFS(pred, reg, clob)	\ -(pred)	movl clob = XSI_IFS;		\ -	;;				\ -(pred)	st8 [clob] = reg;		\ -	;; - -#define MOV_TO_IIP(reg, clob)	\ -	movl clob = XSI_IIP;	\ -	;;			\ -	st8 [clob] = reg - -.macro ____MOV_TO_KR kr, reg, clob0, clob1 -	.ifc "\clob0", "r9" -		.error "clob0 \clob0 must not be r9" -	.endif -	.ifc "\clob1", "r8" -		.error "clob1 \clob1 must not be r8" -	.endif - -	.ifnc "\reg", "r9" -		.ifnc "\clob1", "r9" -			mov \clob1 = r9 -		.endif -		mov r9 = \reg -	.endif -	.ifnc "\clob0", "r8" -		mov \clob0 = r8 -	.endif -	mov r8 = \kr -	;; -	XEN_HYPER_SET_KR - -	.ifnc "\reg", "r9" -		.ifnc "\clob1", "r9" -			mov r9 = \clob1 -		.endif -	.endif -	.ifnc "\clob0", "r8" -		mov r8 = \clob0 -	.endif -.endm - -.macro __MOV_TO_KR kr, reg, clob0, clob1 -	.ifc "\clob0", "r9" -		____MOV_TO_KR \kr, \reg, \clob1, \clob0 -		.exitm -	.endif -	.ifc "\clob1", "r8" -		____MOV_TO_KR \kr, \reg, \clob1, \clob0 -		.exitm -	.endif - -	____MOV_TO_KR \kr, \reg, \clob0, \clob1 -.endm - -#define MOV_TO_KR(kr, reg, clob0, clob1) \ -	__MOV_TO_KR IA64_KR_ ## kr, reg, clob0, clob1 - - -.macro __ITC_I pred, reg, clob -	.ifc "\reg", "r8" -		(\pred)	XEN_HYPER_ITC_I -		.exitm -	.endif -	.ifc "\clob", "r8" -		(\pred)	mov r8 = \reg -		;; -		(\pred)	XEN_HYPER_ITC_I -		.exitm -	.endif - -	(\pred)	mov \clob = r8 -	(\pred)	mov r8 = \reg -	;; -	(\pred)	XEN_HYPER_ITC_I -	;; -	(\pred)	mov r8 = \clob -	;; -.endm -#define ITC_I(pred, reg, clob)	__ITC_I pred, reg, clob - -.macro __ITC_D pred, reg, clob -	.ifc "\reg", "r8" -		(\pred)	XEN_HYPER_ITC_D -		;; -		.exitm -	.endif -	.ifc "\clob", "r8" -		(\pred)	mov r8 = \reg -		;; -		(\pred)	XEN_HYPER_ITC_D -		;; -		.exitm -	.endif - -	(\pred)	mov \clob = r8 -	(\pred)	mov r8 = \reg -	;; -	(\pred)	XEN_HYPER_ITC_D -	;; -	(\pred)	mov r8 = \clob -	;; -.endm -#define ITC_D(pred, reg, clob)	__ITC_D pred, reg, clob - -.macro __ITC_I_AND_D pred_i, pred_d, reg, clob -	.ifc "\reg", "r8" -		(\pred_i)XEN_HYPER_ITC_I -		;; -		(\pred_d)XEN_HYPER_ITC_D -		;; -		.exitm -	.endif -	.ifc "\clob", "r8" -		mov r8 = \reg -		;; -		(\pred_i)XEN_HYPER_ITC_I -		;; -		(\pred_d)XEN_HYPER_ITC_D -		;; -		.exitm -	.endif - -	mov \clob = r8 -	mov r8 = \reg -	;; -	(\pred_i)XEN_HYPER_ITC_I -	;; -	(\pred_d)XEN_HYPER_ITC_D -	;; -	mov r8 = \clob -	;; -.endm -#define ITC_I_AND_D(pred_i, pred_d, reg, clob) \ -	__ITC_I_AND_D pred_i, pred_d, reg, clob - -.macro __THASH pred, reg0, reg1, clob -	.ifc "\reg0", "r8" -		(\pred)	mov r8 = \reg1 -		(\pred)	XEN_HYPER_THASH -		.exitm -	.endc -	.ifc "\reg1", "r8" -		(\pred)	XEN_HYPER_THASH -		;; -		(\pred)	mov \reg0 = r8 -		;; -		.exitm -	.endif -	.ifc "\clob", "r8" -		(\pred)	mov r8 = \reg1 -		(\pred)	XEN_HYPER_THASH -		;; -		(\pred)	mov \reg0 = r8 -		;; -		.exitm -	.endif - -	(\pred)	mov \clob = r8 -	(\pred)	mov r8 = \reg1 -	(\pred)	XEN_HYPER_THASH -	;; -	(\pred)	mov \reg0 = r8 -	(\pred)	mov r8 = \clob -	;; -.endm -#define THASH(pred, reg0, reg1, clob) __THASH pred, reg0, reg1, clob - -#define SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(clob0, clob1)	\ -	mov clob0 = 1;						\ -	movl clob1 = XSI_PSR_IC;				\ -	;;							\ -	st4 [clob1] = clob0					\ -	;; - -#define SSM_PSR_IC_AND_SRLZ_D(clob0, clob1)	\ -	;;					\ -	srlz.d;					\ -	mov clob1 = 1;				\ -	movl clob0 = XSI_PSR_IC;		\ -	;;					\ -	st4 [clob0] = clob1 - -#define RSM_PSR_IC(clob)	\ -	movl clob = XSI_PSR_IC;	\ -	;;			\ -	st4 [clob] = r0;	\ -	;; - -/* pred will be clobbered */ -#define MASK_TO_PEND_OFS    (-1) -#define SSM_PSR_I(pred, pred_clob, clob)				\ -(pred)	movl clob = XSI_PSR_I_ADDR					\ -	;;								\ -(pred)	ld8 clob = [clob]						\ -	;;								\ -	/* if (pred) vpsr.i = 1 */					\ -	/* if (pred) (vcpu->vcpu_info->evtchn_upcall_mask)=0 */		\ -(pred)	st1 [clob] = r0, MASK_TO_PEND_OFS				\ -	;;								\ -	/* if (vcpu->vcpu_info->evtchn_upcall_pending) */		\ -(pred)	ld1 clob = [clob]						\ -	;;								\ -(pred)	cmp.ne.unc pred_clob, p0 = clob, r0				\ -	;;								\ -(pred_clob)XEN_HYPER_SSM_I	/* do areal ssm psr.i */ - -#define RSM_PSR_I(pred, clob0, clob1)	\ -	movl clob0 = XSI_PSR_I_ADDR;	\ -	mov clob1 = 1;			\ -	;;				\ -	ld8 clob0 = [clob0];		\ -	;;				\ -(pred)	st1 [clob0] = clob1 - -#define RSM_PSR_I_IC(clob0, clob1, clob2)		\ -	movl clob0 = XSI_PSR_I_ADDR;			\ -	movl clob1 = XSI_PSR_IC;			\ -	;;						\ -	ld8 clob0 = [clob0];				\ -	mov clob2 = 1;					\ -	;;						\ -	/* note: clears both vpsr.i and vpsr.ic! */	\ -	st1 [clob0] = clob2;				\ -	st4 [clob1] = r0;				\ -	;; - -#define RSM_PSR_DT		\ -	XEN_HYPER_RSM_PSR_DT - -#define RSM_PSR_BE_I(clob0, clob1)	\ -	RSM_PSR_I(p0, clob0, clob1);	\ -	rum psr.be - -#define SSM_PSR_DT_AND_SRLZ_I	\ -	XEN_HYPER_SSM_PSR_DT - -#define BSW_0(clob0, clob1, clob2)			\ -	;;						\ -	/* r16-r31 all now hold bank1 values */		\ -	mov clob2 = ar.unat;				\ -	movl clob0 = XSI_BANK1_R16;			\ -	movl clob1 = XSI_BANK1_R16 + 8;			\ -	;;						\ -.mem.offset 0, 0; st8.spill [clob0] = r16, 16;		\ -.mem.offset 8, 0; st8.spill [clob1] = r17, 16;		\ -	;;						\ -.mem.offset 0, 0; st8.spill [clob0] = r18, 16;		\ -.mem.offset 8, 0; st8.spill [clob1] = r19, 16;		\ -	;;						\ -.mem.offset 0, 0; st8.spill [clob0] = r20, 16;		\ -.mem.offset 8, 0; st8.spill [clob1] = r21, 16;		\ -	;;						\ -.mem.offset 0, 0; st8.spill [clob0] = r22, 16;		\ -.mem.offset 8, 0; st8.spill [clob1] = r23, 16;		\ -	;;						\ -.mem.offset 0, 0; st8.spill [clob0] = r24, 16;		\ -.mem.offset 8, 0; st8.spill [clob1] = r25, 16;		\ -	;;						\ -.mem.offset 0, 0; st8.spill [clob0] = r26, 16;		\ -.mem.offset 8, 0; st8.spill [clob1] = r27, 16;		\ -	;;						\ -.mem.offset 0, 0; st8.spill [clob0] = r28, 16;		\ -.mem.offset 8, 0; st8.spill [clob1] = r29, 16;		\ -	;;						\ -.mem.offset 0, 0; st8.spill [clob0] = r30, 16;		\ -.mem.offset 8, 0; st8.spill [clob1] = r31, 16;		\ -	;;						\ -	mov clob1 = ar.unat;				\ -	movl clob0 = XSI_B1NAT;				\ -	;;						\ -	st8 [clob0] = clob1;				\ -	mov ar.unat = clob2;				\ -	movl clob0 = XSI_BANKNUM;			\ -	;;						\ -	st4 [clob0] = r0 - - -	/* FIXME: THIS CODE IS NOT NaT SAFE! */ -#define XEN_BSW_1(clob)			\ -	mov clob = ar.unat;		\ -	movl r30 = XSI_B1NAT;		\ -	;;				\ -	ld8 r30 = [r30];		\ -	mov r31 = 1;			\ -	;;				\ -	mov ar.unat = r30;		\ -	movl r30 = XSI_BANKNUM;		\ -	;;				\ -	st4 [r30] = r31;		\ -	movl r30 = XSI_BANK1_R16;	\ -	movl r31 = XSI_BANK1_R16+8;	\ -	;;				\ -	ld8.fill r16 = [r30], 16;	\ -	ld8.fill r17 = [r31], 16;	\ -	;;				\ -	ld8.fill r18 = [r30], 16;	\ -	ld8.fill r19 = [r31], 16;	\ -	;;				\ -	ld8.fill r20 = [r30], 16;	\ -	ld8.fill r21 = [r31], 16;	\ -	;;				\ -	ld8.fill r22 = [r30], 16;	\ -	ld8.fill r23 = [r31], 16;	\ -	;;				\ -	ld8.fill r24 = [r30], 16;	\ -	ld8.fill r25 = [r31], 16;	\ -	;;				\ -	ld8.fill r26 = [r30], 16;	\ -	ld8.fill r27 = [r31], 16;	\ -	;;				\ -	ld8.fill r28 = [r30], 16;	\ -	ld8.fill r29 = [r31], 16;	\ -	;;				\ -	ld8.fill r30 = [r30];		\ -	ld8.fill r31 = [r31];		\ -	;;				\ -	mov ar.unat = clob - -#define BSW_1(clob0, clob1)	XEN_BSW_1(clob1) - - -#define COVER	\ -	XEN_HYPER_COVER - -#define RFI			\ -	XEN_HYPER_RFI;		\ -	dv_serialize_data diff --git a/arch/ia64/include/asm/xen/interface.h b/arch/ia64/include/asm/xen/interface.h deleted file mode 100644 index e88c5de2741..00000000000 --- a/arch/ia64/include/asm/xen/interface.h +++ /dev/null @@ -1,363 +0,0 @@ -/****************************************************************************** - * arch-ia64/hypervisor-if.h - * - * Guest OS interface to IA64 Xen. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * Copyright by those who contributed. (in alphabetical order) - * - * Anthony Xu <anthony.xu@intel.com> - * Eddie Dong <eddie.dong@intel.com> - * Fred Yang <fred.yang@intel.com> - * Kevin Tian <kevin.tian@intel.com> - * Alex Williamson <alex.williamson@hp.com> - * Chris Wright <chrisw@sous-sol.org> - * Christian Limpach <Christian.Limpach@cl.cam.ac.uk> - * Dietmar Hahn <dietmar.hahn@fujitsu-siemens.com> - * Hollis Blanchard <hollisb@us.ibm.com> - * Isaku Yamahata <yamahata@valinux.co.jp> - * Jan Beulich <jbeulich@novell.com> - * John Levon <john.levon@sun.com> - * Kazuhiro Suzuki <kaz@jp.fujitsu.com> - * Keir Fraser <keir.fraser@citrix.com> - * Kouya Shimura <kouya@jp.fujitsu.com> - * Masaki Kanno <kanno.masaki@jp.fujitsu.com> - * Matt Chapman <matthewc@hp.com> - * Matthew Chapman <matthewc@hp.com> - * Samuel Thibault <samuel.thibault@eu.citrix.com> - * Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com> - * Tristan Gingold <tgingold@free.fr> - * Tsunehisa Doi <Doi.Tsunehisa@jp.fujitsu.com> - * Yutaka Ezaki <yutaka.ezaki@jp.fujitsu.com> - * Zhang Xin <xing.z.zhang@intel.com> - * Zhang xiantao <xiantao.zhang@intel.com> - * dan.magenheimer@hp.com - * ian.pratt@cl.cam.ac.uk - * michael.fetterman@cl.cam.ac.uk - */ - -#ifndef _ASM_IA64_XEN_INTERFACE_H -#define _ASM_IA64_XEN_INTERFACE_H - -#define __DEFINE_GUEST_HANDLE(name, type)	\ -	typedef struct { type *p; } __guest_handle_ ## name - -#define DEFINE_GUEST_HANDLE_STRUCT(name)	\ -	__DEFINE_GUEST_HANDLE(name, struct name) -#define DEFINE_GUEST_HANDLE(name)	__DEFINE_GUEST_HANDLE(name, name) -#define GUEST_HANDLE(name)		__guest_handle_ ## name -#define GUEST_HANDLE_64(name)		GUEST_HANDLE(name) -#define set_xen_guest_handle(hnd, val)	do { (hnd).p = val; } while (0) - -#ifndef __ASSEMBLY__ -/* Explicitly size integers that represent pfns in the public interface - * with Xen so that we could have one ABI that works for 32 and 64 bit - * guests. */ -typedef unsigned long xen_pfn_t; -typedef unsigned long xen_ulong_t; -/* Guest handles for primitive C types. */ -__DEFINE_GUEST_HANDLE(uchar, unsigned char); -__DEFINE_GUEST_HANDLE(uint, unsigned int); -__DEFINE_GUEST_HANDLE(ulong, unsigned long); - -DEFINE_GUEST_HANDLE(char); -DEFINE_GUEST_HANDLE(int); -DEFINE_GUEST_HANDLE(long); -DEFINE_GUEST_HANDLE(void); -DEFINE_GUEST_HANDLE(uint64_t); -DEFINE_GUEST_HANDLE(uint32_t); - -DEFINE_GUEST_HANDLE(xen_pfn_t); -#define PRI_xen_pfn	"lx" -#endif - -/* Arch specific VIRQs definition */ -#define VIRQ_ITC	VIRQ_ARCH_0	/* V. Virtual itc timer */ -#define VIRQ_MCA_CMC	VIRQ_ARCH_1	/* MCA cmc interrupt */ -#define VIRQ_MCA_CPE	VIRQ_ARCH_2	/* MCA cpe interrupt */ - -/* Maximum number of virtual CPUs in multi-processor guests. */ -/* keep sizeof(struct shared_page) <= PAGE_SIZE. - * this is checked in arch/ia64/xen/hypervisor.c. */ -#define MAX_VIRT_CPUS	64 - -#ifndef __ASSEMBLY__ - -#define INVALID_MFN	(~0UL) - -union vac { -	unsigned long value; -	struct { -		int a_int:1; -		int a_from_int_cr:1; -		int a_to_int_cr:1; -		int a_from_psr:1; -		int a_from_cpuid:1; -		int a_cover:1; -		int a_bsw:1; -		long reserved:57; -	}; -}; - -union vdc { -	unsigned long value; -	struct { -		int d_vmsw:1; -		int d_extint:1; -		int d_ibr_dbr:1; -		int d_pmc:1; -		int d_to_pmd:1; -		int d_itm:1; -		long reserved:58; -	}; -}; - -struct mapped_regs { -	union vac vac; -	union vdc vdc; -	unsigned long virt_env_vaddr; -	unsigned long reserved1[29]; -	unsigned long vhpi; -	unsigned long reserved2[95]; -	union { -		unsigned long vgr[16]; -		unsigned long bank1_regs[16];	/* bank1 regs (r16-r31) -						   when bank0 active */ -	}; -	union { -		unsigned long vbgr[16]; -		unsigned long bank0_regs[16];	/* bank0 regs (r16-r31) -						   when bank1 active */ -	}; -	unsigned long vnat; -	unsigned long vbnat; -	unsigned long vcpuid[5]; -	unsigned long reserved3[11]; -	unsigned long vpsr; -	unsigned long vpr; -	unsigned long reserved4[76]; -	union { -		unsigned long vcr[128]; -		struct { -			unsigned long dcr;	/* CR0 */ -			unsigned long itm; -			unsigned long iva; -			unsigned long rsv1[5]; -			unsigned long pta;	/* CR8 */ -			unsigned long rsv2[7]; -			unsigned long ipsr;	/* CR16 */ -			unsigned long isr; -			unsigned long rsv3; -			unsigned long iip; -			unsigned long ifa; -			unsigned long itir; -			unsigned long iipa; -			unsigned long ifs; -			unsigned long iim;	/* CR24 */ -			unsigned long iha; -			unsigned long rsv4[38]; -			unsigned long lid;	/* CR64 */ -			unsigned long ivr; -			unsigned long tpr; -			unsigned long eoi; -			unsigned long irr[4]; -			unsigned long itv;	/* CR72 */ -			unsigned long pmv; -			unsigned long cmcv; -			unsigned long rsv5[5]; -			unsigned long lrr0;	/* CR80 */ -			unsigned long lrr1; -			unsigned long rsv6[46]; -		}; -	}; -	union { -		unsigned long reserved5[128]; -		struct { -			unsigned long precover_ifs; -			unsigned long unat;	/* not sure if this is needed -						   until NaT arch is done */ -			int interrupt_collection_enabled; /* virtual psr.ic */ - -			/* virtual interrupt deliverable flag is -			 * evtchn_upcall_mask in shared info area now. -			 * interrupt_mask_addr is the address -			 * of evtchn_upcall_mask for current vcpu -			 */ -			unsigned char *interrupt_mask_addr; -			int pending_interruption; -			unsigned char vpsr_pp; -			unsigned char vpsr_dfh; -			unsigned char hpsr_dfh; -			unsigned char hpsr_mfh; -			unsigned long reserved5_1[4]; -			int metaphysical_mode;	/* 1 = use metaphys mapping -						   0 = use virtual */ -			int banknum;		/* 0 or 1, which virtual -						   register bank is active */ -			unsigned long rrs[8];	/* region registers */ -			unsigned long krs[8];	/* kernel registers */ -			unsigned long tmp[16];	/* temp registers -						   (e.g. for hyperprivops) */ - -			/* itc paravirtualization -			 * vAR.ITC = mAR.ITC + itc_offset -			 * itc_last is one which was lastly passed to -			 * the guest OS in order to prevent it from -			 * going backwords. -			 */ -			unsigned long itc_offset; -			unsigned long itc_last; -		}; -	}; -}; - -struct arch_vcpu_info { -	/* nothing */ -}; - -/* - * This structure is used for magic page in domain pseudo physical address - * space and the result of XENMEM_machine_memory_map. - * As the XENMEM_machine_memory_map result, - * xen_memory_map::nr_entries indicates the size in bytes - * including struct xen_ia64_memmap_info. Not the number of entries. - */ -struct xen_ia64_memmap_info { -	uint64_t efi_memmap_size;	/* size of EFI memory map */ -	uint64_t efi_memdesc_size;	/* size of an EFI memory map -					 * descriptor */ -	uint32_t efi_memdesc_version;	/* memory descriptor version */ -	void *memdesc[0];		/* array of efi_memory_desc_t */ -}; - -struct arch_shared_info { -	/* PFN of the start_info page.	*/ -	unsigned long start_info_pfn; - -	/* Interrupt vector for event channel.	*/ -	int evtchn_vector; - -	/* PFN of memmap_info page */ -	unsigned int memmap_info_num_pages;	/* currently only = 1 case is -						   supported. */ -	unsigned long memmap_info_pfn; - -	uint64_t pad[31]; -}; - -struct xen_callback { -	unsigned long ip; -}; -typedef struct xen_callback xen_callback_t; - -#endif /* !__ASSEMBLY__ */ - -#include <asm/pvclock-abi.h> - -/* Size of the shared_info area (this is not related to page size).  */ -#define XSI_SHIFT			14 -#define XSI_SIZE			(1 << XSI_SHIFT) -/* Log size of mapped_regs area (64 KB - only 4KB is used).  */ -#define XMAPPEDREGS_SHIFT		12 -#define XMAPPEDREGS_SIZE		(1 << XMAPPEDREGS_SHIFT) -/* Offset of XASI (Xen arch shared info) wrt XSI_BASE.	*/ -#define XMAPPEDREGS_OFS			XSI_SIZE - -/* Hyperprivops.  */ -#define HYPERPRIVOP_START		0x1 -#define HYPERPRIVOP_RFI			(HYPERPRIVOP_START + 0x0) -#define HYPERPRIVOP_RSM_DT		(HYPERPRIVOP_START + 0x1) -#define HYPERPRIVOP_SSM_DT		(HYPERPRIVOP_START + 0x2) -#define HYPERPRIVOP_COVER		(HYPERPRIVOP_START + 0x3) -#define HYPERPRIVOP_ITC_D		(HYPERPRIVOP_START + 0x4) -#define HYPERPRIVOP_ITC_I		(HYPERPRIVOP_START + 0x5) -#define HYPERPRIVOP_SSM_I		(HYPERPRIVOP_START + 0x6) -#define HYPERPRIVOP_GET_IVR		(HYPERPRIVOP_START + 0x7) -#define HYPERPRIVOP_GET_TPR		(HYPERPRIVOP_START + 0x8) -#define HYPERPRIVOP_SET_TPR		(HYPERPRIVOP_START + 0x9) -#define HYPERPRIVOP_EOI			(HYPERPRIVOP_START + 0xa) -#define HYPERPRIVOP_SET_ITM		(HYPERPRIVOP_START + 0xb) -#define HYPERPRIVOP_THASH		(HYPERPRIVOP_START + 0xc) -#define HYPERPRIVOP_PTC_GA		(HYPERPRIVOP_START + 0xd) -#define HYPERPRIVOP_ITR_D		(HYPERPRIVOP_START + 0xe) -#define HYPERPRIVOP_GET_RR		(HYPERPRIVOP_START + 0xf) -#define HYPERPRIVOP_SET_RR		(HYPERPRIVOP_START + 0x10) -#define HYPERPRIVOP_SET_KR		(HYPERPRIVOP_START + 0x11) -#define HYPERPRIVOP_FC			(HYPERPRIVOP_START + 0x12) -#define HYPERPRIVOP_GET_CPUID		(HYPERPRIVOP_START + 0x13) -#define HYPERPRIVOP_GET_PMD		(HYPERPRIVOP_START + 0x14) -#define HYPERPRIVOP_GET_EFLAG		(HYPERPRIVOP_START + 0x15) -#define HYPERPRIVOP_SET_EFLAG		(HYPERPRIVOP_START + 0x16) -#define HYPERPRIVOP_RSM_BE		(HYPERPRIVOP_START + 0x17) -#define HYPERPRIVOP_GET_PSR		(HYPERPRIVOP_START + 0x18) -#define HYPERPRIVOP_SET_RR0_TO_RR4	(HYPERPRIVOP_START + 0x19) -#define HYPERPRIVOP_MAX			(0x1a) - -/* Fast and light hypercalls.  */ -#define __HYPERVISOR_ia64_fast_eoi	__HYPERVISOR_arch_1 - -/* Xencomm macros.  */ -#define XENCOMM_INLINE_MASK		0xf800000000000000UL -#define XENCOMM_INLINE_FLAG		0x8000000000000000UL - -#ifndef __ASSEMBLY__ - -/* - * Optimization features. - * The hypervisor may do some special optimizations for guests. This hypercall - * can be used to switch on/of these special optimizations. - */ -#define __HYPERVISOR_opt_feature	0x700UL - -#define XEN_IA64_OPTF_OFF		0x0 -#define XEN_IA64_OPTF_ON		0x1 - -/* - * If this feature is switched on, the hypervisor inserts the - * tlb entries without calling the guests traphandler. - * This is useful in guests using region 7 for identity mapping - * like the linux kernel does. - */ -#define XEN_IA64_OPTF_IDENT_MAP_REG7	1 - -/* Identity mapping of region 4 addresses in HVM. */ -#define XEN_IA64_OPTF_IDENT_MAP_REG4	2 - -/* Identity mapping of region 5 addresses in HVM. */ -#define XEN_IA64_OPTF_IDENT_MAP_REG5	3 - -#define XEN_IA64_OPTF_IDENT_MAP_NOT_SET	 (0) - -struct xen_ia64_opt_feature { -	unsigned long cmd;	/* Which feature */ -	unsigned char on;	/* Switch feature on/off */ -	union { -		struct { -			/* The page protection bit mask of the pte. -			 * This will be or'ed with the pte. */ -			unsigned long pgprot; -			unsigned long key;	/* A protection key for itir.*/ -		}; -	}; -}; - -#endif /* __ASSEMBLY__ */ - -#endif /* _ASM_IA64_XEN_INTERFACE_H */ diff --git a/arch/ia64/include/asm/xen/irq.h b/arch/ia64/include/asm/xen/irq.h deleted file mode 100644 index a9045098300..00000000000 --- a/arch/ia64/include/asm/xen/irq.h +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** - * arch/ia64/include/asm/xen/irq.h - * - * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp> - *                    VA Linux Systems Japan K.K. - * - * 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 - * - */ - -#ifndef _ASM_IA64_XEN_IRQ_H -#define _ASM_IA64_XEN_IRQ_H - -/* - * The flat IRQ space is divided into two regions: - *  1. A one-to-one mapping of real physical IRQs. This space is only used - *     if we have physical device-access privilege. This region is at the - *     start of the IRQ space so that existing device drivers do not need - *     to be modified to translate physical IRQ numbers into our IRQ space. - *  3. A dynamic mapping of inter-domain and Xen-sourced virtual IRQs. These - *     are bound using the provided bind/unbind functions. - */ - -#define XEN_PIRQ_BASE		0 -#define XEN_NR_PIRQS		256 - -#define XEN_DYNIRQ_BASE		(XEN_PIRQ_BASE + XEN_NR_PIRQS) -#define XEN_NR_DYNIRQS		(NR_CPUS * 8) - -#define XEN_NR_IRQS		(XEN_NR_PIRQS + XEN_NR_DYNIRQS) - -#endif /* _ASM_IA64_XEN_IRQ_H */ diff --git a/arch/ia64/include/asm/xen/minstate.h b/arch/ia64/include/asm/xen/minstate.h deleted file mode 100644 index 00cf03e0cb8..00000000000 --- a/arch/ia64/include/asm/xen/minstate.h +++ /dev/null @@ -1,143 +0,0 @@ - -#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE -/* read ar.itc in advance, and use it before leaving bank 0 */ -#define XEN_ACCOUNT_GET_STAMP		\ -	MOV_FROM_ITC(pUStk, p6, r20, r2); -#else -#define XEN_ACCOUNT_GET_STAMP -#endif - -/* - * DO_SAVE_MIN switches to the kernel stacks (if necessary) and saves - * the minimum state necessary that allows us to turn psr.ic back - * on. - * - * Assumed state upon entry: - *	psr.ic: off - *	r31:	contains saved predicates (pr) - * - * Upon exit, the state is as follows: - *	psr.ic: off - *	 r2 = points to &pt_regs.r16 - *	 r8 = contents of ar.ccv - *	 r9 = contents of ar.csd - *	r10 = contents of ar.ssd - *	r11 = FPSR_DEFAULT - *	r12 = kernel sp (kernel virtual address) - *	r13 = points to current task_struct (kernel virtual address) - *	p15 = TRUE if psr.i is set in cr.ipsr - *	predicate registers (other than p2, p3, and p15), b6, r3, r14, r15: - *		preserved - * CONFIG_XEN note: p6/p7 are not preserved - * - * Note that psr.ic is NOT turned on by this macro.  This is so that - * we can pass interruption state as arguments to a handler. - */ -#define XEN_DO_SAVE_MIN(__COVER,SAVE_IFS,EXTRA,WORKAROUND)					\ -	mov r16=IA64_KR(CURRENT);	/* M */							\ -	mov r27=ar.rsc;			/* M */							\ -	mov r20=r1;			/* A */							\ -	mov r25=ar.unat;		/* M */							\ -	MOV_FROM_IPSR(p0,r29);		/* M */							\ -	MOV_FROM_IIP(r28);		/* M */							\ -	mov r21=ar.fpsr;		/* M */							\ -	mov r26=ar.pfs;			/* I */							\ -	__COVER;			/* B;; (or nothing) */					\ -	adds r16=IA64_TASK_THREAD_ON_USTACK_OFFSET,r16;						\ -	;;											\ -	ld1 r17=[r16];				/* load current->thread.on_ustack flag */	\ -	st1 [r16]=r0;				/* clear current->thread.on_ustack flag */	\ -	adds r1=-IA64_TASK_THREAD_ON_USTACK_OFFSET,r16						\ -	/* switch from user to kernel RBS: */							\ -	;;											\ -	invala;				/* M */							\ -	/* SAVE_IFS;*/ /* see xen special handling below */					\ -	cmp.eq pKStk,pUStk=r0,r17;		/* are we in kernel mode already? */		\ -	;;											\ -(pUStk)	mov ar.rsc=0;		/* set enforced lazy mode, pl 0, little-endian, loadrs=0 */	\ -	;;											\ -(pUStk)	mov.m r24=ar.rnat;									\ -(pUStk)	addl r22=IA64_RBS_OFFSET,r1;			/* compute base of RBS */		\ -(pKStk) mov r1=sp;					/* get sp  */				\ -	;;											\ -(pUStk) lfetch.fault.excl.nt1 [r22];								\ -(pUStk)	addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r1;	/* compute base of memory stack */	\ -(pUStk)	mov r23=ar.bspstore;				/* save ar.bspstore */			\ -	;;											\ -(pUStk)	mov ar.bspstore=r22;				/* switch to kernel RBS */		\ -(pKStk) addl r1=-IA64_PT_REGS_SIZE,r1;			/* if in kernel mode, use sp (r12) */	\ -	;;											\ -(pUStk)	mov r18=ar.bsp;										\ -(pUStk)	mov ar.rsc=0x3;		/* set eager mode, pl 0, little-endian, loadrs=0 */		\ -	adds r17=2*L1_CACHE_BYTES,r1;		/* really: biggest cache-line size */		\ -	adds r16=PT(CR_IPSR),r1;								\ -	;;											\ -	lfetch.fault.excl.nt1 [r17],L1_CACHE_BYTES;						\ -	st8 [r16]=r29;		/* save cr.ipsr */						\ -	;;											\ -	lfetch.fault.excl.nt1 [r17];								\ -	tbit.nz p15,p0=r29,IA64_PSR_I_BIT;							\ -	mov r29=b0										\ -	;;											\ -	WORKAROUND;										\ -	adds r16=PT(R8),r1;	/* initialize first base pointer */				\ -	adds r17=PT(R9),r1;	/* initialize second base pointer */				\ -(pKStk)	mov r18=r0;		/* make sure r18 isn't NaT */					\ -	;;											\ -.mem.offset 0,0; st8.spill [r16]=r8,16;								\ -.mem.offset 8,0; st8.spill [r17]=r9,16;								\ -        ;;											\ -.mem.offset 0,0; st8.spill [r16]=r10,24;							\ -	movl r8=XSI_PRECOVER_IFS;								\ -.mem.offset 8,0; st8.spill [r17]=r11,24;							\ -        ;;											\ -	/* xen special handling for possibly lazy cover */					\ -	/* SAVE_MIN case in dispatch_ia32_handler: mov r30=r0 */				\ -	ld8 r30=[r8];										\ -(pUStk)	sub r18=r18,r22;	/* r18=RSE.ndirty*8 */						\ -	st8 [r16]=r28,16;	/* save cr.iip */						\ -	;;											\ -	st8 [r17]=r30,16;	/* save cr.ifs */						\ -	mov r8=ar.ccv;										\ -	mov r9=ar.csd;										\ -	mov r10=ar.ssd;										\ -	movl r11=FPSR_DEFAULT;   /* L-unit */							\ -	;;											\ -	st8 [r16]=r25,16;	/* save ar.unat */						\ -	st8 [r17]=r26,16;	/* save ar.pfs */						\ -	shl r18=r18,16;		/* compute ar.rsc to be used for "loadrs" */			\ -	;;											\ -	st8 [r16]=r27,16;	/* save ar.rsc */						\ -(pUStk)	st8 [r17]=r24,16;	/* save ar.rnat */						\ -(pKStk)	adds r17=16,r17;	/* skip over ar_rnat field */					\ -	;;			/* avoid RAW on r16 & r17 */					\ -(pUStk)	st8 [r16]=r23,16;	/* save ar.bspstore */						\ -	st8 [r17]=r31,16;	/* save predicates */						\ -(pKStk)	adds r16=16,r16;	/* skip over ar_bspstore field */				\ -	;;											\ -	st8 [r16]=r29,16;	/* save b0 */							\ -	st8 [r17]=r18,16;	/* save ar.rsc value for "loadrs" */				\ -	cmp.eq pNonSys,pSys=r0,r0	/* initialize pSys=0, pNonSys=1 */			\ -	;;											\ -.mem.offset 0,0; st8.spill [r16]=r20,16;	/* save original r1 */				\ -.mem.offset 8,0; st8.spill [r17]=r12,16;							\ -	adds r12=-16,r1;	/* switch to kernel memory stack (with 16 bytes of scratch) */	\ -	;;											\ -.mem.offset 0,0; st8.spill [r16]=r13,16;							\ -.mem.offset 8,0; st8.spill [r17]=r21,16;	/* save ar.fpsr */				\ -	mov r13=IA64_KR(CURRENT);	/* establish `current' */				\ -	;;											\ -.mem.offset 0,0; st8.spill [r16]=r15,16;							\ -.mem.offset 8,0; st8.spill [r17]=r14,16;							\ -	;;											\ -.mem.offset 0,0; st8.spill [r16]=r2,16;								\ -.mem.offset 8,0; st8.spill [r17]=r3,16;								\ -	XEN_ACCOUNT_GET_STAMP									\ -	adds r2=IA64_PT_REGS_R16_OFFSET,r1;							\ -	;;											\ -	EXTRA;											\ -	movl r1=__gp;		/* establish kernel global pointer */				\ -	;;											\ -	ACCOUNT_SYS_ENTER									\ -	BSW_1(r3,r14);	/* switch back to bank 1 (must be last in insn group) */		\ -	;; diff --git a/arch/ia64/include/asm/xen/page.h b/arch/ia64/include/asm/xen/page.h deleted file mode 100644 index 03441a780b5..00000000000 --- a/arch/ia64/include/asm/xen/page.h +++ /dev/null @@ -1,65 +0,0 @@ -/****************************************************************************** - * arch/ia64/include/asm/xen/page.h - * - * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp> - *                    VA Linux Systems Japan K.K. - * - * 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 - * - */ - -#ifndef _ASM_IA64_XEN_PAGE_H -#define _ASM_IA64_XEN_PAGE_H - -#define INVALID_P2M_ENTRY	(~0UL) - -static inline unsigned long mfn_to_pfn(unsigned long mfn) -{ -	return mfn; -} - -static inline unsigned long pfn_to_mfn(unsigned long pfn) -{ -	return pfn; -} - -#define phys_to_machine_mapping_valid(_x)	(1) - -static inline void *mfn_to_virt(unsigned long mfn) -{ -	return __va(mfn << PAGE_SHIFT); -} - -static inline unsigned long virt_to_mfn(void *virt) -{ -	return __pa(virt) >> PAGE_SHIFT; -} - -/* for tpmfront.c */ -static inline unsigned long virt_to_machine(void *virt) -{ -	return __pa(virt); -} - -static inline void set_phys_to_machine(unsigned long pfn, unsigned long mfn) -{ -	/* nothing */ -} - -#define pte_mfn(_x)	pte_pfn(_x) -#define mfn_pte(_x, _y)	__pte_ma(0)		/* unmodified use */ -#define __pte_ma(_x)	((pte_t) {(_x)})        /* unmodified use */ - -#endif /* _ASM_IA64_XEN_PAGE_H */ diff --git a/arch/ia64/include/asm/xen/patchlist.h b/arch/ia64/include/asm/xen/patchlist.h deleted file mode 100644 index eae944e8884..00000000000 --- a/arch/ia64/include/asm/xen/patchlist.h +++ /dev/null @@ -1,38 +0,0 @@ -/****************************************************************************** - * arch/ia64/include/asm/xen/patchlist.h - * - * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp> - *                    VA Linux Systems Japan K.K. - * - * 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 - * - */ - -#define __paravirt_start_gate_fsyscall_patchlist		\ -	__xen_start_gate_fsyscall_patchlist -#define __paravirt_end_gate_fsyscall_patchlist			\ -	__xen_end_gate_fsyscall_patchlist -#define __paravirt_start_gate_brl_fsys_bubble_down_patchlist	\ -	__xen_start_gate_brl_fsys_bubble_down_patchlist -#define __paravirt_end_gate_brl_fsys_bubble_down_patchlist	\ -	__xen_end_gate_brl_fsys_bubble_down_patchlist -#define __paravirt_start_gate_vtop_patchlist			\ -	__xen_start_gate_vtop_patchlist -#define __paravirt_end_gate_vtop_patchlist			\ -	__xen_end_gate_vtop_patchlist -#define __paravirt_start_gate_mckinley_e9_patchlist		\ -	__xen_start_gate_mckinley_e9_patchlist -#define __paravirt_end_gate_mckinley_e9_patchlist		\ -	__xen_end_gate_mckinley_e9_patchlist diff --git a/arch/ia64/include/asm/xen/privop.h b/arch/ia64/include/asm/xen/privop.h deleted file mode 100644 index fb4ec5e0b06..00000000000 --- a/arch/ia64/include/asm/xen/privop.h +++ /dev/null @@ -1,135 +0,0 @@ -#ifndef _ASM_IA64_XEN_PRIVOP_H -#define _ASM_IA64_XEN_PRIVOP_H - -/* - * Copyright (C) 2005 Hewlett-Packard Co - *	Dan Magenheimer <dan.magenheimer@hp.com> - * - * Paravirtualizations of privileged operations for Xen/ia64 - * - * - * inline privop and paravirt_alt support - * Copyright (c) 2007 Isaku Yamahata <yamahata at valinux co jp> - *                    VA Linux Systems Japan K.K. - * - */ - -#ifndef __ASSEMBLY__ -#include <linux/types.h>		/* arch-ia64.h requires uint64_t */ -#endif -#include <asm/xen/interface.h> - -/* At 1 MB, before per-cpu space but still addressable using addl instead -   of movl. */ -#define XSI_BASE			0xfffffffffff00000 - -/* Address of mapped regs.  */ -#define XMAPPEDREGS_BASE		(XSI_BASE + XSI_SIZE) - -#ifdef __ASSEMBLY__ -#define XEN_HYPER_RFI			break HYPERPRIVOP_RFI -#define XEN_HYPER_RSM_PSR_DT		break HYPERPRIVOP_RSM_DT -#define XEN_HYPER_SSM_PSR_DT		break HYPERPRIVOP_SSM_DT -#define XEN_HYPER_COVER			break HYPERPRIVOP_COVER -#define XEN_HYPER_ITC_D			break HYPERPRIVOP_ITC_D -#define XEN_HYPER_ITC_I			break HYPERPRIVOP_ITC_I -#define XEN_HYPER_SSM_I			break HYPERPRIVOP_SSM_I -#define XEN_HYPER_GET_IVR		break HYPERPRIVOP_GET_IVR -#define XEN_HYPER_THASH			break HYPERPRIVOP_THASH -#define XEN_HYPER_ITR_D			break HYPERPRIVOP_ITR_D -#define XEN_HYPER_SET_KR		break HYPERPRIVOP_SET_KR -#define XEN_HYPER_GET_PSR		break HYPERPRIVOP_GET_PSR -#define XEN_HYPER_SET_RR0_TO_RR4	break HYPERPRIVOP_SET_RR0_TO_RR4 - -#define XSI_IFS				(XSI_BASE + XSI_IFS_OFS) -#define XSI_PRECOVER_IFS		(XSI_BASE + XSI_PRECOVER_IFS_OFS) -#define XSI_IFA				(XSI_BASE + XSI_IFA_OFS) -#define XSI_ISR				(XSI_BASE + XSI_ISR_OFS) -#define XSI_IIM				(XSI_BASE + XSI_IIM_OFS) -#define XSI_ITIR			(XSI_BASE + XSI_ITIR_OFS) -#define XSI_PSR_I_ADDR			(XSI_BASE + XSI_PSR_I_ADDR_OFS) -#define XSI_PSR_IC			(XSI_BASE + XSI_PSR_IC_OFS) -#define XSI_IPSR			(XSI_BASE + XSI_IPSR_OFS) -#define XSI_IIP				(XSI_BASE + XSI_IIP_OFS) -#define XSI_B1NAT			(XSI_BASE + XSI_B1NATS_OFS) -#define XSI_BANK1_R16			(XSI_BASE + XSI_BANK1_R16_OFS) -#define XSI_BANKNUM			(XSI_BASE + XSI_BANKNUM_OFS) -#define XSI_IHA				(XSI_BASE + XSI_IHA_OFS) -#define XSI_ITC_OFFSET			(XSI_BASE + XSI_ITC_OFFSET_OFS) -#define XSI_ITC_LAST			(XSI_BASE + XSI_ITC_LAST_OFS) -#endif - -#ifndef __ASSEMBLY__ - -/************************************************/ -/* Instructions paravirtualized for correctness */ -/************************************************/ - -/* "fc" and "thash" are privilege-sensitive instructions, meaning they - *  may have different semantics depending on whether they are executed - *  at PL0 vs PL!=0.  When paravirtualized, these instructions mustn't - *  be allowed to execute directly, lest incorrect semantics result. */ -extern void xen_fc(void *addr); -extern unsigned long xen_thash(unsigned long addr); - -/* Note that "ttag" and "cover" are also privilege-sensitive; "ttag" - * is not currently used (though it may be in a long-format VHPT system!) - * and the semantics of cover only change if psr.ic is off which is very - * rare (and currently non-existent outside of assembly code */ - -/* There are also privilege-sensitive registers.  These registers are - * readable at any privilege level but only writable at PL0. */ -extern unsigned long xen_get_cpuid(int index); -extern unsigned long xen_get_pmd(int index); - -#ifndef ASM_SUPPORTED -extern unsigned long xen_get_eflag(void);	/* see xen_ia64_getreg */ -extern void xen_set_eflag(unsigned long);	/* see xen_ia64_setreg */ -#endif - -/************************************************/ -/* Instructions paravirtualized for performance */ -/************************************************/ - -/* Xen uses memory-mapped virtual privileged registers for access to many - * performance-sensitive privileged registers.  Some, like the processor - * status register (psr), are broken up into multiple memory locations. - * Others, like "pend", are abstractions based on privileged registers. - * "Pend" is guaranteed to be set if reading cr.ivr would return a - * (non-spurious) interrupt. */ -#define XEN_MAPPEDREGS ((struct mapped_regs *)XMAPPEDREGS_BASE) - -#define XSI_PSR_I			\ -	(*XEN_MAPPEDREGS->interrupt_mask_addr) -#define xen_get_virtual_psr_i()		\ -	(!XSI_PSR_I) -#define xen_set_virtual_psr_i(_val)	\ -	({ XSI_PSR_I = (uint8_t)(_val) ? 0 : 1; }) -#define xen_set_virtual_psr_ic(_val)	\ -	({ XEN_MAPPEDREGS->interrupt_collection_enabled = _val ? 1 : 0; }) -#define xen_get_virtual_pend()		\ -	(*(((uint8_t *)XEN_MAPPEDREGS->interrupt_mask_addr) - 1)) - -#ifndef ASM_SUPPORTED -/* Although all privileged operations can be left to trap and will - * be properly handled by Xen, some are frequent enough that we use - * hyperprivops for performance. */ -extern unsigned long xen_get_psr(void); -extern unsigned long xen_get_ivr(void); -extern unsigned long xen_get_tpr(void); -extern void xen_hyper_ssm_i(void); -extern void xen_set_itm(unsigned long); -extern void xen_set_tpr(unsigned long); -extern void xen_eoi(unsigned long); -extern unsigned long xen_get_rr(unsigned long index); -extern void xen_set_rr(unsigned long index, unsigned long val); -extern void xen_set_rr0_to_rr4(unsigned long val0, unsigned long val1, -			       unsigned long val2, unsigned long val3, -			       unsigned long val4); -extern void xen_set_kr(unsigned long index, unsigned long val); -extern void xen_ptcga(unsigned long addr, unsigned long size); -#endif /* !ASM_SUPPORTED */ - -#endif /* !__ASSEMBLY__ */ - -#endif /* _ASM_IA64_XEN_PRIVOP_H */ diff --git a/arch/ia64/include/asm/xen/xcom_hcall.h b/arch/ia64/include/asm/xen/xcom_hcall.h deleted file mode 100644 index 20b2950c71b..00000000000 --- a/arch/ia64/include/asm/xen/xcom_hcall.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2006 Tristan Gingold <tristan.gingold@bull.net>, Bull SAS - * - * 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 - */ - -#ifndef _ASM_IA64_XEN_XCOM_HCALL_H -#define _ASM_IA64_XEN_XCOM_HCALL_H - -/* These function creates inline or mini descriptor for the parameters and -   calls the corresponding xencomm_arch_hypercall_X. -   Architectures should defines HYPERVISOR_xxx as xencomm_hypercall_xxx unless -   they want to use their own wrapper.  */ -extern int xencomm_hypercall_console_io(int cmd, int count, char *str); - -extern int xencomm_hypercall_event_channel_op(int cmd, void *op); - -extern int xencomm_hypercall_xen_version(int cmd, void *arg); - -extern int xencomm_hypercall_physdev_op(int cmd, void *op); - -extern int xencomm_hypercall_grant_table_op(unsigned int cmd, void *op, -					    unsigned int count); - -extern int xencomm_hypercall_sched_op(int cmd, void *arg); - -extern int xencomm_hypercall_multicall(void *call_list, int nr_calls); - -extern int xencomm_hypercall_callback_op(int cmd, void *arg); - -extern int xencomm_hypercall_memory_op(unsigned int cmd, void *arg); - -extern int xencomm_hypercall_suspend(unsigned long srec); - -extern long xencomm_hypercall_vcpu_op(int cmd, int cpu, void *arg); - -extern long xencomm_hypercall_opt_feature(void *arg); - -#endif /* _ASM_IA64_XEN_XCOM_HCALL_H */ diff --git a/arch/ia64/include/asm/xen/xencomm.h b/arch/ia64/include/asm/xen/xencomm.h deleted file mode 100644 index cded677bebf..00000000000 --- a/arch/ia64/include/asm/xen/xencomm.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2006 Hollis Blanchard <hollisb@us.ibm.com>, IBM 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 - */ - -#ifndef _ASM_IA64_XEN_XENCOMM_H -#define _ASM_IA64_XEN_XENCOMM_H - -#include <xen/xencomm.h> -#include <asm/pgtable.h> - -/* Must be called before any hypercall.  */ -extern void xencomm_initialize(void); -extern int xencomm_is_initialized(void); - -/* Check if virtual contiguity means physical contiguity - * where the passed address is a pointer value in virtual address. - * On ia64, identity mapping area in region 7 or the piece of region 5 - * that is mapped by itr[IA64_TR_KERNEL]/dtr[IA64_TR_KERNEL] - */ -static inline int xencomm_is_phys_contiguous(unsigned long addr) -{ -	return (PAGE_OFFSET <= addr && -		addr < (PAGE_OFFSET + (1UL << IA64_MAX_PHYS_BITS))) || -		(KERNEL_START <= addr && -		 addr < KERNEL_START + KERNEL_TR_PAGE_SIZE); -} - -#endif /* _ASM_IA64_XEN_XENCOMM_H */ diff --git a/arch/ia64/include/uapi/asm/break.h b/arch/ia64/include/uapi/asm/break.h index e90c40ec9ed..f0340203989 100644 --- a/arch/ia64/include/uapi/asm/break.h +++ b/arch/ia64/include/uapi/asm/break.h @@ -20,13 +20,4 @@   */  #define __IA64_BREAK_SYSCALL		0x100000 -/* - * Xen specific break numbers: - */ -#define __IA64_XEN_HYPERCALL		0x1000 -/* [__IA64_XEN_HYPERPRIVOP_START, __IA64_XEN_HYPERPRIVOP_MAX] is used -   for xen hyperprivops */ -#define __IA64_XEN_HYPERPRIVOP_START	0x1 -#define __IA64_XEN_HYPERPRIVOP_MAX	0x1a -  #endif /* _ASM_IA64_BREAK_H */ diff --git a/arch/ia64/include/uapi/asm/cmpxchg.h b/arch/ia64/include/uapi/asm/cmpxchg.h index 4f37dbbb864..f35109b1d90 100644 --- a/arch/ia64/include/uapi/asm/cmpxchg.h +++ b/arch/ia64/include/uapi/asm/cmpxchg.h @@ -118,6 +118,15 @@ extern long ia64_cmpxchg_called_with_bad_pointer(void);  #define cmpxchg_rel(ptr, o, n)	\  	ia64_cmpxchg(rel, (ptr), (o), (n), sizeof(*(ptr))) +/* + * Worse still - early processor implementations actually just ignored + * the acquire/release and did a full fence all the time.  Unfortunately + * this meant a lot of badly written code that used .acq when they really + * wanted .rel became legacy out in the wild - so when we made a cpu + * that strictly did the .acq or .rel ... all that code started breaking - so + * we had to back-pedal and keep the "legacy" behavior of a full fence :-( + */ +  /* for compatibility with other platforms: */  #define cmpxchg(ptr, o, n)	cmpxchg_acq((ptr), (o), (n))  #define cmpxchg64(ptr, o, n)	cmpxchg_acq((ptr), (o), (n)) diff --git a/arch/ia64/include/uapi/asm/fcntl.h b/arch/ia64/include/uapi/asm/fcntl.h index 1dd275dc8f6..7b485876cad 100644 --- a/arch/ia64/include/uapi/asm/fcntl.h +++ b/arch/ia64/include/uapi/asm/fcntl.h @@ -8,6 +8,7 @@  #define force_o_largefile()	\  		(personality(current->personality) != PER_LINUX32) +#include <linux/personality.h>  #include <asm-generic/fcntl.h>  #endif /* _ASM_IA64_FCNTL_H */ diff --git a/arch/ia64/include/uapi/asm/socket.h b/arch/ia64/include/uapi/asm/socket.h index 556d0701a15..a1b49bac795 100644 --- a/arch/ia64/include/uapi/asm/socket.h +++ b/arch/ia64/include/uapi/asm/socket.h @@ -85,4 +85,8 @@  #define SO_BUSY_POLL		46 +#define SO_MAX_PACING_RATE	47 + +#define SO_BPF_EXTENSIONS	48 +  #endif /* _ASM_IA64_SOCKET_H */ diff --git a/arch/ia64/include/uapi/asm/unistd.h b/arch/ia64/include/uapi/asm/unistd.h index 34fd6fe46da..7de0a2d65da 100644 --- a/arch/ia64/include/uapi/asm/unistd.h +++ b/arch/ia64/include/uapi/asm/unistd.h @@ -325,5 +325,8 @@  #define __NR_process_vm_writev		1333  #define __NR_accept4			1334  #define __NR_finit_module		1335 +#define __NR_sched_setattr		1336 +#define __NR_sched_getattr		1337 +#define __NR_renameat2			1338  #endif /* _UAPI_ASM_IA64_UNISTD_H */ diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 5eb71d22c3d..615ef81def4 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c @@ -53,15 +53,10 @@  #include <asm/numa.h>  #include <asm/sal.h>  #include <asm/cyclone.h> -#include <asm/xen/hypervisor.h> - -#define BAD_MADT_ENTRY(entry, end) (                                        \ -		(!entry) || (unsigned long)entry + sizeof(*entry) > end ||  \ -		((struct acpi_subtable_header *)entry)->length < sizeof(*entry))  #define PREFIX			"ACPI: " -u32 acpi_rsdt_forced; +int acpi_lapic;  unsigned int acpi_cpei_override;  unsigned int acpi_cpei_phys_cpuid; @@ -120,8 +115,6 @@ acpi_get_sysname(void)  			return "uv";  		else  			return "sn2"; -	} else if (xen_pv_domain() && !strcmp(hdr->oem_id, "XEN")) { -		return "xen";  	}  #ifdef CONFIG_INTEL_IOMMU @@ -684,6 +677,8 @@ int __init early_acpi_boot_init(void)  	if (ret < 1)  		printk(KERN_ERR PREFIX  		       "Error parsing MADT - no LAPIC entries\n"); +	else +		acpi_lapic = 1;  #ifdef CONFIG_SMP  	if (available_cpus == 0) { @@ -807,14 +802,9 @@ int acpi_isa_irq_to_gsi(unsigned isa_irq, u32 *gsi)   *  ACPI based hotplug CPU support   */  #ifdef CONFIG_ACPI_HOTPLUG_CPU -static -int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) +static int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)  {  #ifdef CONFIG_ACPI_NUMA -	int pxm_id; -	int nid; - -	pxm_id = acpi_get_pxm(handle);  	/*  	 * We don't have cpu-only-node hotadd. But if the system equips  	 * SRAT table, pxm is already found and node is ready. @@ -822,11 +812,10 @@ int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)  	 * This code here is for the system which doesn't have full SRAT    	 * table for possible cpus.  	 */ -	nid = acpi_map_pxm_to_node(pxm_id);  	node_cpuid[cpu].phys_id = physid; -	node_cpuid[cpu].nid = nid; +	node_cpuid[cpu].nid = acpi_get_node(handle);  #endif -	return (0); +	return 0;  }  int additional_cpus __initdata = -1; @@ -882,40 +871,10 @@ __init void prefill_possible_map(void)  		set_cpu_possible(i, true);  } -static int _acpi_map_lsapic(acpi_handle handle, int *pcpu) +static int _acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu)  { -	struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; -	union acpi_object *obj; -	struct acpi_madt_local_sapic *lsapic;  	cpumask_t tmp_map; -	int cpu, physid; - -	if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer))) -		return -EINVAL; - -	if (!buffer.length || !buffer.pointer) -		return -EINVAL; - -	obj = buffer.pointer; -	if (obj->type != ACPI_TYPE_BUFFER) -	{ -		kfree(buffer.pointer); -		return -EINVAL; -	} - -	lsapic = (struct acpi_madt_local_sapic *)obj->buffer.pointer; - -	if ((lsapic->header.type != ACPI_MADT_TYPE_LOCAL_SAPIC) || -	    (!(lsapic->lapic_flags & ACPI_MADT_ENABLED))) { -		kfree(buffer.pointer); -		return -EINVAL; -	} - -	physid = ((lsapic->id << 8) | (lsapic->eid)); - -	kfree(buffer.pointer); -	buffer.length = ACPI_ALLOCATE_BUFFER; -	buffer.pointer = NULL; +	int cpu;  	cpumask_complement(&tmp_map, cpu_present_mask);  	cpu = cpumask_first(&tmp_map); @@ -934,9 +893,9 @@ static int _acpi_map_lsapic(acpi_handle handle, int *pcpu)  }  /* wrapper to silence section mismatch warning */ -int __ref acpi_map_lsapic(acpi_handle handle, int *pcpu) +int __ref acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu)  { -	return _acpi_map_lsapic(handle, pcpu); +	return _acpi_map_lsapic(handle, physid, pcpu);  }  EXPORT_SYMBOL(acpi_map_lsapic); @@ -963,7 +922,7 @@ static acpi_status acpi_map_iosapic(acpi_handle handle, u32 depth,  	union acpi_object *obj;  	struct acpi_madt_io_sapic *iosapic;  	unsigned int gsi_base; -	int pxm, node; +	int node;  	/* Only care about objects w/ a method that returns the MADT */  	if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer))) @@ -990,17 +949,9 @@ static acpi_status acpi_map_iosapic(acpi_handle handle, u32 depth,  	kfree(buffer.pointer); -	/* -	 * OK, it's an IOSAPIC MADT entry, look for a _PXM value to tell -	 * us which node to associate this with. -	 */ -	pxm = acpi_get_pxm(handle); -	if (pxm < 0) -		return AE_OK; - -	node = pxm_to_node(pxm); - -	if (node >= MAX_NUMNODES || !node_online(node) || +	/* OK, it's an IOSAPIC MADT entry; associate it with a node */ +	node = acpi_get_node(handle); +	if (node == NUMA_NO_NODE || !node_online(node) ||  	    cpumask_empty(cpumask_of_node(node)))  		return AE_OK; diff --git a/arch/ia64/kernel/asm-offsets.c b/arch/ia64/kernel/asm-offsets.c index 46c9e300731..60ef83e6db7 100644 --- a/arch/ia64/kernel/asm-offsets.c +++ b/arch/ia64/kernel/asm-offsets.c @@ -16,9 +16,6 @@  #include <asm/sigcontext.h>  #include <asm/mca.h> -#include <asm/xen/interface.h> -#include <asm/xen/hypervisor.h> -  #include "../kernel/sigframe.h"  #include "../kernel/fsyscall_gtod_data.h" @@ -290,33 +287,4 @@ void foo(void)  	DEFINE(IA64_ITC_LASTCYCLE_OFFSET,  		offsetof (struct itc_jitter_data_t, itc_lastcycle)); -#ifdef CONFIG_XEN -	BLANK(); - -	DEFINE(XEN_NATIVE_ASM, XEN_NATIVE); -	DEFINE(XEN_PV_DOMAIN_ASM, XEN_PV_DOMAIN); - -#define DEFINE_MAPPED_REG_OFS(sym, field) \ -	DEFINE(sym, (XMAPPEDREGS_OFS + offsetof(struct mapped_regs, field))) - -	DEFINE_MAPPED_REG_OFS(XSI_PSR_I_ADDR_OFS, interrupt_mask_addr); -	DEFINE_MAPPED_REG_OFS(XSI_IPSR_OFS, ipsr); -	DEFINE_MAPPED_REG_OFS(XSI_IIP_OFS, iip); -	DEFINE_MAPPED_REG_OFS(XSI_IFS_OFS, ifs); -	DEFINE_MAPPED_REG_OFS(XSI_PRECOVER_IFS_OFS, precover_ifs); -	DEFINE_MAPPED_REG_OFS(XSI_ISR_OFS, isr); -	DEFINE_MAPPED_REG_OFS(XSI_IFA_OFS, ifa); -	DEFINE_MAPPED_REG_OFS(XSI_IIPA_OFS, iipa); -	DEFINE_MAPPED_REG_OFS(XSI_IIM_OFS, iim); -	DEFINE_MAPPED_REG_OFS(XSI_IHA_OFS, iha); -	DEFINE_MAPPED_REG_OFS(XSI_ITIR_OFS, itir); -	DEFINE_MAPPED_REG_OFS(XSI_PSR_IC_OFS, interrupt_collection_enabled); -	DEFINE_MAPPED_REG_OFS(XSI_BANKNUM_OFS, banknum); -	DEFINE_MAPPED_REG_OFS(XSI_BANK0_R16_OFS, bank0_regs[0]); -	DEFINE_MAPPED_REG_OFS(XSI_BANK1_R16_OFS, bank1_regs[0]); -	DEFINE_MAPPED_REG_OFS(XSI_B0NATS_OFS, vbnat); -	DEFINE_MAPPED_REG_OFS(XSI_B1NATS_OFS, vnat); -	DEFINE_MAPPED_REG_OFS(XSI_ITC_OFFSET_OFS, itc_offset); -	DEFINE_MAPPED_REG_OFS(XSI_ITC_LAST_OFS, itc_last); -#endif /* CONFIG_XEN */  } diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c index b942f4032d7..2955f359e2a 100644 --- a/arch/ia64/kernel/crash.c +++ b/arch/ia64/kernel/crash.c @@ -237,7 +237,7 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data)  }  #ifdef CONFIG_SYSCTL -static ctl_table kdump_ctl_table[] = { +static struct ctl_table kdump_ctl_table[] = {  	{  		.procname = "kdump_on_init",  		.data = &kdump_on_init, @@ -255,7 +255,7 @@ static ctl_table kdump_ctl_table[] = {  	{ }  }; -static ctl_table sys_table[] = { +static struct ctl_table sys_table[] = {  	{  	  .procname = "kernel",  	  .mode = 0555, diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index 51bce594eb8..741b99c1a0b 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c @@ -44,10 +44,15 @@  #define EFI_DEBUG	0 +static __initdata unsigned long palo_phys; + +static __initdata efi_config_table_type_t arch_tables[] = { +	{PROCESSOR_ABSTRACTION_LAYER_OVERWRITE_GUID, "PALO", &palo_phys}, +	{NULL_GUID, NULL, 0}, +}; +  extern efi_status_t efi_call_phys (void *, ...); -struct efi efi; -EXPORT_SYMBOL(efi);  static efi_runtime_services_t *runtime;  static u64 mem_limit = ~0UL, max_addr = ~0UL, min_addr = 0UL; @@ -423,9 +428,9 @@ static u8 __init palo_checksum(u8 *buffer, u32 length)   * Parse and handle PALO table which is published at:   * http://www.dig64.org/home/DIG64_PALO_R1_0.pdf   */ -static void __init handle_palo(unsigned long palo_phys) +static void __init handle_palo(unsigned long phys_addr)  { -	struct palo_table *palo = __va(palo_phys); +	struct palo_table *palo = __va(phys_addr);  	u8  checksum;  	if (strncmp(palo->signature, PALO_SIG, sizeof(PALO_SIG) - 1)) { @@ -467,12 +472,13 @@ void __init  efi_init (void)  {  	void *efi_map_start, *efi_map_end; -	efi_config_table_t *config_tables;  	efi_char16_t *c16;  	u64 efi_desc_size;  	char *cp, vendor[100] = "unknown";  	int i; -	unsigned long palo_phys; + +	set_bit(EFI_BOOT, &efi.flags); +	set_bit(EFI_64BIT, &efi.flags);  	/*  	 * It's too early to be able to use the standard kernel command line @@ -514,8 +520,6 @@ efi_init (void)  		       efi.systab->hdr.revision >> 16,  		       efi.systab->hdr.revision & 0xffff); -	config_tables = __va(efi.systab->tables); -  	/* Show what we know for posterity */  	c16 = __va(efi.systab->fw_vendor);  	if (c16) { @@ -528,43 +532,12 @@ efi_init (void)  	       efi.systab->hdr.revision >> 16,  	       efi.systab->hdr.revision & 0xffff, vendor); -	efi.mps        = EFI_INVALID_TABLE_ADDR; -	efi.acpi       = EFI_INVALID_TABLE_ADDR; -	efi.acpi20     = EFI_INVALID_TABLE_ADDR; -	efi.smbios     = EFI_INVALID_TABLE_ADDR; -	efi.sal_systab = EFI_INVALID_TABLE_ADDR; -	efi.boot_info  = EFI_INVALID_TABLE_ADDR; -	efi.hcdp       = EFI_INVALID_TABLE_ADDR; -	efi.uga        = EFI_INVALID_TABLE_ADDR; +	set_bit(EFI_SYSTEM_TABLES, &efi.flags);  	palo_phys      = EFI_INVALID_TABLE_ADDR; -	for (i = 0; i < (int) efi.systab->nr_tables; i++) { -		if (efi_guidcmp(config_tables[i].guid, MPS_TABLE_GUID) == 0) { -			efi.mps = config_tables[i].table; -			printk(" MPS=0x%lx", config_tables[i].table); -		} else if (efi_guidcmp(config_tables[i].guid, ACPI_20_TABLE_GUID) == 0) { -			efi.acpi20 = config_tables[i].table; -			printk(" ACPI 2.0=0x%lx", config_tables[i].table); -		} else if (efi_guidcmp(config_tables[i].guid, ACPI_TABLE_GUID) == 0) { -			efi.acpi = config_tables[i].table; -			printk(" ACPI=0x%lx", config_tables[i].table); -		} else if (efi_guidcmp(config_tables[i].guid, SMBIOS_TABLE_GUID) == 0) { -			efi.smbios = config_tables[i].table; -			printk(" SMBIOS=0x%lx", config_tables[i].table); -		} else if (efi_guidcmp(config_tables[i].guid, SAL_SYSTEM_TABLE_GUID) == 0) { -			efi.sal_systab = config_tables[i].table; -			printk(" SALsystab=0x%lx", config_tables[i].table); -		} else if (efi_guidcmp(config_tables[i].guid, HCDP_TABLE_GUID) == 0) { -			efi.hcdp = config_tables[i].table; -			printk(" HCDP=0x%lx", config_tables[i].table); -		} else if (efi_guidcmp(config_tables[i].guid, -			 PROCESSOR_ABSTRACTION_LAYER_OVERWRITE_GUID) == 0) { -			palo_phys = config_tables[i].table; -			printk(" PALO=0x%lx", config_tables[i].table); -		} -	} -	printk("\n"); +	if (efi_config_init(arch_tables) != 0) +		return;  	if (palo_phys != EFI_INVALID_TABLE_ADDR)  		handle_palo(palo_phys); @@ -689,6 +662,8 @@ efi_enter_virtual_mode (void)  		return;  	} +	set_bit(EFI_RUNTIME_SERVICES, &efi.flags); +  	/*  	 * Now that EFI is in virtual mode, we call the EFI functions more  	 * efficiently: diff --git a/arch/ia64/kernel/elfcore.c b/arch/ia64/kernel/elfcore.c index bac1639bc32..04bc8fd5f89 100644 --- a/arch/ia64/kernel/elfcore.c +++ b/arch/ia64/kernel/elfcore.c @@ -11,8 +11,7 @@ Elf64_Half elf_core_extra_phdrs(void)  	return GATE_EHDR->e_phnum;  } -int elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size, -			       unsigned long limit) +int elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset)  {  	const struct elf_phdr *const gate_phdrs =  		(const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff); @@ -35,15 +34,13 @@ int elf_core_write_extra_phdrs(struct file *file, loff_t offset, size_t *size,  			phdr.p_offset += ofs;  		}  		phdr.p_paddr = 0; /* match other core phdrs */ -		*size += sizeof(phdr); -		if (*size > limit || !dump_write(file, &phdr, sizeof(phdr))) +		if (!dump_emit(cprm, &phdr, sizeof(phdr)))  			return 0;  	}  	return 1;  } -int elf_core_write_extra_data(struct file *file, size_t *size, -			      unsigned long limit) +int elf_core_write_extra_data(struct coredump_params *cprm)  {  	const struct elf_phdr *const gate_phdrs =  		(const struct elf_phdr *) (GATE_ADDR + GATE_EHDR->e_phoff); @@ -54,8 +51,7 @@ int elf_core_write_extra_data(struct file *file, size_t *size,  			void *addr = (void *)gate_phdrs[i].p_vaddr;  			size_t memsz = PAGE_ALIGN(gate_phdrs[i].p_memsz); -			*size += memsz; -			if (*size > limit || !dump_write(file, addr, memsz)) +			if (!dump_emit(cprm, addr, memsz))  				return 0;  			break;  		} diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S index 7a53530f22c..ba3d03503e8 100644 --- a/arch/ia64/kernel/entry.S +++ b/arch/ia64/kernel/entry.S @@ -1169,21 +1169,8 @@ skip_rbs_switch:  .work_pending:  	tbit.z p6,p0=r31,TIF_NEED_RESCHED	// is resched not needed?  (p6)	br.cond.sptk.few .notify -#ifdef CONFIG_PREEMPT -(pKStk) dep r21=-1,r0,PREEMPT_ACTIVE_BIT,1 -	;; -(pKStk) st4 [r20]=r21 -#endif -	SSM_PSR_I(p0, p6, r2)	// enable interrupts -	br.call.spnt.many rp=schedule +	br.call.spnt.many rp=preempt_schedule_irq  .ret9:	cmp.eq p6,p0=r0,r0	// p6 <- 1 (re-check) -	RSM_PSR_I(p0, r2, r20)	// disable interrupts -	;; -#ifdef CONFIG_PREEMPT -(pKStk)	adds r20=TI_PRE_COUNT+IA64_TASK_SIZE,r13 -	;; -(pKStk)	st4 [r20]=r0		// preempt_count() <- 0 -#endif  (pLvSys)br.cond.sptk.few  __paravirt_pending_syscall_end  	br.cond.sptk.many .work_processed_kernel @@ -1786,6 +1773,9 @@ sys_call_table:  	data8 sys_process_vm_writev  	data8 sys_accept4  	data8 sys_finit_module			// 1335 +	data8 sys_sched_setattr +	data8 sys_sched_getattr +	data8 sys_renameat2  	.org sys_call_table + 8*NR_syscalls	// guard against failures to increase NR_syscalls  #endif /* __IA64_ASM_PARAVIRTUALIZED_NATIVE */ diff --git a/arch/ia64/kernel/err_inject.c b/arch/ia64/kernel/err_inject.c index f59c0b844e8..0c161ed6d18 100644 --- a/arch/ia64/kernel/err_inject.c +++ b/arch/ia64/kernel/err_inject.c @@ -269,12 +269,17 @@ err_inject_init(void)  #ifdef ERR_INJ_DEBUG  	printk(KERN_INFO "Enter error injection driver.\n");  #endif + +	cpu_notifier_register_begin(); +  	for_each_online_cpu(i) {  		err_inject_cpu_callback(&err_inject_cpu_notifier, CPU_ONLINE,  				(void *)(long)i);  	} -	register_hotcpu_notifier(&err_inject_cpu_notifier); +	__register_hotcpu_notifier(&err_inject_cpu_notifier); + +	cpu_notifier_register_done();  	return 0;  } @@ -288,11 +293,17 @@ err_inject_exit(void)  #ifdef ERR_INJ_DEBUG  	printk(KERN_INFO "Exit error injection driver.\n");  #endif + +	cpu_notifier_register_begin(); +  	for_each_online_cpu(i) {  		sys_dev = get_cpu_device(i);  		sysfs_remove_group(&sys_dev->kobj, &err_inject_attr_group);  	} -	unregister_hotcpu_notifier(&err_inject_cpu_notifier); + +	__unregister_hotcpu_notifier(&err_inject_cpu_notifier); + +	cpu_notifier_register_done();  }  module_init(err_inject_init); diff --git a/arch/ia64/kernel/ftrace.c b/arch/ia64/kernel/ftrace.c index 7fc8c961b1f..3b0c2aa0785 100644 --- a/arch/ia64/kernel/ftrace.c +++ b/arch/ia64/kernel/ftrace.c @@ -198,9 +198,7 @@ int ftrace_update_ftrace_func(ftrace_func_t func)  }  /* run from kstop_machine */ -int __init ftrace_dyn_arch_init(void *data) +int __init ftrace_dyn_arch_init(void)  { -	*(unsigned long *)data = 0; -  	return 0;  } diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S index 991ca336b8a..a4acddad0c7 100644 --- a/arch/ia64/kernel/head.S +++ b/arch/ia64/kernel/head.S @@ -259,7 +259,7 @@ start_ap:  	 * Switch into virtual mode:  	 */  	movl r16=(IA64_PSR_IT|IA64_PSR_IC|IA64_PSR_DT|IA64_PSR_RT|IA64_PSR_DFH|IA64_PSR_BN \ -		  |IA64_PSR_DI|IA64_PSR_AC) +		  |IA64_PSR_DI)  	;;  	mov cr.ipsr=r16  	movl r17=1f @@ -416,8 +416,6 @@ start_ap:  default_setup_hook = 0		// Currently nothing needs to be done. -	.weak xen_setup_hook -  	.global hypervisor_type  hypervisor_type:  	data8		PARAVIRT_HYPERVISOR_TYPE_DEFAULT @@ -426,7 +424,6 @@ hypervisor_type:  hypervisor_setup_hooks:  	data8		default_setup_hook -	data8		xen_setup_hook  num_hypervisor_hooks = (. - hypervisor_setup_hooks) / 8  	.previous diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c index 19f107be734..cd44a57c73b 100644 --- a/arch/ia64/kernel/iosapic.c +++ b/arch/ia64/kernel/iosapic.c @@ -735,7 +735,7 @@ iosapic_register_intr (unsigned int gsi,  		rte = find_rte(irq, gsi);  		if(iosapic_intr_info[irq].count == 0) {  			assign_irq_vector(irq); -			dynamic_irq_init(irq); +			irq_init_desc(irq);  		} else if (rte->refcnt != NO_REF_RTE) {  			rte->refcnt++;  			goto unlock_iosapic_lock; diff --git a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c index 1034884b77d..03ea78ed64a 100644 --- a/arch/ia64/kernel/irq_ia64.c +++ b/arch/ia64/kernel/irq_ia64.c @@ -93,14 +93,6 @@ static int irq_status[NR_IRQS] = {  	[0 ... NR_IRQS -1] = IRQ_UNUSED  }; -int check_irq_used(int irq) -{ -	if (irq_status[irq] == IRQ_USED) -		return 1; - -	return -1; -} -  static inline int find_unassigned_irq(void)  {  	int irq; @@ -364,7 +356,6 @@ static irqreturn_t smp_irq_move_cleanup_interrupt(int irq, void *dev_id)  static struct irqaction irq_move_irqaction = {  	.handler =	smp_irq_move_cleanup_interrupt, -	.flags =	IRQF_DISABLED,  	.name =		"irq_move"  }; @@ -391,8 +382,7 @@ void destroy_and_reserve_irq(unsigned int irq)  {  	unsigned long flags; -	dynamic_irq_cleanup(irq); - +	irq_init_desc(irq);  	spin_lock_irqsave(&vector_lock, flags);  	__clear_irq_vector(irq);  	irq_status[irq] = IRQ_RSVD; @@ -425,13 +415,13 @@ int create_irq(void)   out:  	spin_unlock_irqrestore(&vector_lock, flags);  	if (irq >= 0) -		dynamic_irq_init(irq); +		irq_init_desc(irq);  	return irq;  }  void destroy_irq(unsigned int irq)  { -	dynamic_irq_cleanup(irq); +	irq_init_desc(irq);  	clear_irq_vector(irq);  } @@ -489,14 +479,13 @@ ia64_handle_irq (ia64_vector vector, struct pt_regs *regs)  	ia64_srlz_d();  	while (vector != IA64_SPURIOUS_INT_VECTOR) {  		int irq = local_vector_to_irq(vector); -		struct irq_desc *desc = irq_to_desc(irq);  		if (unlikely(IS_LOCAL_TLB_FLUSH(vector))) {  			smp_local_flush_tlb(); -			kstat_incr_irqs_this_cpu(irq, desc); +			kstat_incr_irq_this_cpu(irq);  		} else if (unlikely(IS_RESCHEDULE(vector))) {  			scheduler_ipi(); -			kstat_incr_irqs_this_cpu(irq, desc); +			kstat_incr_irq_this_cpu(irq);  		} else {  			ia64_setreg(_IA64_REG_CR_TPR, vector);  			ia64_srlz_d(); @@ -549,13 +538,12 @@ void ia64_process_pending_intr(void)  	  */  	while (vector != IA64_SPURIOUS_INT_VECTOR) {  		int irq = local_vector_to_irq(vector); -		struct irq_desc *desc = irq_to_desc(irq);  		if (unlikely(IS_LOCAL_TLB_FLUSH(vector))) {  			smp_local_flush_tlb(); -			kstat_incr_irqs_this_cpu(irq, desc); +			kstat_incr_irq_this_cpu(irq);  		} else if (unlikely(IS_RESCHEDULE(vector))) { -			kstat_incr_irqs_this_cpu(irq, desc); +			kstat_incr_irq_this_cpu(irq);  		} else {  			struct pt_regs *old_regs = set_irq_regs(NULL); @@ -602,7 +590,6 @@ static irqreturn_t dummy_handler (int irq, void *dev_id)  static struct irqaction ipi_irqaction = {  	.handler =	handle_IPI, -	.flags =	IRQF_DISABLED,  	.name =		"IPI"  }; @@ -611,13 +598,11 @@ static struct irqaction ipi_irqaction = {   */  static struct irqaction resched_irqaction = {  	.handler =	dummy_handler, -	.flags =	IRQF_DISABLED,  	.name =		"resched"  };  static struct irqaction tlb_irqaction = {  	.handler =	dummy_handler, -	.flags =	IRQF_DISABLED,  	.name =		"tlb_flush"  }; diff --git a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S index 689ffcaa284..18e794a5724 100644 --- a/arch/ia64/kernel/ivt.S +++ b/arch/ia64/kernel/ivt.S @@ -58,7 +58,7 @@  #include <asm/unistd.h>  #include <asm/errno.h> -#if 1 +#if 0  # define PSR_DEFAULT_BITS	psr.ac  #else  # define PSR_DEFAULT_BITS	0 diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c index f8280a766a7..074fde49c9e 100644 --- a/arch/ia64/kernel/kprobes.c +++ b/arch/ia64/kernel/kprobes.c @@ -947,7 +947,7 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)  	case KPROBE_HIT_SSDONE:  		/*  		 * We increment the nmissed count for accounting, -		 * we can also use npre/npostfault count for accouting +		 * we can also use npre/npostfault count for accounting  		 * these specific fault cases.  		 */  		kprobes_inc_nmissed_count(cur); diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c index b8edfa75a83..db7b36bb068 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c @@ -217,7 +217,7 @@ void ia64_mca_printk(const char *fmt, ...)  	/* Copy the output into mlogbuf */  	if (oops_in_progress) {  		/* mlogbuf was abandoned, use printk directly instead. */ -		printk(temp_buf); +		printk("%s", temp_buf);  	} else {  		spin_lock(&mlogbuf_wlock);  		for (p = temp_buf; *p; p++) { @@ -268,7 +268,7 @@ void ia64_mlogbuf_dump(void)  		}  		*p = '\0';  		if (temp_buf[0]) -			printk(temp_buf); +			printk("%s", temp_buf);  		mlogbuf_start = index;  		mlogbuf_timestamp = 0; @@ -1772,38 +1772,32 @@ __setup("disable_cpe_poll", ia64_mca_disable_cpe_polling);  static struct irqaction cmci_irqaction = {  	.handler =	ia64_mca_cmc_int_handler, -	.flags =	IRQF_DISABLED,  	.name =		"cmc_hndlr"  };  static struct irqaction cmcp_irqaction = {  	.handler =	ia64_mca_cmc_int_caller, -	.flags =	IRQF_DISABLED,  	.name =		"cmc_poll"  };  static struct irqaction mca_rdzv_irqaction = {  	.handler =	ia64_mca_rendez_int_handler, -	.flags =	IRQF_DISABLED,  	.name =		"mca_rdzv"  };  static struct irqaction mca_wkup_irqaction = {  	.handler =	ia64_mca_wakeup_int_handler, -	.flags =	IRQF_DISABLED,  	.name =		"mca_wkup"  };  #ifdef CONFIG_ACPI  static struct irqaction mca_cpe_irqaction = {  	.handler =	ia64_mca_cpe_int_handler, -	.flags =	IRQF_DISABLED,  	.name =		"cpe_hndlr"  };  static struct irqaction mca_cpep_irqaction = {  	.handler =	ia64_mca_cpe_int_caller, -	.flags =	IRQF_DISABLED,  	.name =		"cpe_poll"  };  #endif /* CONFIG_ACPI */ diff --git a/arch/ia64/kernel/msi_ia64.c b/arch/ia64/kernel/msi_ia64.c index fb2f1e62287..c430f9198d1 100644 --- a/arch/ia64/kernel/msi_ia64.c +++ b/arch/ia64/kernel/msi_ia64.c @@ -17,12 +17,9 @@ static int ia64_set_msi_irq_affinity(struct irq_data *idata,  {  	struct msi_msg msg;  	u32 addr, data; -	int cpu = first_cpu(*cpu_mask); +	int cpu = cpumask_first_and(cpu_mask, cpu_online_mask);  	unsigned int irq = idata->irq; -	if (!cpu_online(cpu)) -		return -1; -  	if (irq_prepare_move(irq, cpu))  		return -1; @@ -139,10 +136,7 @@ static int dmar_msi_set_affinity(struct irq_data *data,  	unsigned int irq = data->irq;  	struct irq_cfg *cfg = irq_cfg + irq;  	struct msi_msg msg; -	int cpu = cpumask_first(mask); - -	if (!cpu_online(cpu)) -		return -1; +	int cpu = cpumask_first_and(mask, cpu_online_mask);  	if (irq_prepare_move(irq, cpu))  		return -1; diff --git a/arch/ia64/kernel/nr-irqs.c b/arch/ia64/kernel/nr-irqs.c index ee564575148..f6769cd54bd 100644 --- a/arch/ia64/kernel/nr-irqs.c +++ b/arch/ia64/kernel/nr-irqs.c @@ -10,15 +10,11 @@  #include <linux/kbuild.h>  #include <linux/threads.h>  #include <asm/native/irq.h> -#include <asm/xen/irq.h>  void foo(void)  {  	union paravirt_nr_irqs_max {  		char ia64_native_nr_irqs[IA64_NATIVE_NR_IRQS]; -#ifdef CONFIG_XEN -		char xen_nr_irqs[XEN_NR_IRQS]; -#endif  	};  	DEFINE(NR_IRQS, sizeof (union paravirt_nr_irqs_max)); diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c index ab333284f4b..c39c3cd3ac3 100644 --- a/arch/ia64/kernel/palinfo.c +++ b/arch/ia64/kernel/palinfo.c @@ -996,13 +996,17 @@ palinfo_init(void)  	if (!palinfo_dir)  		return -ENOMEM; +	cpu_notifier_register_begin(); +  	/* Create palinfo dirs in /proc for all online cpus */  	for_each_online_cpu(i) {  		create_palinfo_proc_entries(i);  	}  	/* Register for future delivery via notify registration */ -	register_hotcpu_notifier(&palinfo_cpu_notifier); +	__register_hotcpu_notifier(&palinfo_cpu_notifier); + +	cpu_notifier_register_done();  	return 0;  } diff --git a/arch/ia64/kernel/paravirt_inst.h b/arch/ia64/kernel/paravirt_inst.h index 64d6d810c64..1ad7512b5f6 100644 --- a/arch/ia64/kernel/paravirt_inst.h +++ b/arch/ia64/kernel/paravirt_inst.h @@ -22,9 +22,6 @@  #ifdef __IA64_ASM_PARAVIRTUALIZED_PVCHECK  #include <asm/native/pvchk_inst.h> -#elif defined(__IA64_ASM_PARAVIRTUALIZED_XEN) -#include <asm/xen/inst.h> -#include <asm/xen/minstate.h>  #else  #include <asm/native/inst.h>  #endif diff --git a/arch/ia64/kernel/paravirt_patchlist.h b/arch/ia64/kernel/paravirt_patchlist.h index 0684aa6c650..67cffc3643a 100644 --- a/arch/ia64/kernel/paravirt_patchlist.h +++ b/arch/ia64/kernel/paravirt_patchlist.h @@ -20,9 +20,5 @@   *   */ -#if defined(__IA64_GATE_PARAVIRTUALIZED_XEN) -#include <asm/xen/patchlist.h> -#else  #include <asm/native/patchlist.h> -#endif diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index 5a9ff1c3c3e..5845ffea67c 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c @@ -521,7 +521,7 @@ static pmu_config_t		*pmu_conf;  pfm_sysctl_t pfm_sysctl;  EXPORT_SYMBOL(pfm_sysctl); -static ctl_table pfm_ctl_table[]={ +static struct ctl_table pfm_ctl_table[] = {  	{  		.procname	= "debug",  		.data		= &pfm_sysctl.debug, @@ -552,7 +552,7 @@ static ctl_table pfm_ctl_table[]={  	},  	{}  }; -static ctl_table pfm_sysctl_dir[] = { +static struct ctl_table pfm_sysctl_dir[] = {  	{  		.procname	= "perfmon",  		.mode		= 0555, @@ -560,7 +560,7 @@ static ctl_table pfm_sysctl_dir[] = {  	},   	{}  }; -static ctl_table pfm_sysctl_root[] = { +static struct ctl_table pfm_sysctl_root[] = {  	{  		.procname	= "kernel",  		.mode		= 0555, @@ -2166,12 +2166,6 @@ static const struct file_operations pfm_file_ops = {  	.flush		= pfm_flush  }; -static int -pfmfs_delete_dentry(const struct dentry *dentry) -{ -	return 1; -} -  static char *pfmfs_dname(struct dentry *dentry, char *buffer, int buflen)  {  	return dynamic_dname(dentry, buffer, buflen, "pfm:[%lu]", @@ -2179,7 +2173,7 @@ static char *pfmfs_dname(struct dentry *dentry, char *buffer, int buflen)  }  static const struct dentry_operations pfmfs_dentry_operations = { -	.d_delete = pfmfs_delete_dentry, +	.d_delete = always_delete_dentry,  	.d_dname = pfmfs_dname,  }; @@ -6393,7 +6387,6 @@ pfm_flush_pmds(struct task_struct *task, pfm_context_t *ctx)  static struct irqaction perfmon_irqaction = {  	.handler = pfm_interrupt_handler, -	.flags   = IRQF_DISABLED,  	.name    = "perfmon"  }; diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c index 960a396f592..ee9719eebb1 100644 --- a/arch/ia64/kernel/salinfo.c +++ b/arch/ia64/kernel/salinfo.c @@ -635,6 +635,8 @@ salinfo_init(void)  					   (void *)salinfo_entries[i].feature);  	} +	cpu_notifier_register_begin(); +  	for (i = 0; i < ARRAY_SIZE(salinfo_log_name); i++) {  		data = salinfo_data + i;  		data->type = i; @@ -669,7 +671,9 @@ salinfo_init(void)  	salinfo_timer.function = &salinfo_timeout;  	add_timer(&salinfo_timer); -	register_hotcpu_notifier(&salinfo_cpu_notifier); +	__register_hotcpu_notifier(&salinfo_cpu_notifier); + +	cpu_notifier_register_done();  	return 0;  } diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 4fc2e9569bb..d86669bcdfb 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c @@ -1063,6 +1063,7 @@ check_bugs (void)  static int __init run_dmi_scan(void)  {  	dmi_scan_machine(); +	dmi_memdev_walk();  	dmi_set_dump_stack_arch_desc();  	return 0;  } diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c index 3637e03d228..33cab9a8adf 100644 --- a/arch/ia64/kernel/signal.c +++ b/arch/ia64/kernel/signal.c @@ -105,7 +105,7 @@ restore_sigcontext (struct sigcontext __user *sc, struct sigscratch *scr)  }  int -copy_siginfo_to_user (siginfo_t __user *to, siginfo_t *from) +copy_siginfo_to_user (siginfo_t __user *to, const siginfo_t *from)  {  	if (!access_ok(VERIFY_WRITE, to, sizeof(siginfo_t)))  		return -EFAULT; diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c index fbaac1afb84..71c52bc7c28 100644 --- a/arch/ia64/kernel/time.c +++ b/arch/ia64/kernel/time.c @@ -380,7 +380,7 @@ static cycle_t itc_get_cycles(struct clocksource *cs)  static struct irqaction timer_irqaction = {  	.handler =	timer_interrupt, -	.flags =	IRQF_DISABLED | IRQF_IRQPOLL, +	.flags =	IRQF_IRQPOLL,  	.name =		"timer"  }; diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c index ca69a5a96dc..f295f9abba4 100644 --- a/arch/ia64/kernel/topology.c +++ b/arch/ia64/kernel/topology.c @@ -454,12 +454,16 @@ static int __init cache_sysfs_init(void)  {  	int i; +	cpu_notifier_register_begin(); +  	for_each_online_cpu(i) {  		struct device *sys_dev = get_cpu_device((unsigned int)i);  		cache_add_dev(sys_dev);  	} -	register_hotcpu_notifier(&cache_cpu_notifier); +	__register_hotcpu_notifier(&cache_cpu_notifier); + +	cpu_notifier_register_done();  	return 0;  } diff --git a/arch/ia64/kernel/uncached.c b/arch/ia64/kernel/uncached.c index a96bcf83a73..20e8a9b21d7 100644 --- a/arch/ia64/kernel/uncached.c +++ b/arch/ia64/kernel/uncached.c @@ -98,7 +98,7 @@ static int uncached_add_chunk(struct uncached_pool *uc_pool, int nid)  	/* attempt to allocate a granule's worth of cached memory pages */  	page = alloc_pages_exact_node(nid, -				GFP_KERNEL | __GFP_ZERO | GFP_THISNODE, +				GFP_KERNEL | __GFP_ZERO | __GFP_THISNODE,  				IA64_GRANULE_SHIFT-PAGE_SHIFT);  	if (!page) {  		mutex_unlock(&uc_pool->add_chunk_mutex); diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S index 0ccb28fab27..84f8a52ac5a 100644 --- a/arch/ia64/kernel/vmlinux.lds.S +++ b/arch/ia64/kernel/vmlinux.lds.S @@ -182,12 +182,6 @@ SECTIONS {  		__start_gate_section = .;  		*(.data..gate)  		__stop_gate_section = .; -#ifdef CONFIG_XEN -		. = ALIGN(PAGE_SIZE); -		__xen_start_gate_section = .; -		*(.data..gate.xen) -		__xen_stop_gate_section = .; -#endif  	}  	/*  	 * make sure the gate page doesn't expose diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index bdfd8789b37..6a4309bb821 100644 --- a/arch/ia64/kvm/kvm-ia64.c +++ b/arch/ia64/kvm/kvm-ia64.c @@ -199,6 +199,7 @@ int kvm_dev_ioctl_check_extension(long ext)  	case KVM_CAP_IRQCHIP:  	case KVM_CAP_MP_STATE:  	case KVM_CAP_IRQ_INJECT_STATUS: +	case KVM_CAP_IOAPIC_POLARITY_IGNORED:  		r = 1;  		break;  	case KVM_CAP_COALESCED_MMIO: @@ -702,7 +703,7 @@ again:  out:  	srcu_read_unlock(&vcpu->kvm->srcu, idx);  	if (r > 0) { -		kvm_resched(vcpu); +		cond_resched();  		idx = srcu_read_lock(&vcpu->kvm->srcu);  		goto again;  	} @@ -1550,12 +1551,13 @@ int kvm_arch_vcpu_fault(struct kvm_vcpu *vcpu, struct vm_fault *vmf)  	return VM_FAULT_SIGBUS;  } -void kvm_arch_free_memslot(struct kvm_memory_slot *free, +void kvm_arch_free_memslot(struct kvm *kvm, struct kvm_memory_slot *free,  			   struct kvm_memory_slot *dont)  {  } -int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages) +int kvm_arch_create_memslot(struct kvm *kvm, struct kvm_memory_slot *slot, +			    unsigned long npages)  {  	return 0;  } diff --git a/arch/ia64/kvm/vmm_ivt.S b/arch/ia64/kvm/vmm_ivt.S index 24018484c6e..397e34a63e1 100644 --- a/arch/ia64/kvm/vmm_ivt.S +++ b/arch/ia64/kvm/vmm_ivt.S @@ -64,7 +64,7 @@  #include "kvm_minstate.h"  #include "vti.h" -#if 1 +#if 0  # define PSR_DEFAULT_BITS   psr.ac  #else  # define PSR_DEFAULT_BITS   0 diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c index da5237d636d..52715a71aed 100644 --- a/arch/ia64/mm/contig.c +++ b/arch/ia64/mm/contig.c @@ -31,74 +31,6 @@  static unsigned long max_gap;  #endif -/** - * show_mem - give short summary of memory stats - * - * Shows a simple page count of reserved and used pages in the system. - * For discontig machines, it does this on a per-pgdat basis. - */ -void show_mem(unsigned int filter) -{ -	int i, total_reserved = 0; -	int total_shared = 0, total_cached = 0; -	unsigned long total_present = 0; -	pg_data_t *pgdat; - -	printk(KERN_INFO "Mem-info:\n"); -	show_free_areas(filter); -	printk(KERN_INFO "Node memory in pages:\n"); -	if (filter & SHOW_MEM_FILTER_PAGE_COUNT) -		return; -	for_each_online_pgdat(pgdat) { -		unsigned long present; -		unsigned long flags; -		int shared = 0, cached = 0, reserved = 0; -		int nid = pgdat->node_id; - -		if (skip_free_areas_node(filter, nid)) -			continue; -		pgdat_resize_lock(pgdat, &flags); -		present = pgdat->node_present_pages; -		for(i = 0; i < pgdat->node_spanned_pages; i++) { -			struct page *page; -			if (unlikely(i % MAX_ORDER_NR_PAGES == 0)) -				touch_nmi_watchdog(); -			if (pfn_valid(pgdat->node_start_pfn + i)) -				page = pfn_to_page(pgdat->node_start_pfn + i); -			else { -#ifdef CONFIG_VIRTUAL_MEM_MAP -				if (max_gap < LARGE_GAP) -					continue; -#endif -				i = vmemmap_find_next_valid_pfn(nid, i) - 1; -				continue; -			} -			if (PageReserved(page)) -				reserved++; -			else if (PageSwapCache(page)) -				cached++; -			else if (page_count(page)) -				shared += page_count(page)-1; -		} -		pgdat_resize_unlock(pgdat, &flags); -		total_present += present; -		total_reserved += reserved; -		total_cached += cached; -		total_shared += shared; -		printk(KERN_INFO "Node %4d:  RAM: %11ld, rsvd: %8d, " -		       "shrd: %10d, swpd: %10d\n", nid, -		       present, reserved, shared, cached); -	} -	printk(KERN_INFO "%ld pages of RAM\n", total_present); -	printk(KERN_INFO "%d reserved pages\n", total_reserved); -	printk(KERN_INFO "%d pages shared\n", total_shared); -	printk(KERN_INFO "%d pages swap cached\n", total_cached); -	printk(KERN_INFO "Total of %ld pages in page table cache\n", -	       quicklist_total_size()); -	printk(KERN_INFO "%ld free buffer pages\n", nr_free_buffer_pages()); -} - -  /* physical address where the bootmem map is located */  unsigned long bootmap_start; diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c index 2de08f4d993..87862680536 100644 --- a/arch/ia64/mm/discontig.c +++ b/arch/ia64/mm/discontig.c @@ -608,69 +608,6 @@ void *per_cpu_init(void)  #endif /* CONFIG_SMP */  /** - * show_mem - give short summary of memory stats - * - * Shows a simple page count of reserved and used pages in the system. - * For discontig machines, it does this on a per-pgdat basis. - */ -void show_mem(unsigned int filter) -{ -	int i, total_reserved = 0; -	int total_shared = 0, total_cached = 0; -	unsigned long total_present = 0; -	pg_data_t *pgdat; - -	printk(KERN_INFO "Mem-info:\n"); -	show_free_areas(filter); -	if (filter & SHOW_MEM_FILTER_PAGE_COUNT) -		return; -	printk(KERN_INFO "Node memory in pages:\n"); -	for_each_online_pgdat(pgdat) { -		unsigned long present; -		unsigned long flags; -		int shared = 0, cached = 0, reserved = 0; -		int nid = pgdat->node_id; - -		if (skip_free_areas_node(filter, nid)) -			continue; -		pgdat_resize_lock(pgdat, &flags); -		present = pgdat->node_present_pages; -		for(i = 0; i < pgdat->node_spanned_pages; i++) { -			struct page *page; -			if (unlikely(i % MAX_ORDER_NR_PAGES == 0)) -				touch_nmi_watchdog(); -			if (pfn_valid(pgdat->node_start_pfn + i)) -				page = pfn_to_page(pgdat->node_start_pfn + i); -			else { -				i = vmemmap_find_next_valid_pfn(nid, i) - 1; -				continue; -			} -			if (PageReserved(page)) -				reserved++; -			else if (PageSwapCache(page)) -				cached++; -			else if (page_count(page)) -				shared += page_count(page)-1; -		} -		pgdat_resize_unlock(pgdat, &flags); -		total_present += present; -		total_reserved += reserved; -		total_cached += cached; -		total_shared += shared; -		printk(KERN_INFO "Node %4d:  RAM: %11ld, rsvd: %8d, " -		       "shrd: %10d, swpd: %10d\n", nid, -		       present, reserved, shared, cached); -	} -	printk(KERN_INFO "%ld pages of RAM\n", total_present); -	printk(KERN_INFO "%d reserved pages\n", total_reserved); -	printk(KERN_INFO "%d pages shared\n", total_shared); -	printk(KERN_INFO "%d pages swap cached\n", total_cached); -	printk(KERN_INFO "Total of %ld pages in page table cache\n", -	       quicklist_total_size()); -	printk(KERN_INFO "%ld free buffer pages\n", nr_free_buffer_pages()); -} - -/**   * call_pernode_memory - use SRAT to call callback functions with node info   * @start: physical start of range   * @len: length of range diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c index 68232db98ba..76069c18ee4 100644 --- a/arch/ia64/mm/hugetlbpage.c +++ b/arch/ia64/mm/hugetlbpage.c @@ -114,11 +114,6 @@ int pud_huge(pud_t pud)  	return 0;  } -int pmd_huge_support(void) -{ -	return 0; -} -  struct page *  follow_huge_pmd(struct mm_struct *mm, unsigned long address, pmd_t *pmd, int write)  { diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index b6f7f43424e..25c350264a4 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c @@ -357,9 +357,7 @@ int vmemmap_find_next_valid_pfn(int node, int i)  	end_address = (unsigned long) &vmem_map[pgdat->node_start_pfn + i];  	end_address = PAGE_ALIGN(end_address); - -	stop_address = (unsigned long) &vmem_map[ -		pgdat->node_start_pfn + pgdat->node_spanned_pages]; +	stop_address = (unsigned long) &vmem_map[pgdat_end_pfn(pgdat)];  	do {  		pgd_t *pgd; @@ -686,3 +684,51 @@ per_linux32_init(void)  }  __initcall(per_linux32_init); + +/** + * show_mem - give short summary of memory stats + * + * Shows a simple page count of reserved and used pages in the system. + * For discontig machines, it does this on a per-pgdat basis. + */ +void show_mem(unsigned int filter) +{ +	int total_reserved = 0; +	unsigned long total_present = 0; +	pg_data_t *pgdat; + +	printk(KERN_INFO "Mem-info:\n"); +	show_free_areas(filter); +	printk(KERN_INFO "Node memory in pages:\n"); +	for_each_online_pgdat(pgdat) { +		unsigned long present; +		unsigned long flags; +		int reserved = 0; +		int nid = pgdat->node_id; +		int zoneid; + +		if (skip_free_areas_node(filter, nid)) +			continue; +		pgdat_resize_lock(pgdat, &flags); + +		for (zoneid = 0; zoneid < MAX_NR_ZONES; zoneid++) { +			struct zone *zone = &pgdat->node_zones[zoneid]; +			if (!populated_zone(zone)) +				continue; + +			reserved += zone->present_pages - zone->managed_pages; +		} +		present = pgdat->node_present_pages; + +		pgdat_resize_unlock(pgdat, &flags); +		total_present += present; +		total_reserved += reserved; +		printk(KERN_INFO "Node %4d:  RAM: %11ld, rsvd: %8d, ", +		       nid, present, reserved); +	} +	printk(KERN_INFO "%ld pages of RAM\n", total_present); +	printk(KERN_INFO "%d reserved pages\n", total_reserved); +	printk(KERN_INFO "Total of %ld pages in page table cache\n", +	       quicklist_total_size()); +	printk(KERN_INFO "%ld free buffer pages\n", nr_free_buffer_pages()); +} diff --git a/arch/ia64/pci/fixup.c b/arch/ia64/pci/fixup.c index 5dc969dd4ac..1fe9aa5068e 100644 --- a/arch/ia64/pci/fixup.c +++ b/arch/ia64/pci/fixup.c @@ -5,6 +5,7 @@  #include <linux/pci.h>  #include <linux/init.h> +#include <linux/vgaarb.h>  #include <asm/machvec.h> @@ -19,9 +20,10 @@   * IORESOURCE_ROM_SHADOW is used to associate the boot video   * card with this copy. On laptops this copy has to be used since   * the main ROM may be compressed or combined with another image. - * See pci_map_rom() for use of this flag. IORESOURCE_ROM_SHADOW - * is marked here since the boot video device will be the only enabled - * video device at this point. + * See pci_map_rom() for use of this flag. Before marking the device + * with IORESOURCE_ROM_SHADOW check if a vga_default_device is already set + * by either arch cde or vga-arbitration, if so only apply the fixup to this + * already determined primary video card.   */  static void pci_fixup_video(struct pci_dev *pdev) @@ -35,9 +37,6 @@ static void pci_fixup_video(struct pci_dev *pdev)  		return;  	/* Maybe, this machine supports legacy memory map. */ -	if ((pdev->class >> 8) != PCI_CLASS_DISPLAY_VGA) -		return; -  	/* Is VGA routed to us? */  	bus = pdev->bus;  	while (bus) { @@ -50,9 +49,7 @@ static void pci_fixup_video(struct pci_dev *pdev)  		 * type BRIDGE, or CARDBUS. Host to PCI controllers use  		 * PCI header type NORMAL.  		 */ -		if (bridge -		    &&((bridge->hdr_type == PCI_HEADER_TYPE_BRIDGE) -		       ||(bridge->hdr_type == PCI_HEADER_TYPE_CARDBUS))) { +		if (bridge && (pci_is_bridge(bridge))) {  			pci_read_config_word(bridge, PCI_BRIDGE_CONTROL,  						&config);  			if (!(config & PCI_BRIDGE_CTL_VGA)) @@ -60,10 +57,14 @@ static void pci_fixup_video(struct pci_dev *pdev)  		}  		bus = bus->parent;  	} -	pci_read_config_word(pdev, PCI_COMMAND, &config); -	if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { -		pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; -		dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n"); +	if (!vga_default_device() || pdev == vga_default_device()) { +		pci_read_config_word(pdev, PCI_COMMAND, &config); +		if (config & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) { +			pdev->resource[PCI_ROM_RESOURCE].flags |= IORESOURCE_ROM_SHADOW; +			dev_printk(KERN_DEBUG, &pdev->dev, "Boot video device\n"); +			vga_set_default_device(pdev); +		}  	}  } -DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pci_fixup_video); +DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID, +				PCI_CLASS_DISPLAY_VGA, 8, pci_fixup_video); diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 2326790b7d8..291a582777c 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c @@ -126,7 +126,6 @@ static struct pci_controller *alloc_pci_controller(int seg)  		return NULL;  	controller->segment = seg; -	controller->node = -1;  	return controller;  } @@ -430,19 +429,14 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)  	struct pci_root_info *info = NULL;  	int busnum = root->secondary.start;  	struct pci_bus *pbus; -	int pxm, ret; +	int ret;  	controller = alloc_pci_controller(domain);  	if (!controller)  		return NULL; -	controller->acpi_handle = device->handle; - -	pxm = acpi_get_pxm(controller->acpi_handle); -#ifdef CONFIG_NUMA -	if (pxm >= 0) -		controller->node = pxm_to_node(pxm); -#endif +	controller->companion = device; +	controller->node = acpi_get_node(device->handle);  	info = kzalloc(sizeof(*info), GFP_KERNEL);  	if (!info) { @@ -489,7 +483,7 @@ int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)  {  	struct pci_controller *controller = bridge->bus->sysdata; -	ACPI_HANDLE_SET(&bridge->dev, controller->acpi_handle); +	ACPI_COMPANION_SET(&bridge->dev, controller->companion);  	return 0;  } diff --git a/arch/ia64/sn/kernel/io_acpi_init.c b/arch/ia64/sn/kernel/io_acpi_init.c index b1725398b5a..0640739cc20 100644 --- a/arch/ia64/sn/kernel/io_acpi_init.c +++ b/arch/ia64/sn/kernel/io_acpi_init.c @@ -132,7 +132,7 @@ sn_get_bussoft_ptr(struct pci_bus *bus)  	struct acpi_resource_vendor_typed *vendor; -	handle = PCI_CONTROLLER(bus)->acpi_handle; +	handle = acpi_device_handle(PCI_CONTROLLER(bus)->companion);  	status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS,  					  &sn_uuid, &buffer);  	if (ACPI_FAILURE(status)) { @@ -360,7 +360,7 @@ sn_acpi_get_pcidev_info(struct pci_dev *dev, struct pcidev_info **pcidev_info,  	acpi_status status;  	struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL }; -	rootbus_handle = PCI_CONTROLLER(dev)->acpi_handle; +	rootbus_handle = acpi_device_handle(PCI_CONTROLLER(dev)->companion);          status = acpi_evaluate_integer(rootbus_handle, METHOD_NAME__SEG, NULL,                                         &segment);          if (ACPI_SUCCESS(status)) { diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c index 62cf4dde6a0..85d09515490 100644 --- a/arch/ia64/sn/kernel/irq.c +++ b/arch/ia64/sn/kernel/irq.c @@ -209,8 +209,8 @@ static int sn_set_affinity_irq(struct irq_data *data,  	nasid_t nasid;  	int slice; -	nasid = cpuid_to_nasid(cpumask_first(mask)); -	slice = cpuid_to_slice(cpumask_first(mask)); +	nasid = cpuid_to_nasid(cpumask_first_and(mask, cpu_online_mask)); +	slice = cpuid_to_slice(cpumask_first_and(mask, cpu_online_mask));  	list_for_each_entry_safe(sn_irq_info, sn_irq_info_safe,  				 sn_irq_lh[irq], list) diff --git a/arch/ia64/sn/kernel/msi_sn.c b/arch/ia64/sn/kernel/msi_sn.c index 2b98b9e088d..afc58d2799a 100644 --- a/arch/ia64/sn/kernel/msi_sn.c +++ b/arch/ia64/sn/kernel/msi_sn.c @@ -166,7 +166,7 @@ static int sn_set_msi_irq_affinity(struct irq_data *data,  	struct sn_pcibus_provider *provider;  	unsigned int cpu, irq = data->irq; -	cpu = cpumask_first(cpu_mask); +	cpu = cpumask_first_and(cpu_mask, cpu_online_mask);  	sn_irq_info = sn_msi_info[irq].sn_irq_info;  	if (sn_irq_info == NULL || sn_irq_info->irq_int_bit >= 0)  		return -1; diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn/pci/pci_dma.c index 3290d6e00c3..d0853e8e862 100644 --- a/arch/ia64/sn/pci/pci_dma.c +++ b/arch/ia64/sn/pci/pci_dma.c @@ -34,7 +34,7 @@   */  static int sn_dma_supported(struct device *dev, u64 mask)  { -	BUG_ON(dev->bus != &pci_bus_type); +	BUG_ON(!dev_is_pci(dev));  	if (mask < 0x7fffffff)  		return 0; @@ -50,7 +50,7 @@ static int sn_dma_supported(struct device *dev, u64 mask)   */  int sn_dma_set_mask(struct device *dev, u64 dma_mask)  { -	BUG_ON(dev->bus != &pci_bus_type); +	BUG_ON(!dev_is_pci(dev));  	if (!sn_dma_supported(dev, dma_mask))  		return 0; @@ -85,7 +85,7 @@ static void *sn_dma_alloc_coherent(struct device *dev, size_t size,  	struct pci_dev *pdev = to_pci_dev(dev);  	struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); -	BUG_ON(dev->bus != &pci_bus_type); +	BUG_ON(!dev_is_pci(dev));  	/*  	 * Allocate the memory. @@ -143,7 +143,7 @@ static void sn_dma_free_coherent(struct device *dev, size_t size, void *cpu_addr  	struct pci_dev *pdev = to_pci_dev(dev);  	struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); -	BUG_ON(dev->bus != &pci_bus_type); +	BUG_ON(!dev_is_pci(dev));  	provider->dma_unmap(pdev, dma_handle, 0);  	free_pages((unsigned long)cpu_addr, get_order(size)); @@ -187,7 +187,7 @@ static dma_addr_t sn_dma_map_page(struct device *dev, struct page *page,  	dmabarr = dma_get_attr(DMA_ATTR_WRITE_BARRIER, attrs); -	BUG_ON(dev->bus != &pci_bus_type); +	BUG_ON(!dev_is_pci(dev));  	phys_addr = __pa(cpu_addr);  	if (dmabarr) @@ -223,7 +223,7 @@ static void sn_dma_unmap_page(struct device *dev, dma_addr_t dma_addr,  	struct pci_dev *pdev = to_pci_dev(dev);  	struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); -	BUG_ON(dev->bus != &pci_bus_type); +	BUG_ON(!dev_is_pci(dev));  	provider->dma_unmap(pdev, dma_addr, dir);  } @@ -247,7 +247,7 @@ static void sn_dma_unmap_sg(struct device *dev, struct scatterlist *sgl,  	struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev);  	struct scatterlist *sg; -	BUG_ON(dev->bus != &pci_bus_type); +	BUG_ON(!dev_is_pci(dev));  	for_each_sg(sgl, sg, nhwentries, i) {  		provider->dma_unmap(pdev, sg->dma_address, dir); @@ -284,7 +284,7 @@ static int sn_dma_map_sg(struct device *dev, struct scatterlist *sgl,  	dmabarr = dma_get_attr(DMA_ATTR_WRITE_BARRIER, attrs); -	BUG_ON(dev->bus != &pci_bus_type); +	BUG_ON(!dev_is_pci(dev));  	/*  	 * Setup a DMA address for each entry in the scatterlist. @@ -323,26 +323,26 @@ static int sn_dma_map_sg(struct device *dev, struct scatterlist *sgl,  static void sn_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,  				       size_t size, enum dma_data_direction dir)  { -	BUG_ON(dev->bus != &pci_bus_type); +	BUG_ON(!dev_is_pci(dev));  }  static void sn_dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,  					  size_t size,  					  enum dma_data_direction dir)  { -	BUG_ON(dev->bus != &pci_bus_type); +	BUG_ON(!dev_is_pci(dev));  }  static void sn_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,  				   int nelems, enum dma_data_direction dir)  { -	BUG_ON(dev->bus != &pci_bus_type); +	BUG_ON(!dev_is_pci(dev));  }  static void sn_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,  				      int nelems, enum dma_data_direction dir)  { -	BUG_ON(dev->bus != &pci_bus_type); +	BUG_ON(!dev_is_pci(dev));  }  static int sn_dma_mapping_error(struct device *dev, dma_addr_t dma_addr) diff --git a/arch/ia64/xen/Kconfig b/arch/ia64/xen/Kconfig deleted file mode 100644 index 5d8a06b0ddf..00000000000 --- a/arch/ia64/xen/Kconfig +++ /dev/null @@ -1,25 +0,0 @@ -# -# This Kconfig describes xen/ia64 options -# - -config XEN -	bool "Xen hypervisor support" -	default y -	depends on PARAVIRT && MCKINLEY && IA64_PAGE_SIZE_16KB -	select XEN_XENCOMM -	select NO_IDLE_HZ -	# followings are required to save/restore. -	select ARCH_SUSPEND_POSSIBLE -	select SUSPEND -	select PM_SLEEP -	help -	  Enable Xen hypervisor support.  Resulting kernel runs -	  both as a guest OS on Xen and natively on hardware. - -config XEN_XENCOMM -	depends on XEN -	bool - -config NO_IDLE_HZ -	depends on XEN -	bool diff --git a/arch/ia64/xen/Makefile b/arch/ia64/xen/Makefile deleted file mode 100644 index e6f4a0a7422..00000000000 --- a/arch/ia64/xen/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -# -# Makefile for Xen components -# - -obj-y := hypercall.o xenivt.o xensetup.o xen_pv_ops.o irq_xen.o \ -	 hypervisor.o xencomm.o xcom_hcall.o grant-table.o time.o suspend.o \ -	 gate-data.o - -obj-$(CONFIG_IA64_GENERIC) += machvec.o - -# The gate DSO image is built using a special linker script. -include $(srctree)/arch/ia64/kernel/Makefile.gate - -# tell compiled for xen -CPPFLAGS_gate.lds += -D__IA64_GATE_PARAVIRTUALIZED_XEN -AFLAGS_gate.o += -D__IA64_ASM_PARAVIRTUALIZED_XEN -D__IA64_GATE_PARAVIRTUALIZED_XEN - -# use same file of native. -$(obj)/gate.o: $(src)/../kernel/gate.S FORCE -	$(call if_changed_dep,as_o_S) -$(obj)/gate.lds: $(src)/../kernel/gate.lds.S FORCE -	$(call if_changed_dep,cpp_lds_S) - - -AFLAGS_xenivt.o += -D__IA64_ASM_PARAVIRTUALIZED_XEN - -# xen multi compile -ASM_PARAVIRT_MULTI_COMPILE_SRCS = ivt.S entry.S fsys.S -ASM_PARAVIRT_OBJS = $(addprefix xen-,$(ASM_PARAVIRT_MULTI_COMPILE_SRCS:.S=.o)) -obj-y += $(ASM_PARAVIRT_OBJS) -define paravirtualized_xen -AFLAGS_$(1) += -D__IA64_ASM_PARAVIRTUALIZED_XEN -endef -$(foreach o,$(ASM_PARAVIRT_OBJS),$(eval $(call paravirtualized_xen,$(o)))) - -$(obj)/xen-%.o: $(src)/../kernel/%.S FORCE -	$(call if_changed_dep,as_o_S) diff --git a/arch/ia64/xen/gate-data.S b/arch/ia64/xen/gate-data.S deleted file mode 100644 index 6f95b6b32a4..00000000000 --- a/arch/ia64/xen/gate-data.S +++ /dev/null @@ -1,3 +0,0 @@ -	.section .data..gate.xen, "aw" - -	.incbin "arch/ia64/xen/gate.so" diff --git a/arch/ia64/xen/grant-table.c b/arch/ia64/xen/grant-table.c deleted file mode 100644 index c18281332f8..00000000000 --- a/arch/ia64/xen/grant-table.c +++ /dev/null @@ -1,94 +0,0 @@ -/****************************************************************************** - * arch/ia64/xen/grant-table.c - * - * Copyright (c) 2006 Isaku Yamahata <yamahata at valinux co jp> - *                    VA Linux Systems Japan K.K. - * - * 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/module.h> -#include <linux/vmalloc.h> -#include <linux/slab.h> -#include <linux/mm.h> - -#include <xen/interface/xen.h> -#include <xen/interface/memory.h> -#include <xen/grant_table.h> - -#include <asm/xen/hypervisor.h> - -/**************************************************************************** - * grant table hack - * cmd: GNTTABOP_xxx - */ - -int arch_gnttab_map_shared(unsigned long *frames, unsigned long nr_gframes, -			   unsigned long max_nr_gframes, -			   struct grant_entry **__shared) -{ -	*__shared = __va(frames[0] << PAGE_SHIFT); -	return 0; -} - -void arch_gnttab_unmap_shared(struct grant_entry *shared, -			      unsigned long nr_gframes) -{ -	/* nothing */ -} - -static void -gnttab_map_grant_ref_pre(struct gnttab_map_grant_ref *uop) -{ -	uint32_t flags; - -	flags = uop->flags; - -	if (flags & GNTMAP_host_map) { -		if (flags & GNTMAP_application_map) { -			printk(KERN_DEBUG -			       "GNTMAP_application_map is not supported yet: " -			       "flags 0x%x\n", flags); -			BUG(); -		} -		if (flags & GNTMAP_contains_pte) { -			printk(KERN_DEBUG -			       "GNTMAP_contains_pte is not supported yet: " -			       "flags 0x%x\n", flags); -			BUG(); -		} -	} else if (flags & GNTMAP_device_map) { -		printk("GNTMAP_device_map is not supported yet 0x%x\n", flags); -		BUG();	/* not yet. actually this flag is not used. */ -	} else { -		BUG(); -	} -} - -int -HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count) -{ -	if (cmd == GNTTABOP_map_grant_ref) { -		unsigned int i; -		for (i = 0; i < count; i++) { -			gnttab_map_grant_ref_pre( -				(struct gnttab_map_grant_ref *)uop + i); -		} -	} -	return xencomm_hypercall_grant_table_op(cmd, uop, count); -} - -EXPORT_SYMBOL(HYPERVISOR_grant_table_op); diff --git a/arch/ia64/xen/hypercall.S b/arch/ia64/xen/hypercall.S deleted file mode 100644 index 08847aa1258..00000000000 --- a/arch/ia64/xen/hypercall.S +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Support routines for Xen hypercalls - * - * Copyright (C) 2005 Dan Magenheimer <dan.magenheimer@hp.com> - * Copyright (C) 2008 Yaozu (Eddie) Dong <eddie.dong@intel.com> - */ - -#include <asm/asmmacro.h> -#include <asm/intrinsics.h> -#include <asm/xen/privop.h> - -#ifdef __INTEL_COMPILER -/* - * Hypercalls without parameter. - */ -#define __HCALL0(name,hcall)		\ -	GLOBAL_ENTRY(name);		\ -	break	hcall;			\ -	br.ret.sptk.many rp;		\ -	END(name) - -/* - * Hypercalls with 1 parameter. - */ -#define __HCALL1(name,hcall)		\ -	GLOBAL_ENTRY(name);		\ -	mov r8=r32;			\ -	break	hcall;			\ -	br.ret.sptk.many rp;		\ -	END(name) - -/* - * Hypercalls with 2 parameters. - */ -#define __HCALL2(name,hcall)		\ -	GLOBAL_ENTRY(name);		\ -	mov r8=r32;			\ -	mov r9=r33;			\ -	break	hcall;			\ -	br.ret.sptk.many rp;		\ -	END(name) - -__HCALL0(xen_get_psr, HYPERPRIVOP_GET_PSR) -__HCALL0(xen_get_ivr, HYPERPRIVOP_GET_IVR) -__HCALL0(xen_get_tpr, HYPERPRIVOP_GET_TPR) -__HCALL0(xen_hyper_ssm_i, HYPERPRIVOP_SSM_I) - -__HCALL1(xen_set_tpr, HYPERPRIVOP_SET_TPR) -__HCALL1(xen_eoi, HYPERPRIVOP_EOI) -__HCALL1(xen_thash, HYPERPRIVOP_THASH) -__HCALL1(xen_set_itm, HYPERPRIVOP_SET_ITM) -__HCALL1(xen_get_rr, HYPERPRIVOP_GET_RR) -__HCALL1(xen_fc, HYPERPRIVOP_FC) -__HCALL1(xen_get_cpuid, HYPERPRIVOP_GET_CPUID) -__HCALL1(xen_get_pmd, HYPERPRIVOP_GET_PMD) - -__HCALL2(xen_ptcga, HYPERPRIVOP_PTC_GA) -__HCALL2(xen_set_rr, HYPERPRIVOP_SET_RR) -__HCALL2(xen_set_kr, HYPERPRIVOP_SET_KR) - -GLOBAL_ENTRY(xen_set_rr0_to_rr4) -	mov r8=r32 -	mov r9=r33 -	mov r10=r34 -	mov r11=r35 -	mov r14=r36 -	XEN_HYPER_SET_RR0_TO_RR4 -	br.ret.sptk.many rp -	;; -END(xen_set_rr0_to_rr4) -#endif - -GLOBAL_ENTRY(xen_send_ipi) -	mov r14=r32 -	mov r15=r33 -	mov r2=0x400 -	break 0x1000 -	;; -	br.ret.sptk.many rp -	;; -END(xen_send_ipi) - -GLOBAL_ENTRY(__hypercall) -	mov r2=r37 -	break 0x1000 -	br.ret.sptk.many b0 -	;; -END(__hypercall) diff --git a/arch/ia64/xen/hypervisor.c b/arch/ia64/xen/hypervisor.c deleted file mode 100644 index fab62528a80..00000000000 --- a/arch/ia64/xen/hypervisor.c +++ /dev/null @@ -1,97 +0,0 @@ -/****************************************************************************** - * arch/ia64/xen/hypervisor.c - * - * Copyright (c) 2006 Isaku Yamahata <yamahata at valinux co jp> - *                    VA Linux Systems Japan K.K. - * - * 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/efi.h> -#include <linux/export.h> -#include <asm/xen/hypervisor.h> -#include <asm/xen/privop.h> - -#include "irq_xen.h" - -struct shared_info *HYPERVISOR_shared_info __read_mostly = -	(struct shared_info *)XSI_BASE; -EXPORT_SYMBOL(HYPERVISOR_shared_info); - -DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu); - -struct start_info *xen_start_info; -EXPORT_SYMBOL(xen_start_info); - -EXPORT_SYMBOL(xen_domain_type); - -EXPORT_SYMBOL(__hypercall); - -/* Stolen from arch/x86/xen/enlighten.c */ -/* - * Flag to determine whether vcpu info placement is available on all - * VCPUs.  We assume it is to start with, and then set it to zero on - * the first failure.  This is because it can succeed on some VCPUs - * and not others, since it can involve hypervisor memory allocation, - * or because the guest failed to guarantee all the appropriate - * constraints on all VCPUs (ie buffer can't cross a page boundary). - * - * Note that any particular CPU may be using a placed vcpu structure, - * but we can only optimise if the all are. - * - * 0: not available, 1: available - */ - -static void __init xen_vcpu_setup(int cpu) -{ -	/* -	 * WARNING: -	 * before changing MAX_VIRT_CPUS, -	 * check that shared_info fits on a page -	 */ -	BUILD_BUG_ON(sizeof(struct shared_info) > PAGE_SIZE); -	per_cpu(xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu]; -} - -void __init xen_setup_vcpu_info_placement(void) -{ -	int cpu; - -	for_each_possible_cpu(cpu) -		xen_vcpu_setup(cpu); -} - -void -xen_cpu_init(void) -{ -	xen_smp_intr_init(); -} - -/************************************************************************** - * opt feature - */ -void -xen_ia64_enable_opt_feature(void) -{ -	/* Enable region 7 identity map optimizations in Xen */ -	struct xen_ia64_opt_feature optf; - -	optf.cmd = XEN_IA64_OPTF_IDENT_MAP_REG7; -	optf.on = XEN_IA64_OPTF_ON; -	optf.pgprot = pgprot_val(PAGE_KERNEL); -	optf.key = 0;	/* No key on linux. */ -	HYPERVISOR_opt_feature(&optf); -} diff --git a/arch/ia64/xen/irq_xen.c b/arch/ia64/xen/irq_xen.c deleted file mode 100644 index efb74dafec4..00000000000 --- a/arch/ia64/xen/irq_xen.c +++ /dev/null @@ -1,443 +0,0 @@ -/****************************************************************************** - * arch/ia64/xen/irq_xen.c - * - * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp> - *                    VA Linux Systems Japan K.K. - * - * 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/cpu.h> - -#include <xen/interface/xen.h> -#include <xen/interface/callback.h> -#include <xen/events.h> - -#include <asm/xen/privop.h> - -#include "irq_xen.h" - -/*************************************************************************** - * pv_irq_ops - * irq operations - */ - -static int -xen_assign_irq_vector(int irq) -{ -	struct physdev_irq irq_op; - -	irq_op.irq = irq; -	if (HYPERVISOR_physdev_op(PHYSDEVOP_alloc_irq_vector, &irq_op)) -		return -ENOSPC; - -	return irq_op.vector; -} - -static void -xen_free_irq_vector(int vector) -{ -	struct physdev_irq irq_op; - -	if (vector < IA64_FIRST_DEVICE_VECTOR || -	    vector > IA64_LAST_DEVICE_VECTOR) -		return; - -	irq_op.vector = vector; -	if (HYPERVISOR_physdev_op(PHYSDEVOP_free_irq_vector, &irq_op)) -		printk(KERN_WARNING "%s: xen_free_irq_vector fail vector=%d\n", -		       __func__, vector); -} - - -static DEFINE_PER_CPU(int, xen_timer_irq) = -1; -static DEFINE_PER_CPU(int, xen_ipi_irq) = -1; -static DEFINE_PER_CPU(int, xen_resched_irq) = -1; -static DEFINE_PER_CPU(int, xen_cmc_irq) = -1; -static DEFINE_PER_CPU(int, xen_cmcp_irq) = -1; -static DEFINE_PER_CPU(int, xen_cpep_irq) = -1; -#define NAME_SIZE	15 -static DEFINE_PER_CPU(char[NAME_SIZE], xen_timer_name); -static DEFINE_PER_CPU(char[NAME_SIZE], xen_ipi_name); -static DEFINE_PER_CPU(char[NAME_SIZE], xen_resched_name); -static DEFINE_PER_CPU(char[NAME_SIZE], xen_cmc_name); -static DEFINE_PER_CPU(char[NAME_SIZE], xen_cmcp_name); -static DEFINE_PER_CPU(char[NAME_SIZE], xen_cpep_name); -#undef NAME_SIZE - -struct saved_irq { -	unsigned int irq; -	struct irqaction *action; -}; -/* 16 should be far optimistic value, since only several percpu irqs - * are registered early. - */ -#define MAX_LATE_IRQ	16 -static struct saved_irq saved_percpu_irqs[MAX_LATE_IRQ]; -static unsigned short late_irq_cnt; -static unsigned short saved_irq_cnt; -static int xen_slab_ready; - -#ifdef CONFIG_SMP -#include <linux/sched.h> - -/* Dummy stub. Though we may check XEN_RESCHEDULE_VECTOR before __do_IRQ, - * it ends up to issue several memory accesses upon percpu data and - * thus adds unnecessary traffic to other paths. - */ -static irqreturn_t -xen_dummy_handler(int irq, void *dev_id) -{ -	return IRQ_HANDLED; -} - -static irqreturn_t -xen_resched_handler(int irq, void *dev_id) -{ -	scheduler_ipi(); -	return IRQ_HANDLED; -} - -static struct irqaction xen_ipi_irqaction = { -	.handler =	handle_IPI, -	.flags =	IRQF_DISABLED, -	.name =		"IPI" -}; - -static struct irqaction xen_resched_irqaction = { -	.handler =	xen_resched_handler, -	.flags =	IRQF_DISABLED, -	.name =		"resched" -}; - -static struct irqaction xen_tlb_irqaction = { -	.handler =	xen_dummy_handler, -	.flags =	IRQF_DISABLED, -	.name =		"tlb_flush" -}; -#endif - -/* - * This is xen version percpu irq registration, which needs bind - * to xen specific evtchn sub-system. One trick here is that xen - * evtchn binding interface depends on kmalloc because related - * port needs to be freed at device/cpu down. So we cache the - * registration on BSP before slab is ready and then deal them - * at later point. For rest instances happening after slab ready, - * we hook them to xen evtchn immediately. - * - * FIXME: MCA is not supported by far, and thus "nomca" boot param is - * required. - */ -static void -__xen_register_percpu_irq(unsigned int cpu, unsigned int vec, -			struct irqaction *action, int save) -{ -	int irq = 0; - -	if (xen_slab_ready) { -		switch (vec) { -		case IA64_TIMER_VECTOR: -			snprintf(per_cpu(xen_timer_name, cpu), -				 sizeof(per_cpu(xen_timer_name, cpu)), -				 "%s%d", action->name, cpu); -			irq = bind_virq_to_irqhandler(VIRQ_ITC, cpu, -				action->handler, action->flags, -				per_cpu(xen_timer_name, cpu), action->dev_id); -			per_cpu(xen_timer_irq, cpu) = irq; -			break; -		case IA64_IPI_RESCHEDULE: -			snprintf(per_cpu(xen_resched_name, cpu), -				 sizeof(per_cpu(xen_resched_name, cpu)), -				 "%s%d", action->name, cpu); -			irq = bind_ipi_to_irqhandler(XEN_RESCHEDULE_VECTOR, cpu, -				action->handler, action->flags, -				per_cpu(xen_resched_name, cpu), action->dev_id); -			per_cpu(xen_resched_irq, cpu) = irq; -			break; -		case IA64_IPI_VECTOR: -			snprintf(per_cpu(xen_ipi_name, cpu), -				 sizeof(per_cpu(xen_ipi_name, cpu)), -				 "%s%d", action->name, cpu); -			irq = bind_ipi_to_irqhandler(XEN_IPI_VECTOR, cpu, -				action->handler, action->flags, -				per_cpu(xen_ipi_name, cpu), action->dev_id); -			per_cpu(xen_ipi_irq, cpu) = irq; -			break; -		case IA64_CMC_VECTOR: -			snprintf(per_cpu(xen_cmc_name, cpu), -				 sizeof(per_cpu(xen_cmc_name, cpu)), -				 "%s%d", action->name, cpu); -			irq = bind_virq_to_irqhandler(VIRQ_MCA_CMC, cpu, -						action->handler, -						action->flags, -						per_cpu(xen_cmc_name, cpu), -						action->dev_id); -			per_cpu(xen_cmc_irq, cpu) = irq; -			break; -		case IA64_CMCP_VECTOR: -			snprintf(per_cpu(xen_cmcp_name, cpu), -				 sizeof(per_cpu(xen_cmcp_name, cpu)), -				 "%s%d", action->name, cpu); -			irq = bind_ipi_to_irqhandler(XEN_CMCP_VECTOR, cpu, -						action->handler, -						action->flags, -						per_cpu(xen_cmcp_name, cpu), -						action->dev_id); -			per_cpu(xen_cmcp_irq, cpu) = irq; -			break; -		case IA64_CPEP_VECTOR: -			snprintf(per_cpu(xen_cpep_name, cpu), -				 sizeof(per_cpu(xen_cpep_name, cpu)), -				 "%s%d", action->name, cpu); -			irq = bind_ipi_to_irqhandler(XEN_CPEP_VECTOR, cpu, -						action->handler, -						action->flags, -						per_cpu(xen_cpep_name, cpu), -						action->dev_id); -			per_cpu(xen_cpep_irq, cpu) = irq; -			break; -		case IA64_CPE_VECTOR: -		case IA64_MCA_RENDEZ_VECTOR: -		case IA64_PERFMON_VECTOR: -		case IA64_MCA_WAKEUP_VECTOR: -		case IA64_SPURIOUS_INT_VECTOR: -			/* No need to complain, these aren't supported. */ -			break; -		default: -			printk(KERN_WARNING "Percpu irq %d is unsupported " -			       "by xen!\n", vec); -			break; -		} -		BUG_ON(irq < 0); - -		if (irq > 0) { -			/* -			 * Mark percpu.  Without this, migrate_irqs() will -			 * mark the interrupt for migrations and trigger it -			 * on cpu hotplug. -			 */ -			irq_set_status_flags(irq, IRQ_PER_CPU); -		} -	} - -	/* For BSP, we cache registered percpu irqs, and then re-walk -	 * them when initializing APs -	 */ -	if (!cpu && save) { -		BUG_ON(saved_irq_cnt == MAX_LATE_IRQ); -		saved_percpu_irqs[saved_irq_cnt].irq = vec; -		saved_percpu_irqs[saved_irq_cnt].action = action; -		saved_irq_cnt++; -		if (!xen_slab_ready) -			late_irq_cnt++; -	} -} - -static void -xen_register_percpu_irq(ia64_vector vec, struct irqaction *action) -{ -	__xen_register_percpu_irq(smp_processor_id(), vec, action, 1); -} - -static void -xen_bind_early_percpu_irq(void) -{ -	int i; - -	xen_slab_ready = 1; -	/* There's no race when accessing this cached array, since only -	 * BSP will face with such step shortly -	 */ -	for (i = 0; i < late_irq_cnt; i++) -		__xen_register_percpu_irq(smp_processor_id(), -					  saved_percpu_irqs[i].irq, -					  saved_percpu_irqs[i].action, 0); -} - -/* FIXME: There's no obvious point to check whether slab is ready. So - * a hack is used here by utilizing a late time hook. - */ - -#ifdef CONFIG_HOTPLUG_CPU -static int unbind_evtchn_callback(struct notifier_block *nfb, -				  unsigned long action, void *hcpu) -{ -	unsigned int cpu = (unsigned long)hcpu; - -	if (action == CPU_DEAD) { -		/* Unregister evtchn.  */ -		if (per_cpu(xen_cpep_irq, cpu) >= 0) { -			unbind_from_irqhandler(per_cpu(xen_cpep_irq, cpu), -					       NULL); -			per_cpu(xen_cpep_irq, cpu) = -1; -		} -		if (per_cpu(xen_cmcp_irq, cpu) >= 0) { -			unbind_from_irqhandler(per_cpu(xen_cmcp_irq, cpu), -					       NULL); -			per_cpu(xen_cmcp_irq, cpu) = -1; -		} -		if (per_cpu(xen_cmc_irq, cpu) >= 0) { -			unbind_from_irqhandler(per_cpu(xen_cmc_irq, cpu), NULL); -			per_cpu(xen_cmc_irq, cpu) = -1; -		} -		if (per_cpu(xen_ipi_irq, cpu) >= 0) { -			unbind_from_irqhandler(per_cpu(xen_ipi_irq, cpu), NULL); -			per_cpu(xen_ipi_irq, cpu) = -1; -		} -		if (per_cpu(xen_resched_irq, cpu) >= 0) { -			unbind_from_irqhandler(per_cpu(xen_resched_irq, cpu), -					       NULL); -			per_cpu(xen_resched_irq, cpu) = -1; -		} -		if (per_cpu(xen_timer_irq, cpu) >= 0) { -			unbind_from_irqhandler(per_cpu(xen_timer_irq, cpu), -					       NULL); -			per_cpu(xen_timer_irq, cpu) = -1; -		} -	} -	return NOTIFY_OK; -} - -static struct notifier_block unbind_evtchn_notifier = { -	.notifier_call = unbind_evtchn_callback, -	.priority = 0 -}; -#endif - -void xen_smp_intr_init_early(unsigned int cpu) -{ -#ifdef CONFIG_SMP -	unsigned int i; - -	for (i = 0; i < saved_irq_cnt; i++) -		__xen_register_percpu_irq(cpu, saved_percpu_irqs[i].irq, -					  saved_percpu_irqs[i].action, 0); -#endif -} - -void xen_smp_intr_init(void) -{ -#ifdef CONFIG_SMP -	unsigned int cpu = smp_processor_id(); -	struct callback_register event = { -		.type = CALLBACKTYPE_event, -		.address = { .ip = (unsigned long)&xen_event_callback }, -	}; - -	if (cpu == 0) { -		/* Initialization was already done for boot cpu.  */ -#ifdef CONFIG_HOTPLUG_CPU -		/* Register the notifier only once.  */ -		register_cpu_notifier(&unbind_evtchn_notifier); -#endif -		return; -	} - -	/* This should be piggyback when setup vcpu guest context */ -	BUG_ON(HYPERVISOR_callback_op(CALLBACKOP_register, &event)); -#endif /* CONFIG_SMP */ -} - -void __init -xen_irq_init(void) -{ -	struct callback_register event = { -		.type = CALLBACKTYPE_event, -		.address = { .ip = (unsigned long)&xen_event_callback }, -	}; - -	xen_init_IRQ(); -	BUG_ON(HYPERVISOR_callback_op(CALLBACKOP_register, &event)); -	late_time_init = xen_bind_early_percpu_irq; -} - -void -xen_platform_send_ipi(int cpu, int vector, int delivery_mode, int redirect) -{ -#ifdef CONFIG_SMP -	/* TODO: we need to call vcpu_up here */ -	if (unlikely(vector == ap_wakeup_vector)) { -		/* XXX -		 * This should be in __cpu_up(cpu) in ia64 smpboot.c -		 * like x86. But don't want to modify it, -		 * keep it untouched. -		 */ -		xen_smp_intr_init_early(cpu); - -		xen_send_ipi(cpu, vector); -		/* vcpu_prepare_and_up(cpu); */ -		return; -	} -#endif - -	switch (vector) { -	case IA64_IPI_VECTOR: -		xen_send_IPI_one(cpu, XEN_IPI_VECTOR); -		break; -	case IA64_IPI_RESCHEDULE: -		xen_send_IPI_one(cpu, XEN_RESCHEDULE_VECTOR); -		break; -	case IA64_CMCP_VECTOR: -		xen_send_IPI_one(cpu, XEN_CMCP_VECTOR); -		break; -	case IA64_CPEP_VECTOR: -		xen_send_IPI_one(cpu, XEN_CPEP_VECTOR); -		break; -	case IA64_TIMER_VECTOR: { -		/* this is used only once by check_sal_cache_flush() -		   at boot time */ -		static int used = 0; -		if (!used) { -			xen_send_ipi(cpu, IA64_TIMER_VECTOR); -			used = 1; -			break; -		} -		/* fallthrough */ -	} -	default: -		printk(KERN_WARNING "Unsupported IPI type 0x%x\n", -		       vector); -		notify_remote_via_irq(0); /* defaults to 0 irq */ -		break; -	} -} - -static void __init -xen_register_ipi(void) -{ -#ifdef CONFIG_SMP -	register_percpu_irq(IA64_IPI_VECTOR, &xen_ipi_irqaction); -	register_percpu_irq(IA64_IPI_RESCHEDULE, &xen_resched_irqaction); -	register_percpu_irq(IA64_IPI_LOCAL_TLB_FLUSH, &xen_tlb_irqaction); -#endif -} - -static void -xen_resend_irq(unsigned int vector) -{ -	(void)resend_irq_on_evtchn(vector); -} - -const struct pv_irq_ops xen_irq_ops __initconst = { -	.register_ipi = xen_register_ipi, - -	.assign_irq_vector = xen_assign_irq_vector, -	.free_irq_vector = xen_free_irq_vector, -	.register_percpu_irq = xen_register_percpu_irq, - -	.resend_irq = xen_resend_irq, -}; diff --git a/arch/ia64/xen/irq_xen.h b/arch/ia64/xen/irq_xen.h deleted file mode 100644 index 1778517b90f..00000000000 --- a/arch/ia64/xen/irq_xen.h +++ /dev/null @@ -1,34 +0,0 @@ -/****************************************************************************** - * arch/ia64/xen/irq_xen.h - * - * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp> - *                    VA Linux Systems Japan K.K. - * - * 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 - * - */ - -#ifndef IRQ_XEN_H -#define IRQ_XEN_H - -extern void (*late_time_init)(void); -extern char xen_event_callback; -void __init xen_init_IRQ(void); - -extern const struct pv_irq_ops xen_irq_ops __initconst; -extern void xen_smp_intr_init(void); -extern void xen_send_ipi(int cpu, int vec); - -#endif /* IRQ_XEN_H */ diff --git a/arch/ia64/xen/machvec.c b/arch/ia64/xen/machvec.c deleted file mode 100644 index 4ad588a7c27..00000000000 --- a/arch/ia64/xen/machvec.c +++ /dev/null @@ -1,4 +0,0 @@ -#define MACHVEC_PLATFORM_NAME           xen -#define MACHVEC_PLATFORM_HEADER         <asm/machvec_xen.h> -#include <asm/machvec_init.h> - diff --git a/arch/ia64/xen/suspend.c b/arch/ia64/xen/suspend.c deleted file mode 100644 index 419c8620945..00000000000 --- a/arch/ia64/xen/suspend.c +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** - * arch/ia64/xen/suspend.c - * - * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp> - *                    VA Linux Systems Japan K.K. - * - * 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 - * - * suspend/resume - */ - -#include <xen/xen-ops.h> -#include <asm/xen/hypervisor.h> -#include "time.h" - -void -xen_mm_pin_all(void) -{ -	/* nothing */ -} - -void -xen_mm_unpin_all(void) -{ -	/* nothing */ -} - -void -xen_arch_pre_suspend() -{ -	/* nothing */ -} - -void -xen_arch_post_suspend(int suspend_cancelled) -{ -	if (suspend_cancelled) -		return; - -	xen_ia64_enable_opt_feature(); -	/* add more if necessary */ -} - -void xen_arch_resume(void) -{ -	xen_timer_resume_on_aps(); -} diff --git a/arch/ia64/xen/time.c b/arch/ia64/xen/time.c deleted file mode 100644 index 1f8244a78be..00000000000 --- a/arch/ia64/xen/time.c +++ /dev/null @@ -1,257 +0,0 @@ -/****************************************************************************** - * arch/ia64/xen/time.c - * - * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp> - *                    VA Linux Systems Japan K.K. - * - * 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/delay.h> -#include <linux/kernel_stat.h> -#include <linux/posix-timers.h> -#include <linux/irq.h> -#include <linux/clocksource.h> - -#include <asm/timex.h> - -#include <asm/xen/hypervisor.h> - -#include <xen/interface/vcpu.h> - -#include "../kernel/fsyscall_gtod_data.h" - -static DEFINE_PER_CPU(struct vcpu_runstate_info, xen_runstate); -static DEFINE_PER_CPU(unsigned long, xen_stolen_time); -static DEFINE_PER_CPU(unsigned long, xen_blocked_time); - -/* taken from i386/kernel/time-xen.c */ -static void xen_init_missing_ticks_accounting(int cpu) -{ -	struct vcpu_register_runstate_memory_area area; -	struct vcpu_runstate_info *runstate = &per_cpu(xen_runstate, cpu); -	int rc; - -	memset(runstate, 0, sizeof(*runstate)); - -	area.addr.v = runstate; -	rc = HYPERVISOR_vcpu_op(VCPUOP_register_runstate_memory_area, cpu, -				&area); -	WARN_ON(rc && rc != -ENOSYS); - -	per_cpu(xen_blocked_time, cpu) = runstate->time[RUNSTATE_blocked]; -	per_cpu(xen_stolen_time, cpu) = runstate->time[RUNSTATE_runnable] -					    + runstate->time[RUNSTATE_offline]; -} - -/* - * Runstate accounting - */ -/* stolen from arch/x86/xen/time.c */ -static void get_runstate_snapshot(struct vcpu_runstate_info *res) -{ -	u64 state_time; -	struct vcpu_runstate_info *state; - -	BUG_ON(preemptible()); - -	state = &__get_cpu_var(xen_runstate); - -	/* -	 * The runstate info is always updated by the hypervisor on -	 * the current CPU, so there's no need to use anything -	 * stronger than a compiler barrier when fetching it. -	 */ -	do { -		state_time = state->state_entry_time; -		rmb(); -		*res = *state; -		rmb(); -	} while (state->state_entry_time != state_time); -} - -#define NS_PER_TICK (1000000000LL/HZ) - -static unsigned long -consider_steal_time(unsigned long new_itm) -{ -	unsigned long stolen, blocked; -	unsigned long delta_itm = 0, stolentick = 0; -	int cpu = smp_processor_id(); -	struct vcpu_runstate_info runstate; -	struct task_struct *p = current; - -	get_runstate_snapshot(&runstate); - -	/* -	 * Check for vcpu migration effect -	 * In this case, itc value is reversed. -	 * This causes huge stolen value. -	 * This function just checks and reject this effect. -	 */ -	if (!time_after_eq(runstate.time[RUNSTATE_blocked], -			   per_cpu(xen_blocked_time, cpu))) -		blocked = 0; - -	if (!time_after_eq(runstate.time[RUNSTATE_runnable] + -			   runstate.time[RUNSTATE_offline], -			   per_cpu(xen_stolen_time, cpu))) -		stolen = 0; - -	if (!time_after(delta_itm + new_itm, ia64_get_itc())) -		stolentick = ia64_get_itc() - new_itm; - -	do_div(stolentick, NS_PER_TICK); -	stolentick++; - -	do_div(stolen, NS_PER_TICK); - -	if (stolen > stolentick) -		stolen = stolentick; - -	stolentick -= stolen; -	do_div(blocked, NS_PER_TICK); - -	if (blocked > stolentick) -		blocked = stolentick; - -	if (stolen > 0 || blocked > 0) { -		account_steal_ticks(stolen); -		account_idle_ticks(blocked); -		run_local_timers(); - -		rcu_check_callbacks(cpu, user_mode(get_irq_regs())); - -		scheduler_tick(); -		run_posix_cpu_timers(p); -		delta_itm += local_cpu_data->itm_delta * (stolen + blocked); - -		if (cpu == time_keeper_id) -			xtime_update(stolen + blocked); - -		local_cpu_data->itm_next = delta_itm + new_itm; - -		per_cpu(xen_stolen_time, cpu) += NS_PER_TICK * stolen; -		per_cpu(xen_blocked_time, cpu) += NS_PER_TICK * blocked; -	} -	return delta_itm; -} - -static int xen_do_steal_accounting(unsigned long *new_itm) -{ -	unsigned long delta_itm; -	delta_itm = consider_steal_time(*new_itm); -	*new_itm += delta_itm; -	if (time_after(*new_itm, ia64_get_itc()) && delta_itm) -		return 1; - -	return 0; -} - -static void xen_itc_jitter_data_reset(void) -{ -	u64 lcycle, ret; - -	do { -		lcycle = itc_jitter_data.itc_lastcycle; -		ret = cmpxchg(&itc_jitter_data.itc_lastcycle, lcycle, 0); -	} while (unlikely(ret != lcycle)); -} - -/* based on xen_sched_clock() in arch/x86/xen/time.c. */ -/* - * This relies on HAVE_UNSTABLE_SCHED_CLOCK. If it can't be defined, - * something similar logic should be implemented here. - */ -/* - * Xen sched_clock implementation.  Returns the number of unstolen - * nanoseconds, which is nanoseconds the VCPU spent in RUNNING+BLOCKED - * states. - */ -static unsigned long long xen_sched_clock(void) -{ -	struct vcpu_runstate_info runstate; - -	unsigned long long now; -	unsigned long long offset; -	unsigned long long ret; - -	/* -	 * Ideally sched_clock should be called on a per-cpu basis -	 * anyway, so preempt should already be disabled, but that's -	 * not current practice at the moment. -	 */ -	preempt_disable(); - -	/* -	 * both ia64_native_sched_clock() and xen's runstate are -	 * based on mAR.ITC. So difference of them makes sense. -	 */ -	now = ia64_native_sched_clock(); - -	get_runstate_snapshot(&runstate); - -	WARN_ON(runstate.state != RUNSTATE_running); - -	offset = 0; -	if (now > runstate.state_entry_time) -		offset = now - runstate.state_entry_time; -	ret = runstate.time[RUNSTATE_blocked] + -		runstate.time[RUNSTATE_running] + -		offset; - -	preempt_enable(); - -	return ret; -} - -struct pv_time_ops xen_time_ops __initdata = { -	.init_missing_ticks_accounting	= xen_init_missing_ticks_accounting, -	.do_steal_accounting		= xen_do_steal_accounting, -	.clocksource_resume		= xen_itc_jitter_data_reset, -	.sched_clock			= xen_sched_clock, -}; - -/* Called after suspend, to resume time.  */ -static void xen_local_tick_resume(void) -{ -	/* Just trigger a tick.  */ -	ia64_cpu_local_tick(); -	touch_softlockup_watchdog(); -} - -void -xen_timer_resume(void) -{ -	unsigned int cpu; - -	xen_local_tick_resume(); - -	for_each_online_cpu(cpu) -		xen_init_missing_ticks_accounting(cpu); -} - -static void ia64_cpu_local_tick_fn(void *unused) -{ -	xen_local_tick_resume(); -	xen_init_missing_ticks_accounting(smp_processor_id()); -} - -void -xen_timer_resume_on_aps(void) -{ -	smp_call_function(&ia64_cpu_local_tick_fn, NULL, 1); -} diff --git a/arch/ia64/xen/time.h b/arch/ia64/xen/time.h deleted file mode 100644 index f98d7e1a42f..00000000000 --- a/arch/ia64/xen/time.h +++ /dev/null @@ -1,24 +0,0 @@ -/****************************************************************************** - * arch/ia64/xen/time.h - * - * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp> - *                    VA Linux Systems Japan K.K. - * - * 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 - * - */ - -extern struct pv_time_ops xen_time_ops __initdata; -void xen_timer_resume_on_aps(void); diff --git a/arch/ia64/xen/xcom_hcall.c b/arch/ia64/xen/xcom_hcall.c deleted file mode 100644 index ccaf7431f7c..00000000000 --- a/arch/ia64/xen/xcom_hcall.c +++ /dev/null @@ -1,441 +0,0 @@ -/* - * 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, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. - * - *          Tristan Gingold <tristan.gingold@bull.net> - * - *          Copyright (c) 2007 - *          Isaku Yamahata <yamahata at valinux co jp> - *                          VA Linux Systems Japan K.K. - *          consolidate mini and inline version. - */ - -#include <linux/module.h> -#include <xen/interface/xen.h> -#include <xen/interface/memory.h> -#include <xen/interface/grant_table.h> -#include <xen/interface/callback.h> -#include <xen/interface/vcpu.h> -#include <asm/xen/hypervisor.h> -#include <asm/xen/xencomm.h> - -/* Xencomm notes: - * This file defines hypercalls to be used by xencomm.  The hypercalls simply - * create inlines or mini descriptors for pointers and then call the raw arch - * hypercall xencomm_arch_hypercall_XXX - * - * If the arch wants to directly use these hypercalls, simply define macros - * in asm/xen/hypercall.h, eg: - *  #define HYPERVISOR_sched_op xencomm_hypercall_sched_op - * - * The arch may also define HYPERVISOR_xxx as a function and do more operations - * before/after doing the hypercall. - * - * Note: because only inline or mini descriptors are created these functions - * must only be called with in kernel memory parameters. - */ - -int -xencomm_hypercall_console_io(int cmd, int count, char *str) -{ -	/* xen early printk uses console io hypercall before -	 * xencomm initialization. In that case, we just ignore it. -	 */ -	if (!xencomm_is_initialized()) -		return 0; - -	return xencomm_arch_hypercall_console_io -		(cmd, count, xencomm_map_no_alloc(str, count)); -} -EXPORT_SYMBOL_GPL(xencomm_hypercall_console_io); - -int -xencomm_hypercall_event_channel_op(int cmd, void *op) -{ -	struct xencomm_handle *desc; -	desc = xencomm_map_no_alloc(op, sizeof(struct evtchn_op)); -	if (desc == NULL) -		return -EINVAL; - -	return xencomm_arch_hypercall_event_channel_op(cmd, desc); -} -EXPORT_SYMBOL_GPL(xencomm_hypercall_event_channel_op); - -int -xencomm_hypercall_xen_version(int cmd, void *arg) -{ -	struct xencomm_handle *desc; -	unsigned int argsize; - -	switch (cmd) { -	case XENVER_version: -		/* do not actually pass an argument */ -		return xencomm_arch_hypercall_xen_version(cmd, 0); -	case XENVER_extraversion: -		argsize = sizeof(struct xen_extraversion); -		break; -	case XENVER_compile_info: -		argsize = sizeof(struct xen_compile_info); -		break; -	case XENVER_capabilities: -		argsize = sizeof(struct xen_capabilities_info); -		break; -	case XENVER_changeset: -		argsize = sizeof(struct xen_changeset_info); -		break; -	case XENVER_platform_parameters: -		argsize = sizeof(struct xen_platform_parameters); -		break; -	case XENVER_get_features: -		argsize = (arg == NULL) ? 0 : sizeof(struct xen_feature_info); -		break; - -	default: -		printk(KERN_DEBUG -		       "%s: unknown version op %d\n", __func__, cmd); -		return -ENOSYS; -	} - -	desc = xencomm_map_no_alloc(arg, argsize); -	if (desc == NULL) -		return -EINVAL; - -	return xencomm_arch_hypercall_xen_version(cmd, desc); -} -EXPORT_SYMBOL_GPL(xencomm_hypercall_xen_version); - -int -xencomm_hypercall_physdev_op(int cmd, void *op) -{ -	unsigned int argsize; - -	switch (cmd) { -	case PHYSDEVOP_apic_read: -	case PHYSDEVOP_apic_write: -		argsize = sizeof(struct physdev_apic); -		break; -	case PHYSDEVOP_alloc_irq_vector: -	case PHYSDEVOP_free_irq_vector: -		argsize = sizeof(struct physdev_irq); -		break; -	case PHYSDEVOP_irq_status_query: -		argsize = sizeof(struct physdev_irq_status_query); -		break; - -	default: -		printk(KERN_DEBUG -		       "%s: unknown physdev op %d\n", __func__, cmd); -		return -ENOSYS; -	} - -	return xencomm_arch_hypercall_physdev_op -		(cmd, xencomm_map_no_alloc(op, argsize)); -} - -static int -xencommize_grant_table_op(struct xencomm_mini **xc_area, -			  unsigned int cmd, void *op, unsigned int count, -			  struct xencomm_handle **desc) -{ -	struct xencomm_handle *desc1; -	unsigned int argsize; - -	switch (cmd) { -	case GNTTABOP_map_grant_ref: -		argsize = sizeof(struct gnttab_map_grant_ref); -		break; -	case GNTTABOP_unmap_grant_ref: -		argsize = sizeof(struct gnttab_unmap_grant_ref); -		break; -	case GNTTABOP_setup_table: -	{ -		struct gnttab_setup_table *setup = op; - -		argsize = sizeof(*setup); - -		if (count != 1) -			return -EINVAL; -		desc1 = __xencomm_map_no_alloc -			(xen_guest_handle(setup->frame_list), -			 setup->nr_frames * -			 sizeof(*xen_guest_handle(setup->frame_list)), -			 *xc_area); -		if (desc1 == NULL) -			return -EINVAL; -		(*xc_area)++; -		set_xen_guest_handle(setup->frame_list, (void *)desc1); -		break; -	} -	case GNTTABOP_dump_table: -		argsize = sizeof(struct gnttab_dump_table); -		break; -	case GNTTABOP_transfer: -		argsize = sizeof(struct gnttab_transfer); -		break; -	case GNTTABOP_copy: -		argsize = sizeof(struct gnttab_copy); -		break; -	case GNTTABOP_query_size: -		argsize = sizeof(struct gnttab_query_size); -		break; -	default: -		printk(KERN_DEBUG "%s: unknown hypercall grant table op %d\n", -		       __func__, cmd); -		BUG(); -	} - -	*desc = __xencomm_map_no_alloc(op, count * argsize, *xc_area); -	if (*desc == NULL) -		return -EINVAL; -	(*xc_area)++; - -	return 0; -} - -int -xencomm_hypercall_grant_table_op(unsigned int cmd, void *op, -				 unsigned int count) -{ -	int rc; -	struct xencomm_handle *desc; -	XENCOMM_MINI_ALIGNED(xc_area, 2); - -	rc = xencommize_grant_table_op(&xc_area, cmd, op, count, &desc); -	if (rc) -		return rc; - -	return xencomm_arch_hypercall_grant_table_op(cmd, desc, count); -} -EXPORT_SYMBOL_GPL(xencomm_hypercall_grant_table_op); - -int -xencomm_hypercall_sched_op(int cmd, void *arg) -{ -	struct xencomm_handle *desc; -	unsigned int argsize; - -	switch (cmd) { -	case SCHEDOP_yield: -	case SCHEDOP_block: -		argsize = 0; -		break; -	case SCHEDOP_shutdown: -		argsize = sizeof(struct sched_shutdown); -		break; -	case SCHEDOP_poll: -	{ -		struct sched_poll *poll = arg; -		struct xencomm_handle *ports; - -		argsize = sizeof(struct sched_poll); -		ports = xencomm_map_no_alloc(xen_guest_handle(poll->ports), -				     sizeof(*xen_guest_handle(poll->ports))); - -		set_xen_guest_handle(poll->ports, (void *)ports); -		break; -	} -	default: -		printk(KERN_DEBUG "%s: unknown sched op %d\n", __func__, cmd); -		return -ENOSYS; -	} - -	desc = xencomm_map_no_alloc(arg, argsize); -	if (desc == NULL) -		return -EINVAL; - -	return xencomm_arch_hypercall_sched_op(cmd, desc); -} -EXPORT_SYMBOL_GPL(xencomm_hypercall_sched_op); - -int -xencomm_hypercall_multicall(void *call_list, int nr_calls) -{ -	int rc; -	int i; -	struct multicall_entry *mce; -	struct xencomm_handle *desc; -	XENCOMM_MINI_ALIGNED(xc_area, nr_calls * 2); - -	for (i = 0; i < nr_calls; i++) { -		mce = (struct multicall_entry *)call_list + i; - -		switch (mce->op) { -		case __HYPERVISOR_update_va_mapping: -		case __HYPERVISOR_mmu_update: -			/* No-op on ia64.  */ -			break; -		case __HYPERVISOR_grant_table_op: -			rc = xencommize_grant_table_op -				(&xc_area, -				 mce->args[0], (void *)mce->args[1], -				 mce->args[2], &desc); -			if (rc) -				return rc; -			mce->args[1] = (unsigned long)desc; -			break; -		case __HYPERVISOR_memory_op: -		default: -			printk(KERN_DEBUG -			       "%s: unhandled multicall op entry op %lu\n", -			       __func__, mce->op); -			return -ENOSYS; -		} -	} - -	desc = xencomm_map_no_alloc(call_list, -				    nr_calls * sizeof(struct multicall_entry)); -	if (desc == NULL) -		return -EINVAL; - -	return xencomm_arch_hypercall_multicall(desc, nr_calls); -} -EXPORT_SYMBOL_GPL(xencomm_hypercall_multicall); - -int -xencomm_hypercall_callback_op(int cmd, void *arg) -{ -	unsigned int argsize; -	switch (cmd) { -	case CALLBACKOP_register: -		argsize = sizeof(struct callback_register); -		break; -	case CALLBACKOP_unregister: -		argsize = sizeof(struct callback_unregister); -		break; -	default: -		printk(KERN_DEBUG -		       "%s: unknown callback op %d\n", __func__, cmd); -		return -ENOSYS; -	} - -	return xencomm_arch_hypercall_callback_op -		(cmd, xencomm_map_no_alloc(arg, argsize)); -} - -static int -xencommize_memory_reservation(struct xencomm_mini *xc_area, -			      struct xen_memory_reservation *mop) -{ -	struct xencomm_handle *desc; - -	desc = __xencomm_map_no_alloc(xen_guest_handle(mop->extent_start), -			mop->nr_extents * -			sizeof(*xen_guest_handle(mop->extent_start)), -			xc_area); -	if (desc == NULL) -		return -EINVAL; - -	set_xen_guest_handle(mop->extent_start, (void *)desc); -	return 0; -} - -int -xencomm_hypercall_memory_op(unsigned int cmd, void *arg) -{ -	GUEST_HANDLE(xen_pfn_t) extent_start_va[2] = { {NULL}, {NULL} }; -	struct xen_memory_reservation *xmr = NULL; -	int rc; -	struct xencomm_handle *desc; -	unsigned int argsize; -	XENCOMM_MINI_ALIGNED(xc_area, 2); - -	switch (cmd) { -	case XENMEM_increase_reservation: -	case XENMEM_decrease_reservation: -	case XENMEM_populate_physmap: -		xmr = (struct xen_memory_reservation *)arg; -		set_xen_guest_handle(extent_start_va[0], -				     xen_guest_handle(xmr->extent_start)); - -		argsize = sizeof(*xmr); -		rc = xencommize_memory_reservation(xc_area, xmr); -		if (rc) -			return rc; -		xc_area++; -		break; - -	case XENMEM_maximum_ram_page: -		argsize = 0; -		break; - -	case XENMEM_add_to_physmap: -		argsize = sizeof(struct xen_add_to_physmap); -		break; - -	default: -		printk(KERN_DEBUG "%s: unknown memory op %d\n", __func__, cmd); -		return -ENOSYS; -	} - -	desc = xencomm_map_no_alloc(arg, argsize); -	if (desc == NULL) -		return -EINVAL; - -	rc = xencomm_arch_hypercall_memory_op(cmd, desc); - -	switch (cmd) { -	case XENMEM_increase_reservation: -	case XENMEM_decrease_reservation: -	case XENMEM_populate_physmap: -		set_xen_guest_handle(xmr->extent_start, -				     xen_guest_handle(extent_start_va[0])); -		break; -	} - -	return rc; -} -EXPORT_SYMBOL_GPL(xencomm_hypercall_memory_op); - -int -xencomm_hypercall_suspend(unsigned long srec) -{ -	struct sched_shutdown arg; - -	arg.reason = SHUTDOWN_suspend; - -	return xencomm_arch_hypercall_sched_op( -		SCHEDOP_shutdown, xencomm_map_no_alloc(&arg, sizeof(arg))); -} - -long -xencomm_hypercall_vcpu_op(int cmd, int cpu, void *arg) -{ -	unsigned int argsize; -	switch (cmd) { -	case VCPUOP_register_runstate_memory_area: { -		struct vcpu_register_runstate_memory_area *area = -			(struct vcpu_register_runstate_memory_area *)arg; -		argsize = sizeof(*arg); -		set_xen_guest_handle(area->addr.h, -		     (void *)xencomm_map_no_alloc(area->addr.v, -						  sizeof(area->addr.v))); -		break; -	} - -	default: -		printk(KERN_DEBUG "%s: unknown vcpu op %d\n", __func__, cmd); -		return -ENOSYS; -	} - -	return xencomm_arch_hypercall_vcpu_op(cmd, cpu, -					xencomm_map_no_alloc(arg, argsize)); -} - -long -xencomm_hypercall_opt_feature(void *arg) -{ -	return xencomm_arch_hypercall_opt_feature( -		xencomm_map_no_alloc(arg, -				     sizeof(struct xen_ia64_opt_feature))); -} diff --git a/arch/ia64/xen/xen_pv_ops.c b/arch/ia64/xen/xen_pv_ops.c deleted file mode 100644 index 3e8d350fdf3..00000000000 --- a/arch/ia64/xen/xen_pv_ops.c +++ /dev/null @@ -1,1141 +0,0 @@ -/****************************************************************************** - * arch/ia64/xen/xen_pv_ops.c - * - * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp> - *                    VA Linux Systems Japan K.K. - * - * 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/console.h> -#include <linux/irq.h> -#include <linux/kernel.h> -#include <linux/pm.h> -#include <linux/unistd.h> - -#include <asm/xen/hypervisor.h> -#include <asm/xen/xencomm.h> -#include <asm/xen/privop.h> - -#include "irq_xen.h" -#include "time.h" - -/*************************************************************************** - * general info - */ -static struct pv_info xen_info __initdata = { -	.kernel_rpl = 2,	/* or 1: determin at runtime */ -	.paravirt_enabled = 1, -	.name = "Xen/ia64", -}; - -#define IA64_RSC_PL_SHIFT	2 -#define IA64_RSC_PL_BIT_SIZE	2 -#define IA64_RSC_PL_MASK	\ -	(((1UL << IA64_RSC_PL_BIT_SIZE) - 1) << IA64_RSC_PL_SHIFT) - -static void __init -xen_info_init(void) -{ -	/* Xenified Linux/ia64 may run on pl = 1 or 2. -	 * determin at run time. */ -	unsigned long rsc = ia64_getreg(_IA64_REG_AR_RSC); -	unsigned int rpl = (rsc & IA64_RSC_PL_MASK) >> IA64_RSC_PL_SHIFT; -	xen_info.kernel_rpl = rpl; -} - -/*************************************************************************** - * pv_init_ops - * initialization hooks. - */ - -static void -xen_panic_hypercall(struct unw_frame_info *info, void *arg) -{ -	current->thread.ksp = (__u64)info->sw - 16; -	HYPERVISOR_shutdown(SHUTDOWN_crash); -	/* we're never actually going to get here... */ -} - -static int -xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr) -{ -	unw_init_running(xen_panic_hypercall, NULL); -	/* we're never actually going to get here... */ -	return NOTIFY_DONE; -} - -static struct notifier_block xen_panic_block = { -	xen_panic_event, NULL, 0 /* try to go last */ -}; - -static void xen_pm_power_off(void) -{ -	local_irq_disable(); -	HYPERVISOR_shutdown(SHUTDOWN_poweroff); -} - -static void __init -xen_banner(void) -{ -	printk(KERN_INFO -	       "Running on Xen! pl = %d start_info_pfn=0x%lx nr_pages=%ld " -	       "flags=0x%x\n", -	       xen_info.kernel_rpl, -	       HYPERVISOR_shared_info->arch.start_info_pfn, -	       xen_start_info->nr_pages, xen_start_info->flags); -} - -static int __init -xen_reserve_memory(struct rsvd_region *region) -{ -	region->start = (unsigned long)__va( -		(HYPERVISOR_shared_info->arch.start_info_pfn << PAGE_SHIFT)); -	region->end   = region->start + PAGE_SIZE; -	return 1; -} - -static void __init -xen_arch_setup_early(void) -{ -	struct shared_info *s; -	BUG_ON(!xen_pv_domain()); - -	s = HYPERVISOR_shared_info; -	xen_start_info = __va(s->arch.start_info_pfn << PAGE_SHIFT); - -	/* Must be done before any hypercall.  */ -	xencomm_initialize(); - -	xen_setup_features(); -	/* Register a call for panic conditions. */ -	atomic_notifier_chain_register(&panic_notifier_list, -				       &xen_panic_block); -	pm_power_off = xen_pm_power_off; - -	xen_ia64_enable_opt_feature(); -} - -static void __init -xen_arch_setup_console(char **cmdline_p) -{ -	add_preferred_console("xenboot", 0, NULL); -	add_preferred_console("tty", 0, NULL); -	/* use hvc_xen */ -	add_preferred_console("hvc", 0, NULL); - -#if !defined(CONFIG_VT) || !defined(CONFIG_DUMMY_CONSOLE) -	conswitchp = NULL; -#endif -} - -static int __init -xen_arch_setup_nomca(void) -{ -	return 1; -} - -static void __init -xen_post_smp_prepare_boot_cpu(void) -{ -	xen_setup_vcpu_info_placement(); -} - -#ifdef ASM_SUPPORTED -static unsigned long __init_or_module -xen_patch_bundle(void *sbundle, void *ebundle, unsigned long type); -#endif -static void __init -xen_patch_branch(unsigned long tag, unsigned long type); - -static const struct pv_init_ops xen_init_ops __initconst = { -	.banner = xen_banner, - -	.reserve_memory = xen_reserve_memory, - -	.arch_setup_early = xen_arch_setup_early, -	.arch_setup_console = xen_arch_setup_console, -	.arch_setup_nomca = xen_arch_setup_nomca, - -	.post_smp_prepare_boot_cpu = xen_post_smp_prepare_boot_cpu, -#ifdef ASM_SUPPORTED -	.patch_bundle = xen_patch_bundle, -#endif -	.patch_branch = xen_patch_branch, -}; - -/*************************************************************************** - * pv_fsys_data - * addresses for fsys - */ - -extern unsigned long xen_fsyscall_table[NR_syscalls]; -extern char xen_fsys_bubble_down[]; -struct pv_fsys_data xen_fsys_data __initdata = { -	.fsyscall_table = (unsigned long *)xen_fsyscall_table, -	.fsys_bubble_down = (void *)xen_fsys_bubble_down, -}; - -/*************************************************************************** - * pv_patchdata - * patchdata addresses - */ - -#define DECLARE(name)							\ -	extern unsigned long __xen_start_gate_##name##_patchlist[];	\ -	extern unsigned long __xen_end_gate_##name##_patchlist[] - -DECLARE(fsyscall); -DECLARE(brl_fsys_bubble_down); -DECLARE(vtop); -DECLARE(mckinley_e9); - -extern unsigned long __xen_start_gate_section[]; - -#define ASSIGN(name)							\ -	.start_##name##_patchlist =					\ -		(unsigned long)__xen_start_gate_##name##_patchlist,	\ -	.end_##name##_patchlist =					\ -		(unsigned long)__xen_end_gate_##name##_patchlist - -static struct pv_patchdata xen_patchdata __initdata = { -	ASSIGN(fsyscall), -	ASSIGN(brl_fsys_bubble_down), -	ASSIGN(vtop), -	ASSIGN(mckinley_e9), - -	.gate_section = (void*)__xen_start_gate_section, -}; - -/*************************************************************************** - * pv_cpu_ops - * intrinsics hooks. - */ - -#ifndef ASM_SUPPORTED -static void -xen_set_itm_with_offset(unsigned long val) -{ -	/* ia64_cpu_local_tick() calls this with interrupt enabled. */ -	/* WARN_ON(!irqs_disabled()); */ -	xen_set_itm(val - XEN_MAPPEDREGS->itc_offset); -} - -static unsigned long -xen_get_itm_with_offset(void) -{ -	/* unused at this moment */ -	printk(KERN_DEBUG "%s is called.\n", __func__); - -	WARN_ON(!irqs_disabled()); -	return ia64_native_getreg(_IA64_REG_CR_ITM) + -		XEN_MAPPEDREGS->itc_offset; -} - -/* ia64_set_itc() is only called by - * cpu_init() with ia64_set_itc(0) and ia64_sync_itc(). - * So XEN_MAPPEDRESG->itc_offset cal be considered as almost constant. - */ -static void -xen_set_itc(unsigned long val) -{ -	unsigned long mitc; - -	WARN_ON(!irqs_disabled()); -	mitc = ia64_native_getreg(_IA64_REG_AR_ITC); -	XEN_MAPPEDREGS->itc_offset = val - mitc; -	XEN_MAPPEDREGS->itc_last = val; -} - -static unsigned long -xen_get_itc(void) -{ -	unsigned long res; -	unsigned long itc_offset; -	unsigned long itc_last; -	unsigned long ret_itc_last; - -	itc_offset = XEN_MAPPEDREGS->itc_offset; -	do { -		itc_last = XEN_MAPPEDREGS->itc_last; -		res = ia64_native_getreg(_IA64_REG_AR_ITC); -		res += itc_offset; -		if (itc_last >= res) -			res = itc_last + 1; -		ret_itc_last = cmpxchg(&XEN_MAPPEDREGS->itc_last, -				       itc_last, res); -	} while (unlikely(ret_itc_last != itc_last)); -	return res; - -#if 0 -	/* ia64_itc_udelay() calls ia64_get_itc() with interrupt enabled. -	   Should it be paravirtualized instead? */ -	WARN_ON(!irqs_disabled()); -	itc_offset = XEN_MAPPEDREGS->itc_offset; -	itc_last = XEN_MAPPEDREGS->itc_last; -	res = ia64_native_getreg(_IA64_REG_AR_ITC); -	res += itc_offset; -	if (itc_last >= res) -		res = itc_last + 1; -	XEN_MAPPEDREGS->itc_last = res; -	return res; -#endif -} - -static void xen_setreg(int regnum, unsigned long val) -{ -	switch (regnum) { -	case _IA64_REG_AR_KR0 ... _IA64_REG_AR_KR7: -		xen_set_kr(regnum - _IA64_REG_AR_KR0, val); -		break; -	case _IA64_REG_AR_ITC: -		xen_set_itc(val); -		break; -	case _IA64_REG_CR_TPR: -		xen_set_tpr(val); -		break; -	case _IA64_REG_CR_ITM: -		xen_set_itm_with_offset(val); -		break; -	case _IA64_REG_CR_EOI: -		xen_eoi(val); -		break; -	default: -		ia64_native_setreg_func(regnum, val); -		break; -	} -} - -static unsigned long xen_getreg(int regnum) -{ -	unsigned long res; - -	switch (regnum) { -	case _IA64_REG_PSR: -		res = xen_get_psr(); -		break; -	case _IA64_REG_AR_ITC: -		res = xen_get_itc(); -		break; -	case _IA64_REG_CR_ITM: -		res = xen_get_itm_with_offset(); -		break; -	case _IA64_REG_CR_IVR: -		res = xen_get_ivr(); -		break; -	case _IA64_REG_CR_TPR: -		res = xen_get_tpr(); -		break; -	default: -		res = ia64_native_getreg_func(regnum); -		break; -	} -	return res; -} - -/* turning on interrupts is a bit more complicated.. write to the - * memory-mapped virtual psr.i bit first (to avoid race condition), - * then if any interrupts were pending, we have to execute a hyperprivop - * to ensure the pending interrupt gets delivered; else we're done! */ -static void -xen_ssm_i(void) -{ -	int old = xen_get_virtual_psr_i(); -	xen_set_virtual_psr_i(1); -	barrier(); -	if (!old && xen_get_virtual_pend()) -		xen_hyper_ssm_i(); -} - -/* turning off interrupts can be paravirtualized simply by writing - * to a memory-mapped virtual psr.i bit (implemented as a 16-bit bool) */ -static void -xen_rsm_i(void) -{ -	xen_set_virtual_psr_i(0); -	barrier(); -} - -static unsigned long -xen_get_psr_i(void) -{ -	return xen_get_virtual_psr_i() ? IA64_PSR_I : 0; -} - -static void -xen_intrin_local_irq_restore(unsigned long mask) -{ -	if (mask & IA64_PSR_I) -		xen_ssm_i(); -	else -		xen_rsm_i(); -} -#else -#define __DEFINE_FUNC(name, code)					\ -	extern const char xen_ ## name ## _direct_start[];		\ -	extern const char xen_ ## name ## _direct_end[];		\ -	asm (".align 32\n"						\ -	     ".proc xen_" #name "\n"					\ -	     "xen_" #name ":\n"						\ -	     "xen_" #name "_direct_start:\n"				\ -	     code							\ -	     "xen_" #name "_direct_end:\n"				\ -	     "br.cond.sptk.many b6\n"					\ -	     ".endp xen_" #name "\n") - -#define DEFINE_VOID_FUNC0(name, code)		\ -	extern void				\ -	xen_ ## name (void);			\ -	__DEFINE_FUNC(name, code) - -#define DEFINE_VOID_FUNC1(name, code)		\ -	extern void				\ -	xen_ ## name (unsigned long arg);	\ -	__DEFINE_FUNC(name, code) - -#define DEFINE_VOID_FUNC1_VOID(name, code)	\ -	extern void				\ -	xen_ ## name (void *arg);		\ -	__DEFINE_FUNC(name, code) - -#define DEFINE_VOID_FUNC2(name, code)		\ -	extern void				\ -	xen_ ## name (unsigned long arg0,	\ -		      unsigned long arg1);	\ -	__DEFINE_FUNC(name, code) - -#define DEFINE_FUNC0(name, code)		\ -	extern unsigned long			\ -	xen_ ## name (void);			\ -	__DEFINE_FUNC(name, code) - -#define DEFINE_FUNC1(name, type, code)		\ -	extern unsigned long			\ -	xen_ ## name (type arg);		\ -	__DEFINE_FUNC(name, code) - -#define XEN_PSR_I_ADDR_ADDR     (XSI_BASE + XSI_PSR_I_ADDR_OFS) - -/* - * static void xen_set_itm_with_offset(unsigned long val) - *        xen_set_itm(val - XEN_MAPPEDREGS->itc_offset); - */ -/* 2 bundles */ -DEFINE_VOID_FUNC1(set_itm_with_offset, -		  "mov r2 = " __stringify(XSI_BASE) " + " -		  __stringify(XSI_ITC_OFFSET_OFS) "\n" -		  ";;\n" -		  "ld8 r3 = [r2]\n" -		  ";;\n" -		  "sub r8 = r8, r3\n" -		  "break " __stringify(HYPERPRIVOP_SET_ITM) "\n"); - -/* - * static unsigned long xen_get_itm_with_offset(void) - *    return ia64_native_getreg(_IA64_REG_CR_ITM) + XEN_MAPPEDREGS->itc_offset; - */ -/* 2 bundles */ -DEFINE_FUNC0(get_itm_with_offset, -	     "mov r2 = " __stringify(XSI_BASE) " + " -	     __stringify(XSI_ITC_OFFSET_OFS) "\n" -	     ";;\n" -	     "ld8 r3 = [r2]\n" -	     "mov r8 = cr.itm\n" -	     ";;\n" -	     "add r8 = r8, r2\n"); - -/* - * static void xen_set_itc(unsigned long val) - *	unsigned long mitc; - * - *	WARN_ON(!irqs_disabled()); - *	mitc = ia64_native_getreg(_IA64_REG_AR_ITC); - *	XEN_MAPPEDREGS->itc_offset = val - mitc; - *	XEN_MAPPEDREGS->itc_last = val; - */ -/* 2 bundles */ -DEFINE_VOID_FUNC1(set_itc, -		  "mov r2 = " __stringify(XSI_BASE) " + " -		  __stringify(XSI_ITC_LAST_OFS) "\n" -		  "mov r3 = ar.itc\n" -		  ";;\n" -		  "sub r3 = r8, r3\n" -		  "st8 [r2] = r8, " -		  __stringify(XSI_ITC_LAST_OFS) " - " -		  __stringify(XSI_ITC_OFFSET_OFS) "\n" -		  ";;\n" -		  "st8 [r2] = r3\n"); - -/* - * static unsigned long xen_get_itc(void) - *	unsigned long res; - *	unsigned long itc_offset; - *	unsigned long itc_last; - *	unsigned long ret_itc_last; - * - *	itc_offset = XEN_MAPPEDREGS->itc_offset; - *	do { - *		itc_last = XEN_MAPPEDREGS->itc_last; - *		res = ia64_native_getreg(_IA64_REG_AR_ITC); - *		res += itc_offset; - *		if (itc_last >= res) - *			res = itc_last + 1; - *		ret_itc_last = cmpxchg(&XEN_MAPPEDREGS->itc_last, - *				       itc_last, res); - *	} while (unlikely(ret_itc_last != itc_last)); - *	return res; - */ -/* 5 bundles */ -DEFINE_FUNC0(get_itc, -	     "mov r2 = " __stringify(XSI_BASE) " + " -	     __stringify(XSI_ITC_OFFSET_OFS) "\n" -	     ";;\n" -	     "ld8 r9 = [r2], " __stringify(XSI_ITC_LAST_OFS) " - " -	     __stringify(XSI_ITC_OFFSET_OFS) "\n" -					/* r9 = itc_offset */ -					/* r2 = XSI_ITC_OFFSET */ -	     "888:\n" -	     "mov r8 = ar.itc\n"	/* res = ar.itc */ -	     ";;\n" -	     "ld8 r3 = [r2]\n"		/* r3 = itc_last */ -	     "add r8 = r8, r9\n"	/* res = ar.itc + itc_offset */ -	     ";;\n" -	     "cmp.gtu p6, p0 = r3, r8\n" -	     ";;\n" -	     "(p6) add r8 = 1, r3\n"	/* if (itc_last > res) itc_last + 1 */ -	     ";;\n" -	     "mov ar.ccv = r8\n" -	     ";;\n" -	     "cmpxchg8.acq r10 = [r2], r8, ar.ccv\n" -	     ";;\n" -	     "cmp.ne p6, p0 = r10, r3\n" -	     "(p6) hint @pause\n" -	     "(p6) br.cond.spnt 888b\n"); - -DEFINE_VOID_FUNC1_VOID(fc, -		       "break " __stringify(HYPERPRIVOP_FC) "\n"); - -/* - * psr_i_addr_addr = XEN_PSR_I_ADDR_ADDR - * masked_addr = *psr_i_addr_addr - * pending_intr_addr = masked_addr - 1 - * if (val & IA64_PSR_I) { - *   masked = *masked_addr - *   *masked_addr = 0:xen_set_virtual_psr_i(1) - *   compiler barrier - *   if (masked) { - *      uint8_t pending = *pending_intr_addr; - *      if (pending) - *              XEN_HYPER_SSM_I - *   } - * } else { - *   *masked_addr = 1:xen_set_virtual_psr_i(0) - * } - */ -/* 6 bundles */ -DEFINE_VOID_FUNC1(intrin_local_irq_restore, -		  /* r8 = input value: 0 or IA64_PSR_I -		   * p6 =  (flags & IA64_PSR_I) -		   *    = if clause -		   * p7 = !(flags & IA64_PSR_I) -		   *    = else clause -		   */ -		  "cmp.ne p6, p7 = r8, r0\n" -		  "mov r9 = " __stringify(XEN_PSR_I_ADDR_ADDR) "\n" -		  ";;\n" -		  /* r9 = XEN_PSR_I_ADDR */ -		  "ld8 r9 = [r9]\n" -		  ";;\n" - -		  /* r10 = masked previous value */ -		  "(p6)	ld1.acq r10 = [r9]\n" -		  ";;\n" - -		  /* p8 = !masked interrupt masked previously? */ -		  "(p6)	cmp.ne.unc p8, p0 = r10, r0\n" - -		  /* p7 = else clause */ -		  "(p7)	mov r11 = 1\n" -		  ";;\n" -		  /* masked = 1 */ -		  "(p7)	st1.rel [r9] = r11\n" - -		  /* p6 = if clause */ -		  /* masked = 0 -		   * r9 = masked_addr - 1 -		   *    = pending_intr_addr -		   */ -		  "(p8)	st1.rel [r9] = r0, -1\n" -		  ";;\n" -		  /* r8 = pending_intr */ -		  "(p8)	ld1.acq r11 = [r9]\n" -		  ";;\n" -		  /* p9 = interrupt pending? */ -		  "(p8)	cmp.ne.unc p9, p10 = r11, r0\n" -		  ";;\n" -		  "(p10) mf\n" -		  /* issue hypercall to trigger interrupt */ -		  "(p9)	break " __stringify(HYPERPRIVOP_SSM_I) "\n"); - -DEFINE_VOID_FUNC2(ptcga, -		  "break " __stringify(HYPERPRIVOP_PTC_GA) "\n"); -DEFINE_VOID_FUNC2(set_rr, -		  "break " __stringify(HYPERPRIVOP_SET_RR) "\n"); - -/* - * tmp = XEN_MAPPEDREGS->interrupt_mask_addr = XEN_PSR_I_ADDR_ADDR; - * tmp = *tmp - * tmp = *tmp; - * psr_i = tmp? 0: IA64_PSR_I; - */ -/* 4 bundles */ -DEFINE_FUNC0(get_psr_i, -	     "mov r9 = " __stringify(XEN_PSR_I_ADDR_ADDR) "\n" -	     ";;\n" -	     "ld8 r9 = [r9]\n"			/* r9 = XEN_PSR_I_ADDR */ -	     "mov r8 = 0\n"			/* psr_i = 0 */ -	     ";;\n" -	     "ld1.acq r9 = [r9]\n"		/* r9 = XEN_PSR_I */ -	     ";;\n" -	     "cmp.eq.unc p6, p0 = r9, r0\n"	/* p6 = (XEN_PSR_I != 0) */ -	     ";;\n" -	     "(p6) mov r8 = " __stringify(1 << IA64_PSR_I_BIT) "\n"); - -DEFINE_FUNC1(thash, unsigned long, -	     "break " __stringify(HYPERPRIVOP_THASH) "\n"); -DEFINE_FUNC1(get_cpuid, int, -	     "break " __stringify(HYPERPRIVOP_GET_CPUID) "\n"); -DEFINE_FUNC1(get_pmd, int, -	     "break " __stringify(HYPERPRIVOP_GET_PMD) "\n"); -DEFINE_FUNC1(get_rr, unsigned long, -	     "break " __stringify(HYPERPRIVOP_GET_RR) "\n"); - -/* - * void xen_privop_ssm_i(void) - * - * int masked = !xen_get_virtual_psr_i(); - *	// masked = *(*XEN_MAPPEDREGS->interrupt_mask_addr) - * xen_set_virtual_psr_i(1) - *	// *(*XEN_MAPPEDREGS->interrupt_mask_addr) = 0 - * // compiler barrier - * if (masked) { - *	uint8_t* pend_int_addr = - *		(uint8_t*)(*XEN_MAPPEDREGS->interrupt_mask_addr) - 1; - *	uint8_t pending = *pend_int_addr; - *	if (pending) - *		XEN_HYPER_SSM_I - * } - */ -/* 4 bundles */ -DEFINE_VOID_FUNC0(ssm_i, -		  "mov r8 = " __stringify(XEN_PSR_I_ADDR_ADDR) "\n" -		  ";;\n" -		  "ld8 r8 = [r8]\n"		/* r8 = XEN_PSR_I_ADDR */ -		  ";;\n" -		  "ld1.acq r9 = [r8]\n"		/* r9 = XEN_PSR_I */ -		  ";;\n" -		  "st1.rel [r8] = r0, -1\n"	/* psr_i = 0. enable interrupt -						 * r8 = XEN_PSR_I_ADDR - 1 -						 *    = pend_int_addr -						 */ -		  "cmp.eq.unc p0, p6 = r9, r0\n"/* p6 = !XEN_PSR_I -						 * previously interrupt -						 * masked? -						 */ -		  ";;\n" -		  "(p6) ld1.acq r8 = [r8]\n"	/* r8 = xen_pend_int */ -		  ";;\n" -		  "(p6) cmp.eq.unc p6, p7 = r8, r0\n"	/*interrupt pending?*/ -		  ";;\n" -		  /* issue hypercall to get interrupt */ -		  "(p7) break " __stringify(HYPERPRIVOP_SSM_I) "\n" -		  ";;\n"); - -/* - * psr_i_addr_addr = XEN_MAPPEDREGS->interrupt_mask_addr - *		   = XEN_PSR_I_ADDR_ADDR; - * psr_i_addr = *psr_i_addr_addr; - * *psr_i_addr = 1; - */ -/* 2 bundles */ -DEFINE_VOID_FUNC0(rsm_i, -		  "mov r8 = " __stringify(XEN_PSR_I_ADDR_ADDR) "\n" -						/* r8 = XEN_PSR_I_ADDR */ -		  "mov r9 = 1\n" -		  ";;\n" -		  "ld8 r8 = [r8]\n"		/* r8 = XEN_PSR_I */ -		  ";;\n" -		  "st1.rel [r8] = r9\n");	/* XEN_PSR_I = 1 */ - -extern void -xen_set_rr0_to_rr4(unsigned long val0, unsigned long val1, -		   unsigned long val2, unsigned long val3, -		   unsigned long val4); -__DEFINE_FUNC(set_rr0_to_rr4, -	      "break " __stringify(HYPERPRIVOP_SET_RR0_TO_RR4) "\n"); - - -extern unsigned long xen_getreg(int regnum); -#define __DEFINE_GET_REG(id, privop)					\ -	"mov r2 = " __stringify(_IA64_REG_ ## id) "\n"			\ -	";;\n"								\ -	"cmp.eq p6, p0 = r2, r8\n"					\ -	";;\n"								\ -	"(p6) break " __stringify(HYPERPRIVOP_GET_ ## privop) "\n"	\ -	"(p6) br.cond.sptk.many b6\n"					\ -	";;\n" - -__DEFINE_FUNC(getreg, -	      __DEFINE_GET_REG(PSR, PSR) - -	      /* get_itc */ -	      "mov r2 = " __stringify(_IA64_REG_AR_ITC) "\n" -	      ";;\n" -	      "cmp.eq p6, p0 = r2, r8\n" -	      ";;\n" -	      "(p6) br.cond.spnt xen_get_itc\n" -	      ";;\n" - -	      /* get itm */ -	      "mov r2 = " __stringify(_IA64_REG_CR_ITM) "\n" -	      ";;\n" -	      "cmp.eq p6, p0 = r2, r8\n" -	      ";;\n" -	      "(p6) br.cond.spnt xen_get_itm_with_offset\n" -	      ";;\n" - -	      __DEFINE_GET_REG(CR_IVR, IVR) -	      __DEFINE_GET_REG(CR_TPR, TPR) - -	      /* fall back */ -	      "movl r2 = ia64_native_getreg_func\n" -	      ";;\n" -	      "mov b7 = r2\n" -	      ";;\n" -	      "br.cond.sptk.many b7\n"); - -extern void xen_setreg(int regnum, unsigned long val); -#define __DEFINE_SET_REG(id, privop)					\ -	"mov r2 = " __stringify(_IA64_REG_ ## id) "\n"			\ -	";;\n"								\ -	"cmp.eq p6, p0 = r2, r9\n"					\ -	";;\n"								\ -	"(p6) break " __stringify(HYPERPRIVOP_ ## privop) "\n"		\ -	"(p6) br.cond.sptk.many b6\n"					\ -	";;\n" - -__DEFINE_FUNC(setreg, -	      /* kr0 .. kr 7*/ -	      /* -	       * if (_IA64_REG_AR_KR0 <= regnum && -	       *     regnum <= _IA64_REG_AR_KR7) { -	       *     register __index asm ("r8") = regnum - _IA64_REG_AR_KR0 -	       *     register __val asm ("r9") = val -	       *    "break HYPERPRIVOP_SET_KR" -	       * } -	       */ -	      "mov r17 = r9\n" -	      "mov r2 = " __stringify(_IA64_REG_AR_KR0) "\n" -	      ";;\n" -	      "cmp.ge p6, p0 = r9, r2\n" -	      "sub r17 = r17, r2\n" -	      ";;\n" -	      "(p6) cmp.ge.unc p7, p0 = " -	      __stringify(_IA64_REG_AR_KR7) " - " __stringify(_IA64_REG_AR_KR0) -	      ", r17\n" -	      ";;\n" -	      "(p7) mov r9 = r8\n" -	      ";;\n" -	      "(p7) mov r8 = r17\n" -	      "(p7) break " __stringify(HYPERPRIVOP_SET_KR) "\n" - -	      /* set itm */ -	      "mov r2 = " __stringify(_IA64_REG_CR_ITM) "\n" -	      ";;\n" -	      "cmp.eq p6, p0 = r2, r8\n" -	      ";;\n" -	      "(p6) br.cond.spnt xen_set_itm_with_offset\n" - -	      /* set itc */ -	      "mov r2 = " __stringify(_IA64_REG_AR_ITC) "\n" -	      ";;\n" -	      "cmp.eq p6, p0 = r2, r8\n" -	      ";;\n" -	      "(p6) br.cond.spnt xen_set_itc\n" - -	      __DEFINE_SET_REG(CR_TPR, SET_TPR) -	      __DEFINE_SET_REG(CR_EOI, EOI) - -	      /* fall back */ -	      "movl r2 = ia64_native_setreg_func\n" -	      ";;\n" -	      "mov b7 = r2\n" -	      ";;\n" -	      "br.cond.sptk.many b7\n"); -#endif - -static const struct pv_cpu_ops xen_cpu_ops __initconst = { -	.fc		= xen_fc, -	.thash		= xen_thash, -	.get_cpuid	= xen_get_cpuid, -	.get_pmd	= xen_get_pmd, -	.getreg		= xen_getreg, -	.setreg		= xen_setreg, -	.ptcga		= xen_ptcga, -	.get_rr		= xen_get_rr, -	.set_rr		= xen_set_rr, -	.set_rr0_to_rr4	= xen_set_rr0_to_rr4, -	.ssm_i		= xen_ssm_i, -	.rsm_i		= xen_rsm_i, -	.get_psr_i	= xen_get_psr_i, -	.intrin_local_irq_restore -			= xen_intrin_local_irq_restore, -}; - -/****************************************************************************** - * replacement of hand written assembly codes. - */ - -extern char xen_switch_to; -extern char xen_leave_syscall; -extern char xen_work_processed_syscall; -extern char xen_leave_kernel; - -const struct pv_cpu_asm_switch xen_cpu_asm_switch = { -	.switch_to		= (unsigned long)&xen_switch_to, -	.leave_syscall		= (unsigned long)&xen_leave_syscall, -	.work_processed_syscall	= (unsigned long)&xen_work_processed_syscall, -	.leave_kernel		= (unsigned long)&xen_leave_kernel, -}; - -/*************************************************************************** - * pv_iosapic_ops - * iosapic read/write hooks. - */ -static void -xen_pcat_compat_init(void) -{ -	/* nothing */ -} - -static struct irq_chip* -xen_iosapic_get_irq_chip(unsigned long trigger) -{ -	return NULL; -} - -static unsigned int -xen_iosapic_read(char __iomem *iosapic, unsigned int reg) -{ -	struct physdev_apic apic_op; -	int ret; - -	apic_op.apic_physbase = (unsigned long)iosapic - -					__IA64_UNCACHED_OFFSET; -	apic_op.reg = reg; -	ret = HYPERVISOR_physdev_op(PHYSDEVOP_apic_read, &apic_op); -	if (ret) -		return ret; -	return apic_op.value; -} - -static void -xen_iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val) -{ -	struct physdev_apic apic_op; - -	apic_op.apic_physbase = (unsigned long)iosapic - -					__IA64_UNCACHED_OFFSET; -	apic_op.reg = reg; -	apic_op.value = val; -	HYPERVISOR_physdev_op(PHYSDEVOP_apic_write, &apic_op); -} - -static struct pv_iosapic_ops xen_iosapic_ops __initdata = { -	.pcat_compat_init = xen_pcat_compat_init, -	.__get_irq_chip = xen_iosapic_get_irq_chip, - -	.__read = xen_iosapic_read, -	.__write = xen_iosapic_write, -}; - -/*************************************************************************** - * pv_ops initialization - */ - -void __init -xen_setup_pv_ops(void) -{ -	xen_info_init(); -	pv_info = xen_info; -	pv_init_ops = xen_init_ops; -	pv_fsys_data = xen_fsys_data; -	pv_patchdata = xen_patchdata; -	pv_cpu_ops = xen_cpu_ops; -	pv_iosapic_ops = xen_iosapic_ops; -	pv_irq_ops = xen_irq_ops; -	pv_time_ops = xen_time_ops; - -	paravirt_cpu_asm_init(&xen_cpu_asm_switch); -} - -#ifdef ASM_SUPPORTED -/*************************************************************************** - * binary pacthing - * pv_init_ops.patch_bundle - */ - -#define DEFINE_FUNC_GETREG(name, privop)				\ -	DEFINE_FUNC0(get_ ## name,					\ -		     "break "__stringify(HYPERPRIVOP_GET_ ## privop) "\n") - -DEFINE_FUNC_GETREG(psr, PSR); -DEFINE_FUNC_GETREG(eflag, EFLAG); -DEFINE_FUNC_GETREG(ivr, IVR); -DEFINE_FUNC_GETREG(tpr, TPR); - -#define DEFINE_FUNC_SET_KR(n)						\ -	DEFINE_VOID_FUNC0(set_kr ## n,					\ -			  ";;\n"					\ -			  "mov r9 = r8\n"				\ -			  "mov r8 = " #n "\n"				\ -			  "break " __stringify(HYPERPRIVOP_SET_KR) "\n") - -DEFINE_FUNC_SET_KR(0); -DEFINE_FUNC_SET_KR(1); -DEFINE_FUNC_SET_KR(2); -DEFINE_FUNC_SET_KR(3); -DEFINE_FUNC_SET_KR(4); -DEFINE_FUNC_SET_KR(5); -DEFINE_FUNC_SET_KR(6); -DEFINE_FUNC_SET_KR(7); - -#define __DEFINE_FUNC_SETREG(name, privop)				\ -	DEFINE_VOID_FUNC0(name,						\ -			  "break "__stringify(HYPERPRIVOP_ ## privop) "\n") - -#define DEFINE_FUNC_SETREG(name, privop)			\ -	__DEFINE_FUNC_SETREG(set_ ## name, SET_ ## privop) - -DEFINE_FUNC_SETREG(eflag, EFLAG); -DEFINE_FUNC_SETREG(tpr, TPR); -__DEFINE_FUNC_SETREG(eoi, EOI); - -extern const char xen_check_events[]; -extern const char __xen_intrin_local_irq_restore_direct_start[]; -extern const char __xen_intrin_local_irq_restore_direct_end[]; -extern const unsigned long __xen_intrin_local_irq_restore_direct_reloc; - -asm ( -	".align 32\n" -	".proc xen_check_events\n" -	"xen_check_events:\n" -	/* masked = 0 -	 * r9 = masked_addr - 1 -	 *    = pending_intr_addr -	 */ -	"st1.rel [r9] = r0, -1\n" -	";;\n" -	/* r8 = pending_intr */ -	"ld1.acq r11 = [r9]\n" -	";;\n" -	/* p9 = interrupt pending? */ -	"cmp.ne p9, p10 = r11, r0\n" -	";;\n" -	"(p10) mf\n" -	/* issue hypercall to trigger interrupt */ -	"(p9) break " __stringify(HYPERPRIVOP_SSM_I) "\n" -	"br.cond.sptk.many b6\n" -	".endp xen_check_events\n" -	"\n" -	".align 32\n" -	".proc __xen_intrin_local_irq_restore_direct\n" -	"__xen_intrin_local_irq_restore_direct:\n" -	"__xen_intrin_local_irq_restore_direct_start:\n" -	"1:\n" -	"{\n" -	"cmp.ne p6, p7 = r8, r0\n" -	"mov r17 = ip\n" /* get ip to calc return address */ -	"mov r9 = "__stringify(XEN_PSR_I_ADDR_ADDR) "\n" -	";;\n" -	"}\n" -	"{\n" -	/* r9 = XEN_PSR_I_ADDR */ -	"ld8 r9 = [r9]\n" -	";;\n" -	/* r10 = masked previous value */ -	"(p6) ld1.acq r10 = [r9]\n" -	"adds r17 =  1f - 1b, r17\n" /* calculate return address */ -	";;\n" -	"}\n" -	"{\n" -	/* p8 = !masked interrupt masked previously? */ -	"(p6) cmp.ne.unc p8, p0 = r10, r0\n" -	"\n" -	/* p7 = else clause */ -	"(p7) mov r11 = 1\n" -	";;\n" -	"(p8) mov b6 = r17\n" /* set return address */ -	"}\n" -	"{\n" -	/* masked = 1 */ -	"(p7) st1.rel [r9] = r11\n" -	"\n" -	"[99:]\n" -	"(p8) brl.cond.dptk.few xen_check_events\n" -	"}\n" -	/* pv calling stub is 5 bundles. fill nop to adjust return address */ -	"{\n" -	"nop 0\n" -	"nop 0\n" -	"nop 0\n" -	"}\n" -	"1:\n" -	"__xen_intrin_local_irq_restore_direct_end:\n" -	".endp __xen_intrin_local_irq_restore_direct\n" -	"\n" -	".align 8\n" -	"__xen_intrin_local_irq_restore_direct_reloc:\n" -	"data8 99b\n" -); - -static struct paravirt_patch_bundle_elem xen_patch_bundle_elems[] -__initdata_or_module = -{ -#define XEN_PATCH_BUNDLE_ELEM(name, type)		\ -	{						\ -		(void*)xen_ ## name ## _direct_start,	\ -		(void*)xen_ ## name ## _direct_end,	\ -		PARAVIRT_PATCH_TYPE_ ## type,		\ -	} - -	XEN_PATCH_BUNDLE_ELEM(fc, FC), -	XEN_PATCH_BUNDLE_ELEM(thash, THASH), -	XEN_PATCH_BUNDLE_ELEM(get_cpuid, GET_CPUID), -	XEN_PATCH_BUNDLE_ELEM(get_pmd, GET_PMD), -	XEN_PATCH_BUNDLE_ELEM(ptcga, PTCGA), -	XEN_PATCH_BUNDLE_ELEM(get_rr, GET_RR), -	XEN_PATCH_BUNDLE_ELEM(set_rr, SET_RR), -	XEN_PATCH_BUNDLE_ELEM(set_rr0_to_rr4, SET_RR0_TO_RR4), -	XEN_PATCH_BUNDLE_ELEM(ssm_i, SSM_I), -	XEN_PATCH_BUNDLE_ELEM(rsm_i, RSM_I), -	XEN_PATCH_BUNDLE_ELEM(get_psr_i, GET_PSR_I), -	{ -		(void*)__xen_intrin_local_irq_restore_direct_start, -		(void*)__xen_intrin_local_irq_restore_direct_end, -		PARAVIRT_PATCH_TYPE_INTRIN_LOCAL_IRQ_RESTORE, -	}, - -#define XEN_PATCH_BUNDLE_ELEM_GETREG(name, reg)			\ -	{							\ -		xen_get_ ## name ## _direct_start,		\ -		xen_get_ ## name ## _direct_end,		\ -		PARAVIRT_PATCH_TYPE_GETREG + _IA64_REG_ ## reg, \ -	} - -	XEN_PATCH_BUNDLE_ELEM_GETREG(psr, PSR), -	XEN_PATCH_BUNDLE_ELEM_GETREG(eflag, AR_EFLAG), - -	XEN_PATCH_BUNDLE_ELEM_GETREG(ivr, CR_IVR), -	XEN_PATCH_BUNDLE_ELEM_GETREG(tpr, CR_TPR), - -	XEN_PATCH_BUNDLE_ELEM_GETREG(itc, AR_ITC), -	XEN_PATCH_BUNDLE_ELEM_GETREG(itm_with_offset, CR_ITM), - - -#define __XEN_PATCH_BUNDLE_ELEM_SETREG(name, reg)		\ -	{							\ -		xen_ ## name ## _direct_start,			\ -		xen_ ## name ## _direct_end,			\ -		PARAVIRT_PATCH_TYPE_SETREG + _IA64_REG_ ## reg, \ -	} - -#define XEN_PATCH_BUNDLE_ELEM_SETREG(name, reg)			\ -	__XEN_PATCH_BUNDLE_ELEM_SETREG(set_ ## name, reg) - -	XEN_PATCH_BUNDLE_ELEM_SETREG(kr0, AR_KR0), -	XEN_PATCH_BUNDLE_ELEM_SETREG(kr1, AR_KR1), -	XEN_PATCH_BUNDLE_ELEM_SETREG(kr2, AR_KR2), -	XEN_PATCH_BUNDLE_ELEM_SETREG(kr3, AR_KR3), -	XEN_PATCH_BUNDLE_ELEM_SETREG(kr4, AR_KR4), -	XEN_PATCH_BUNDLE_ELEM_SETREG(kr5, AR_KR5), -	XEN_PATCH_BUNDLE_ELEM_SETREG(kr6, AR_KR6), -	XEN_PATCH_BUNDLE_ELEM_SETREG(kr7, AR_KR7), - -	XEN_PATCH_BUNDLE_ELEM_SETREG(eflag, AR_EFLAG), -	XEN_PATCH_BUNDLE_ELEM_SETREG(tpr, CR_TPR), -	__XEN_PATCH_BUNDLE_ELEM_SETREG(eoi, CR_EOI), - -	XEN_PATCH_BUNDLE_ELEM_SETREG(itc, AR_ITC), -	XEN_PATCH_BUNDLE_ELEM_SETREG(itm_with_offset, CR_ITM), -}; - -static unsigned long __init_or_module -xen_patch_bundle(void *sbundle, void *ebundle, unsigned long type) -{ -	const unsigned long nelems = sizeof(xen_patch_bundle_elems) / -		sizeof(xen_patch_bundle_elems[0]); -	unsigned long used; -	const struct paravirt_patch_bundle_elem *found; - -	used = __paravirt_patch_apply_bundle(sbundle, ebundle, type, -					     xen_patch_bundle_elems, nelems, -					     &found); - -	if (found == NULL) -		/* fallback */ -		return ia64_native_patch_bundle(sbundle, ebundle, type); -	if (used == 0) -		return used; - -	/* relocation */ -	switch (type) { -	case PARAVIRT_PATCH_TYPE_INTRIN_LOCAL_IRQ_RESTORE: { -		unsigned long reloc = -			__xen_intrin_local_irq_restore_direct_reloc; -		unsigned long reloc_offset = reloc - (unsigned long) -			__xen_intrin_local_irq_restore_direct_start; -		unsigned long tag = (unsigned long)sbundle + reloc_offset; -		paravirt_patch_reloc_brl(tag, xen_check_events); -		break; -	} -	default: -		/* nothing */ -		break; -	} -	return used; -} -#endif /* ASM_SUPPOTED */ - -const struct paravirt_patch_branch_target xen_branch_target[] -__initconst = { -#define PARAVIRT_BR_TARGET(name, type)			\ -	{						\ -		&xen_ ## name,				\ -		PARAVIRT_PATCH_TYPE_BR_ ## type,	\ -	} -	PARAVIRT_BR_TARGET(switch_to, SWITCH_TO), -	PARAVIRT_BR_TARGET(leave_syscall, LEAVE_SYSCALL), -	PARAVIRT_BR_TARGET(work_processed_syscall, WORK_PROCESSED_SYSCALL), -	PARAVIRT_BR_TARGET(leave_kernel, LEAVE_KERNEL), -}; - -static void __init -xen_patch_branch(unsigned long tag, unsigned long type) -{ -	__paravirt_patch_apply_branch(tag, type, xen_branch_target, -					ARRAY_SIZE(xen_branch_target)); -} diff --git a/arch/ia64/xen/xencomm.c b/arch/ia64/xen/xencomm.c deleted file mode 100644 index 73d903ca2d6..00000000000 --- a/arch/ia64/xen/xencomm.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (C) 2006 Hollis Blanchard <hollisb@us.ibm.com>, IBM 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/mm.h> -#include <linux/err.h> - -static unsigned long kernel_virtual_offset; -static int is_xencomm_initialized; - -/* for xen early printk. It uses console io hypercall which uses xencomm. - * However early printk may use it before xencomm initialization. - */ -int -xencomm_is_initialized(void) -{ -	return is_xencomm_initialized; -} - -void -xencomm_initialize(void) -{ -	kernel_virtual_offset = KERNEL_START - ia64_tpa(KERNEL_START); -	is_xencomm_initialized = 1; -} - -/* Translate virtual address to physical address.  */ -unsigned long -xencomm_vtop(unsigned long vaddr) -{ -	struct page *page; -	struct vm_area_struct *vma; - -	if (vaddr == 0) -		return 0UL; - -	if (REGION_NUMBER(vaddr) == 5) { -		pgd_t *pgd; -		pud_t *pud; -		pmd_t *pmd; -		pte_t *ptep; - -		/* On ia64, TASK_SIZE refers to current.  It is not initialized -		   during boot. -		   Furthermore the kernel is relocatable and __pa() doesn't -		   work on  addresses.  */ -		if (vaddr >= KERNEL_START -		    && vaddr < (KERNEL_START + KERNEL_TR_PAGE_SIZE)) -			return vaddr - kernel_virtual_offset; - -		/* In kernel area -- virtually mapped.  */ -		pgd = pgd_offset_k(vaddr); -		if (pgd_none(*pgd) || pgd_bad(*pgd)) -			return ~0UL; - -		pud = pud_offset(pgd, vaddr); -		if (pud_none(*pud) || pud_bad(*pud)) -			return ~0UL; - -		pmd = pmd_offset(pud, vaddr); -		if (pmd_none(*pmd) || pmd_bad(*pmd)) -			return ~0UL; - -		ptep = pte_offset_kernel(pmd, vaddr); -		if (!ptep) -			return ~0UL; - -		return (pte_val(*ptep) & _PFN_MASK) | (vaddr & ~PAGE_MASK); -	} - -	if (vaddr > TASK_SIZE) { -		/* percpu variables */ -		if (REGION_NUMBER(vaddr) == 7 && -		    REGION_OFFSET(vaddr) >= (1ULL << IA64_MAX_PHYS_BITS)) -			ia64_tpa(vaddr); - -		/* kernel address */ -		return __pa(vaddr); -	} - -	/* XXX double-check (lack of) locking */ -	vma = find_extend_vma(current->mm, vaddr); -	if (!vma) -		return ~0UL; - -	/* We assume the page is modified.  */ -	page = follow_page(vma, vaddr, FOLL_WRITE | FOLL_TOUCH); -	if (IS_ERR_OR_NULL(page)) -		return ~0UL; - -	return (page_to_pfn(page) << PAGE_SHIFT) | (vaddr & ~PAGE_MASK); -} diff --git a/arch/ia64/xen/xenivt.S b/arch/ia64/xen/xenivt.S deleted file mode 100644 index 3e71d50584d..00000000000 --- a/arch/ia64/xen/xenivt.S +++ /dev/null @@ -1,52 +0,0 @@ -/* - * arch/ia64/xen/ivt.S - * - * Copyright (C) 2005 Hewlett-Packard Co - *	Dan Magenheimer <dan.magenheimer@hp.com> - * - * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp> - *                    VA Linux Systems Japan K.K. - *                    pv_ops. - */ - -#include <asm/asmmacro.h> -#include <asm/kregs.h> -#include <asm/pgtable.h> - -#include "../kernel/minstate.h" - -	.section .text,"ax" -GLOBAL_ENTRY(xen_event_callback) -	mov r31=pr		// prepare to save predicates -	;; -	SAVE_MIN_WITH_COVER	// uses r31; defines r2 and r3 -	;; -	movl r3=XSI_PSR_IC -	mov r14=1 -	;; -	st4 [r3]=r14 -	;; -	adds r3=8,r2		// set up second base pointer for SAVE_REST -	srlz.i			// ensure everybody knows psr.ic is back on -	;; -	SAVE_REST -	;; -1: -	alloc r14=ar.pfs,0,0,1,0 // must be first in an insn group -	add out0=16,sp		// pass pointer to pt_regs as first arg -	;; -	br.call.sptk.many b0=xen_evtchn_do_upcall -	;; -	movl r20=XSI_PSR_I_ADDR -	;; -	ld8 r20=[r20] -	;; -	adds r20=-1,r20		// vcpu_info->evtchn_upcall_pending -	;; -	ld1 r20=[r20] -	;; -	cmp.ne p6,p0=r20,r0	// if there are pending events, -	(p6) br.spnt.few 1b	// call evtchn_do_upcall again. -	br.sptk.many xen_leave_kernel	// we know ia64_leave_kernel is -					// paravirtualized as xen_leave_kernel -END(xen_event_callback) diff --git a/arch/ia64/xen/xensetup.S b/arch/ia64/xen/xensetup.S deleted file mode 100644 index e29519ebe2d..00000000000 --- a/arch/ia64/xen/xensetup.S +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Support routines for Xen - * - * Copyright (C) 2005 Dan Magenheimer <dan.magenheimer@hp.com> - */ - -#include <asm/processor.h> -#include <asm/asmmacro.h> -#include <asm/pgtable.h> -#include <asm/paravirt.h> -#include <asm/xen/privop.h> -#include <linux/elfnote.h> -#include <linux/init.h> -#include <xen/interface/elfnote.h> - -	.section .data..read_mostly -	.align 8 -	.global xen_domain_type -xen_domain_type: -	data4 XEN_NATIVE_ASM -	.previous - -	__INIT -ENTRY(startup_xen) -	// Calculate load offset. -	// The constant, LOAD_OFFSET, can't be used because the boot -	// loader doesn't always load to the LMA specified by the vmlinux.lds. -	mov r9=ip	// must be the first instruction to make sure -			// that r9 = the physical address of startup_xen. -			// Usually r9 = startup_xen - LOAD_OFFSET -	movl r8=startup_xen -	;; -	sub r9=r9,r8	// Usually r9 = -LOAD_OFFSET. - -	mov r10=PARAVIRT_HYPERVISOR_TYPE_XEN -	movl r11=_start -	;; -	add r11=r11,r9 -	movl r8=hypervisor_type -	;; -	add r8=r8,r9 -	mov b0=r11 -	;; -	st8 [r8]=r10 -	br.cond.sptk.many b0 -	;; -END(startup_xen) - -	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS,	.asciz "linux") -	ELFNOTE(Xen, XEN_ELFNOTE_GUEST_VERSION,	.asciz "2.6") -	ELFNOTE(Xen, XEN_ELFNOTE_XEN_VERSION,	.asciz "xen-3.0") -	ELFNOTE(Xen, XEN_ELFNOTE_ENTRY,		data8.ua startup_xen - LOAD_OFFSET) - -#define isBP	p3	// are we the Bootstrap Processor? - -GLOBAL_ENTRY(xen_setup_hook) -	mov r8=XEN_PV_DOMAIN_ASM -(isBP)	movl r9=xen_domain_type;; -(isBP)	st4 [r9]=r8 -	movl r10=xen_ivt;; - -	mov cr.iva=r10 - -	/* Set xsi base.  */ -#define FW_HYPERCALL_SET_SHARED_INFO_VA			0x600 -(isBP)	mov r2=FW_HYPERCALL_SET_SHARED_INFO_VA -(isBP)	movl r28=XSI_BASE;; -(isBP)	break 0x1000;; - -	/* setup pv_ops */ -(isBP)	mov r4=rp -	;; -(isBP)	br.call.sptk.many rp=xen_setup_pv_ops -	;; -(isBP)	mov rp=r4 -	;; - -	br.ret.sptk.many rp -	;; -END(xen_setup_hook)  | 
