diff options
Diffstat (limited to 'arch/um')
28 files changed, 408 insertions, 1335 deletions
diff --git a/arch/um/Kconfig.char b/arch/um/Kconfig.char index b9d7c427668..f10738d68b2 100644 --- a/arch/um/Kconfig.char +++ b/arch/um/Kconfig.char @@ -6,10 +6,6 @@ config STDERR_CONSOLE  	help  	  console driver which dumps all printk messages to stderr. -config STDIO_CONSOLE -	bool -	default y -  config SSL  	bool "Virtual serial line"  	help diff --git a/arch/um/Kconfig.common b/arch/um/Kconfig.common index 8ddea1f8006..6915d28cf11 100644 --- a/arch/um/Kconfig.common +++ b/arch/um/Kconfig.common @@ -1,11 +1,7 @@ -config DEFCONFIG_LIST -	string -	option defconfig_list -	default "arch/$ARCH/defconfig" -  config UML  	bool  	default y +	select HAVE_ARCH_AUDITSYSCALL  	select HAVE_UID16  	select GENERIC_IRQ_SHOW  	select GENERIC_CPU_DEVICES diff --git a/arch/um/Makefile b/arch/um/Makefile index 133f7de2a13..e4b1a9639c4 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -6,6 +6,17 @@  # Licensed under the GPL  # +# select defconfig based on actual architecture +ifeq ($(SUBARCH),x86) +  ifeq ($(shell uname -m),x86_64) +        KBUILD_DEFCONFIG := x86_64_defconfig +  else +        KBUILD_DEFCONFIG := i386_defconfig +  endif +else +        KBUILD_DEFCONFIG := $(SUBARCH)_defconfig +endif +  ARCH_DIR := arch/um  OS := $(shell uname -s)  # We require bash because the vmlinux link and loader script cpp use bash @@ -22,12 +33,11 @@ MODE_INCLUDE	+= -I$(srctree)/$(ARCH_DIR)/include/shared/skas  HEADER_ARCH 	:= $(SUBARCH) -# Additional ARCH settings for x86 -ifeq ($(SUBARCH),i386) -        HEADER_ARCH := x86 +ifneq ($(filter $(SUBARCH),x86 x86_64 i386),) +	HEADER_ARCH := x86  endif -ifeq ($(SUBARCH),x86_64) -        HEADER_ARCH := x86 + +ifdef CONFIG_64BIT  	KBUILD_CFLAGS += -mcmodel=large  endif @@ -101,8 +111,7 @@ endef  KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig  archheaders: -	$(Q)$(MAKE) -C '$(srctree)' KBUILD_SRC= \ -		ARCH=$(HEADER_ARCH) O='$(objtree)' archheaders +	$(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders  archprepare: include/generated/user_constants.h diff --git a/arch/um/configs/i386_defconfig b/arch/um/configs/i386_defconfig new file mode 100644 index 00000000000..a12bf68c9f3 --- /dev/null +++ b/arch/um/configs/i386_defconfig @@ -0,0 +1,76 @@ +CONFIG_3_LEVEL_PGTABLES=y +# CONFIG_COMPACTION is not set +CONFIG_BINFMT_MISC=m +CONFIG_HOSTFS=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_KERNEL_STACK_ORDER=1 +CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_LOG_BUF_SHIFT=14 +CONFIG_CGROUPS=y +CONFIG_CGROUP_FREEZER=y +CONFIG_CGROUP_DEVICE=y +CONFIG_CPUSETS=y +CONFIG_CGROUP_CPUACCT=y +CONFIG_RESOURCE_COUNTERS=y +CONFIG_CGROUP_SCHED=y +CONFIG_BLK_CGROUP=y +# CONFIG_PID_NS is not set +CONFIG_SYSFS_DEPRECATED=y +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SLAB=y +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_BLK_DEV_BSG is not set +CONFIG_IOSCHED_CFQ=m +CONFIG_SSL=y +CONFIG_NULL_CHAN=y +CONFIG_PORT_CHAN=y +CONFIG_PTY_CHAN=y +CONFIG_TTY_CHAN=y +CONFIG_XTERM_CHAN=y +CONFIG_CON_CHAN="pts" +CONFIG_SSL_CHAN="pts" +CONFIG_UML_SOUND=m +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_BLK_DEV_UBD=y +CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_NBD=m +CONFIG_DUMMY=m +CONFIG_TUN=m +CONFIG_PPP=m +CONFIG_SLIP=m +CONFIG_LEGACY_PTY_COUNT=32 +# CONFIG_HW_RANDOM is not set +CONFIG_UML_RANDOM=y +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_INET=y +# CONFIG_INET_LRO is not set +# CONFIG_IPV6 is not set +CONFIG_UML_NET=y +CONFIG_UML_NET_ETHERTAP=y +CONFIG_UML_NET_TUNTAP=y +CONFIG_UML_NET_SLIP=y +CONFIG_UML_NET_DAEMON=y +CONFIG_UML_NET_MCAST=y +CONFIG_UML_NET_SLIRP=y +CONFIG_EXT4_FS=y +CONFIG_REISERFS_FS=y +CONFIG_QUOTA=y +CONFIG_AUTOFS4_FS=m +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +CONFIG_PROC_KCORE=y +CONFIG_TMPFS=y +CONFIG_NLS=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_KERNEL=y diff --git a/arch/um/configs/x86_64_defconfig b/arch/um/configs/x86_64_defconfig new file mode 100644 index 00000000000..3aab117bd55 --- /dev/null +++ b/arch/um/configs/x86_64_defconfig @@ -0,0 +1,75 @@ +# CONFIG_COMPACTION is not set +CONFIG_BINFMT_MISC=m +CONFIG_HOSTFS=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_LOG_BUF_SHIFT=14 +CONFIG_CGROUPS=y +CONFIG_CGROUP_FREEZER=y +CONFIG_CGROUP_DEVICE=y +CONFIG_CPUSETS=y +CONFIG_CGROUP_CPUACCT=y +CONFIG_RESOURCE_COUNTERS=y +CONFIG_CGROUP_SCHED=y +CONFIG_BLK_CGROUP=y +# CONFIG_PID_NS is not set +CONFIG_SYSFS_DEPRECATED=y +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +CONFIG_SLAB=y +CONFIG_MODULES=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_BLK_DEV_BSG is not set +CONFIG_IOSCHED_CFQ=m +CONFIG_SSL=y +CONFIG_NULL_CHAN=y +CONFIG_PORT_CHAN=y +CONFIG_PTY_CHAN=y +CONFIG_TTY_CHAN=y +CONFIG_XTERM_CHAN=y +CONFIG_CON_CHAN="pts" +CONFIG_SSL_CHAN="pts" +CONFIG_UML_SOUND=m +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +CONFIG_DEVTMPFS=y +CONFIG_DEVTMPFS_MOUNT=y +CONFIG_BLK_DEV_UBD=y +CONFIG_BLK_DEV_LOOP=m +CONFIG_BLK_DEV_NBD=m +CONFIG_DUMMY=m +CONFIG_TUN=m +CONFIG_PPP=m +CONFIG_SLIP=m +CONFIG_LEGACY_PTY_COUNT=32 +# CONFIG_HW_RANDOM is not set +CONFIG_UML_RANDOM=y +CONFIG_NET=y +CONFIG_PACKET=y +CONFIG_UNIX=y +CONFIG_INET=y +# CONFIG_INET_LRO is not set +# CONFIG_IPV6 is not set +CONFIG_UML_NET=y +CONFIG_UML_NET_ETHERTAP=y +CONFIG_UML_NET_TUNTAP=y +CONFIG_UML_NET_SLIP=y +CONFIG_UML_NET_DAEMON=y +CONFIG_UML_NET_MCAST=y +CONFIG_UML_NET_SLIRP=y +CONFIG_EXT4_FS=y +CONFIG_REISERFS_FS=y +CONFIG_QUOTA=y +CONFIG_AUTOFS4_FS=m +CONFIG_ISO9660_FS=m +CONFIG_JOLIET=y +CONFIG_PROC_KCORE=y +CONFIG_TMPFS=y +CONFIG_NLS=y +CONFIG_DEBUG_INFO=y +CONFIG_FRAME_WARN=1024 +CONFIG_DEBUG_KERNEL=y diff --git a/arch/um/defconfig b/arch/um/defconfig deleted file mode 100644 index 2665e6b683f..00000000000 --- a/arch/um/defconfig +++ /dev/null @@ -1,899 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# User Mode Linux/i386 3.3.0 Kernel Configuration -# -CONFIG_DEFCONFIG_LIST="arch/$ARCH/defconfig" -CONFIG_UML=y -CONFIG_MMU=y -CONFIG_NO_IOMEM=y -# CONFIG_TRACE_IRQFLAGS_SUPPORT is not set -CONFIG_LOCKDEP_SUPPORT=y -# CONFIG_STACKTRACE_SUPPORT is not set -CONFIG_GENERIC_CALIBRATE_DELAY=y -CONFIG_GENERIC_BUG=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_HZ=100 - -# -# UML-specific options -# - -# -# Host processor type and features -# -# CONFIG_M486 is not set -# CONFIG_M586 is not set -# CONFIG_M586TSC is not set -# CONFIG_M586MMX is not set -CONFIG_M686=y -# CONFIG_MPENTIUMII is not set -# CONFIG_MPENTIUMIII is not set -# CONFIG_MPENTIUMM is not set -# CONFIG_MPENTIUM4 is not set -# CONFIG_MK6 is not set -# CONFIG_MK7 is not set -# CONFIG_MK8 is not set -# CONFIG_MCRUSOE is not set -# CONFIG_MEFFICEON is not set -# CONFIG_MWINCHIPC6 is not set -# CONFIG_MWINCHIP3D is not set -# CONFIG_MELAN is not set -# CONFIG_MGEODEGX1 is not set -# CONFIG_MGEODE_LX is not set -# CONFIG_MCYRIXIII is not set -# CONFIG_MVIAC3_2 is not set -# CONFIG_MVIAC7 is not set -# CONFIG_MCORE2 is not set -# CONFIG_MATOM is not set -# CONFIG_X86_GENERIC is not set -CONFIG_X86_INTERNODE_CACHE_SHIFT=5 -CONFIG_X86_CMPXCHG=y -CONFIG_X86_L1_CACHE_SHIFT=5 -CONFIG_X86_XADD=y -CONFIG_X86_PPRO_FENCE=y -CONFIG_X86_WP_WORKS_OK=y -CONFIG_X86_INVLPG=y -CONFIG_X86_BSWAP=y -CONFIG_X86_POPAD_OK=y -CONFIG_X86_USE_PPRO_CHECKSUM=y -CONFIG_X86_TSC=y -CONFIG_X86_CMPXCHG64=y -CONFIG_X86_CMOV=y -CONFIG_X86_MINIMUM_CPU_FAMILY=5 -CONFIG_CPU_SUP_INTEL=y -CONFIG_CPU_SUP_CYRIX_32=y -CONFIG_CPU_SUP_AMD=y -CONFIG_CPU_SUP_CENTAUR=y -CONFIG_CPU_SUP_TRANSMETA_32=y -CONFIG_CPU_SUP_UMC_32=y -CONFIG_UML_X86=y -# CONFIG_64BIT is not set -CONFIG_X86_32=y -# CONFIG_X86_64 is not set -# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set -CONFIG_RWSEM_GENERIC_SPINLOCK=y -# CONFIG_3_LEVEL_PGTABLES is not set -CONFIG_ARCH_HAS_SC_SIGNALS=y -CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA=y -CONFIG_GENERIC_HWEIGHT=y -# CONFIG_STATIC_LINK is not set -CONFIG_SELECT_MEMORY_MODEL=y -CONFIG_FLATMEM_MANUAL=y -CONFIG_FLATMEM=y -CONFIG_FLAT_NODE_MEM_MAP=y -CONFIG_PAGEFLAGS_EXTENDED=y -CONFIG_SPLIT_PTLOCK_CPUS=4 -# CONFIG_COMPACTION is not set -# CONFIG_PHYS_ADDR_T_64BIT is not set -CONFIG_ZONE_DMA_FLAG=0 -CONFIG_VIRT_TO_BUS=y -# CONFIG_KSM is not set -CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 -CONFIG_NEED_PER_CPU_KM=y -# CONFIG_CLEANCACHE is not set -CONFIG_TICK_ONESHOT=y -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y -CONFIG_LD_SCRIPT_DYN=y -CONFIG_BINFMT_ELF=y -CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y -CONFIG_HAVE_AOUT=y -# CONFIG_BINFMT_AOUT is not set -CONFIG_BINFMT_MISC=m -CONFIG_HOSTFS=y -# CONFIG_HPPFS is not set -CONFIG_MCONSOLE=y -CONFIG_MAGIC_SYSRQ=y -CONFIG_KERNEL_STACK_ORDER=0 -# CONFIG_MMAPPER is not set -CONFIG_NO_DMA=y - -# -# General setup -# -CONFIG_EXPERIMENTAL=y -CONFIG_BROKEN_ON_SMP=y -CONFIG_INIT_ENV_ARG_LIMIT=128 -CONFIG_CROSS_COMPILE="" -CONFIG_LOCALVERSION="" -CONFIG_LOCALVERSION_AUTO=y -CONFIG_DEFAULT_HOSTNAME="(none)" -CONFIG_SWAP=y -CONFIG_SYSVIPC=y -CONFIG_SYSVIPC_SYSCTL=y -CONFIG_POSIX_MQUEUE=y -CONFIG_POSIX_MQUEUE_SYSCTL=y -CONFIG_BSD_PROCESS_ACCT=y -# CONFIG_BSD_PROCESS_ACCT_V3 is not set -# CONFIG_FHANDLE is not set -# CONFIG_TASKSTATS is not set -# CONFIG_AUDIT is not set - -# -# IRQ subsystem -# -CONFIG_GENERIC_IRQ_SHOW=y - -# -# RCU Subsystem -# -CONFIG_TINY_RCU=y -# CONFIG_PREEMPT_RCU is not set -# CONFIG_RCU_TRACE is not set -# CONFIG_TREE_RCU_TRACE is not set -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_LOG_BUF_SHIFT=14 -CONFIG_CGROUPS=y -# CONFIG_CGROUP_DEBUG is not set -CONFIG_CGROUP_FREEZER=y -CONFIG_CGROUP_DEVICE=y -CONFIG_CPUSETS=y -CONFIG_PROC_PID_CPUSET=y -CONFIG_CGROUP_CPUACCT=y -CONFIG_RESOURCE_COUNTERS=y -CONFIG_CGROUP_MEMCG=y -CONFIG_CGROUP_MEMCG_SWAP=y -# CONFIG_CGROUP_MEMCG_SWAP_ENABLED is not set -# CONFIG_CGROUP_MEMCG_KMEM is not set -CONFIG_CGROUP_SCHED=y -CONFIG_FAIR_GROUP_SCHED=y -# CONFIG_CFS_BANDWIDTH is not set -# CONFIG_RT_GROUP_SCHED is not set -CONFIG_BLK_CGROUP=y -# CONFIG_DEBUG_BLK_CGROUP is not set -# CONFIG_CHECKPOINT_RESTORE is not set -CONFIG_NAMESPACES=y -CONFIG_UTS_NS=y -CONFIG_IPC_NS=y -# CONFIG_USER_NS is not set -# CONFIG_PID_NS is not set -CONFIG_NET_NS=y -# CONFIG_SCHED_AUTOGROUP is not set -CONFIG_MM_OWNER=y -CONFIG_SYSFS_DEPRECATED=y -# CONFIG_SYSFS_DEPRECATED_V2 is not set -# CONFIG_RELAY is not set -# CONFIG_BLK_DEV_INITRD is not set -CONFIG_CC_OPTIMIZE_FOR_SIZE=y -CONFIG_SYSCTL=y -CONFIG_ANON_INODES=y -# CONFIG_EXPERT is not set -CONFIG_UID16=y -# CONFIG_SYSCTL_SYSCALL is not set -CONFIG_KALLSYMS=y -# CONFIG_KALLSYMS_ALL is not set -CONFIG_HOTPLUG=y -CONFIG_PRINTK=y -CONFIG_BUG=y -CONFIG_ELF_CORE=y -CONFIG_BASE_FULL=y -CONFIG_FUTEX=y -CONFIG_EPOLL=y -CONFIG_SIGNALFD=y -CONFIG_TIMERFD=y -CONFIG_EVENTFD=y -CONFIG_SHMEM=y -CONFIG_AIO=y -# CONFIG_EMBEDDED is not set - -# -# Kernel Performance Events And Counters -# -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_COMPAT_BRK=y -CONFIG_SLAB=y -# CONFIG_SLUB is not set -# CONFIG_PROFILING is not set - -# -# GCOV-based kernel profiling -# -# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set -CONFIG_SLABINFO=y -CONFIG_RT_MUTEXES=y -CONFIG_BASE_SMALL=0 -CONFIG_MODULES=y -# CONFIG_MODULE_FORCE_LOAD is not set -CONFIG_MODULE_UNLOAD=y -# CONFIG_MODULE_FORCE_UNLOAD is not set -# CONFIG_MODVERSIONS is not set -# CONFIG_MODULE_SRCVERSION_ALL is not set -CONFIG_BLOCK=y -CONFIG_LBDAF=y -# CONFIG_BLK_DEV_BSG is not set -# CONFIG_BLK_DEV_BSGLIB is not set -# CONFIG_BLK_DEV_INTEGRITY is not set - -# -# Partition Types -# -# CONFIG_PARTITION_ADVANCED is not set -CONFIG_MSDOS_PARTITION=y - -# -# IO Schedulers -# -CONFIG_IOSCHED_NOOP=y -CONFIG_IOSCHED_DEADLINE=y -CONFIG_IOSCHED_CFQ=m -# CONFIG_CFQ_GROUP_IOSCHED is not set -CONFIG_DEFAULT_DEADLINE=y -# CONFIG_DEFAULT_CFQ is not set -# CONFIG_DEFAULT_NOOP is not set -CONFIG_DEFAULT_IOSCHED="deadline" -# CONFIG_INLINE_SPIN_TRYLOCK is not set -# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set -# CONFIG_INLINE_SPIN_LOCK is not set -# CONFIG_INLINE_SPIN_LOCK_BH is not set -# CONFIG_INLINE_SPIN_LOCK_IRQ is not set -# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set -CONFIG_INLINE_SPIN_UNLOCK=y -# CONFIG_INLINE_SPIN_UNLOCK_BH is not set -CONFIG_INLINE_SPIN_UNLOCK_IRQ=y -# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set -# CONFIG_INLINE_READ_TRYLOCK is not set -# CONFIG_INLINE_READ_LOCK is not set -# CONFIG_INLINE_READ_LOCK_BH is not set -# CONFIG_INLINE_READ_LOCK_IRQ is not set -# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set -CONFIG_INLINE_READ_UNLOCK=y -# CONFIG_INLINE_READ_UNLOCK_BH is not set -CONFIG_INLINE_READ_UNLOCK_IRQ=y -# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set -# CONFIG_INLINE_WRITE_TRYLOCK is not set -# CONFIG_INLINE_WRITE_LOCK is not set -# CONFIG_INLINE_WRITE_LOCK_BH is not set -# CONFIG_INLINE_WRITE_LOCK_IRQ is not set -# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set -CONFIG_INLINE_WRITE_UNLOCK=y -# CONFIG_INLINE_WRITE_UNLOCK_BH is not set -CONFIG_INLINE_WRITE_UNLOCK_IRQ=y -# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set -# CONFIG_MUTEX_SPIN_ON_OWNER is not set -CONFIG_FREEZER=y - -# -# UML Character Devices -# -CONFIG_STDERR_CONSOLE=y -CONFIG_STDIO_CONSOLE=y -CONFIG_SSL=y -CONFIG_NULL_CHAN=y -CONFIG_PORT_CHAN=y -CONFIG_PTY_CHAN=y -CONFIG_TTY_CHAN=y -CONFIG_XTERM_CHAN=y -# CONFIG_NOCONFIG_CHAN is not set -CONFIG_CON_ZERO_CHAN="fd:0,fd:1" -CONFIG_CON_CHAN="xterm" -CONFIG_SSL_CHAN="pts" -CONFIG_UML_SOUND=m -CONFIG_SOUND=m -CONFIG_SOUND_OSS_CORE=y -CONFIG_HOSTAUDIO=m - -# -# Device Drivers -# - -# -# Generic Driver Options -# -CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" -CONFIG_DEVTMPFS=y -CONFIG_DEVTMPFS_MOUNT=y -CONFIG_STANDALONE=y -CONFIG_PREVENT_FIRMWARE_BUILD=y -CONFIG_FW_LOADER=y -CONFIG_FIRMWARE_IN_KERNEL=y -CONFIG_EXTRA_FIRMWARE="" -# CONFIG_DEBUG_DRIVER is not set -# CONFIG_DEBUG_DEVRES is not set -# CONFIG_SYS_HYPERVISOR is not set -CONFIG_GENERIC_CPU_DEVICES=y -# CONFIG_DMA_SHARED_BUFFER is not set -# CONFIG_CONNECTOR is not set -# CONFIG_MTD is not set -CONFIG_BLK_DEV=y -CONFIG_BLK_DEV_UBD=y -# CONFIG_BLK_DEV_UBD_SYNC is not set -CONFIG_BLK_DEV_COW_COMMON=y -CONFIG_BLK_DEV_LOOP=m -CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 -# CONFIG_BLK_DEV_CRYPTOLOOP is not set - -# -# DRBD disabled because PROC_FS, INET or CONNECTOR not selected -# -CONFIG_BLK_DEV_NBD=m -# CONFIG_BLK_DEV_RAM is not set -# CONFIG_ATA_OVER_ETH is not set -# CONFIG_BLK_DEV_RBD is not set - -# -# Misc devices -# -# CONFIG_ENCLOSURE_SERVICES is not set -# CONFIG_C2PORT is not set - -# -# EEPROM support -# -# CONFIG_EEPROM_93CX6 is not set - -# -# Texas Instruments shared transport line discipline -# - -# -# Altera FPGA firmware download module -# - -# -# SCSI device support -# -CONFIG_SCSI_MOD=y -# CONFIG_RAID_ATTRS is not set -# CONFIG_SCSI is not set -# CONFIG_SCSI_DMA is not set -# CONFIG_SCSI_NETLINK is not set -# CONFIG_MD is not set -CONFIG_NETDEVICES=y -CONFIG_NET_CORE=y -# CONFIG_BONDING is not set -CONFIG_DUMMY=m -# CONFIG_EQUALIZER is not set -# CONFIG_MII is not set -# CONFIG_NET_TEAM is not set -# CONFIG_MACVLAN is not set -# CONFIG_NETCONSOLE is not set -# CONFIG_NETPOLL is not set -# CONFIG_NET_POLL_CONTROLLER is not set -CONFIG_TUN=m -# CONFIG_VETH is not set - -# -# CAIF transport drivers -# -CONFIG_ETHERNET=y -CONFIG_NET_VENDOR_CHELSIO=y -CONFIG_NET_VENDOR_INTEL=y -CONFIG_NET_VENDOR_I825XX=y -CONFIG_NET_VENDOR_MARVELL=y -CONFIG_NET_VENDOR_NATSEMI=y -CONFIG_NET_VENDOR_8390=y -# CONFIG_PHYLIB is not set -CONFIG_PPP=m -# CONFIG_PPP_BSDCOMP is not set -# CONFIG_PPP_DEFLATE is not set -# CONFIG_PPP_FILTER is not set -# CONFIG_PPP_MPPE is not set -# CONFIG_PPP_MULTILINK is not set -# CONFIG_PPPOE is not set -# CONFIG_PPP_ASYNC is not set -# CONFIG_PPP_SYNC_TTY is not set -CONFIG_SLIP=m -CONFIG_SLHC=m -# CONFIG_SLIP_COMPRESSED is not set -# CONFIG_SLIP_SMART is not set -# CONFIG_SLIP_MODE_SLIP6 is not set -CONFIG_WLAN=y -# CONFIG_HOSTAP is not set - -# -# Enable WiMAX (Networking options) to see the WiMAX drivers -# -# CONFIG_WAN is not set - -# -# Character devices -# -CONFIG_UNIX98_PTYS=y -# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set -CONFIG_LEGACY_PTYS=y -CONFIG_LEGACY_PTY_COUNT=32 -# CONFIG_N_GSM is not set -# CONFIG_TRACE_SINK is not set -CONFIG_DEVKMEM=y -# CONFIG_HW_RANDOM is not set -CONFIG_UML_RANDOM=y -# CONFIG_R3964 is not set -# CONFIG_NSC_GPIO is not set -# CONFIG_RAW_DRIVER is not set - -# -# PPS support -# -# CONFIG_PPS is not set - -# -# PPS generators support -# - -# -# PTP clock support -# - -# -# Enable Device Drivers -> PPS to see the PTP clock options. -# -# CONFIG_POWER_SUPPLY is not set -# CONFIG_THERMAL is not set -# CONFIG_WATCHDOG is not set -# CONFIG_REGULATOR is not set -CONFIG_SOUND_OSS_CORE_PRECLAIM=y -# CONFIG_MEMSTICK is not set -# CONFIG_NEW_LEDS is not set -# CONFIG_ACCESSIBILITY is not set -# CONFIG_AUXDISPLAY is not set -# CONFIG_UIO is not set - -# -# Virtio drivers -# -# CONFIG_VIRTIO_BALLOON is not set - -# -# Microsoft Hyper-V guest support -# -# CONFIG_STAGING is not set - -# -# Hardware Spinlock drivers -# -CONFIG_IOMMU_SUPPORT=y -# CONFIG_VIRT_DRIVERS is not set -# CONFIG_PM_DEVFREQ is not set -CONFIG_NET=y - -# -# Networking options -# -CONFIG_PACKET=y -CONFIG_UNIX=y -# CONFIG_UNIX_DIAG is not set -CONFIG_XFRM=y -# CONFIG_XFRM_USER is not set -# CONFIG_XFRM_SUB_POLICY is not set -# CONFIG_XFRM_MIGRATE is not set -# CONFIG_XFRM_STATISTICS is not set -# CONFIG_NET_KEY is not set -CONFIG_INET=y -# CONFIG_IP_MULTICAST is not set -# CONFIG_IP_ADVANCED_ROUTER is not set -# CONFIG_IP_PNP is not set -# CONFIG_NET_IPIP is not set -# CONFIG_NET_IPGRE_DEMUX is not set -# CONFIG_ARPD is not set -# CONFIG_SYN_COOKIES is not set -# CONFIG_INET_AH is not set -# CONFIG_INET_ESP is not set -# CONFIG_INET_IPCOMP is not set -# CONFIG_INET_XFRM_TUNNEL is not set -# CONFIG_INET_TUNNEL is not set -CONFIG_INET_XFRM_MODE_TRANSPORT=y -CONFIG_INET_XFRM_MODE_TUNNEL=y -CONFIG_INET_XFRM_MODE_BEET=y -# CONFIG_INET_LRO is not set -CONFIG_INET_DIAG=y -CONFIG_INET_TCP_DIAG=y -# CONFIG_INET_UDP_DIAG is not set -# CONFIG_TCP_CONG_ADVANCED is not set -CONFIG_TCP_CONG_CUBIC=y -CONFIG_DEFAULT_TCP_CONG="cubic" -# CONFIG_TCP_MD5SIG is not set -# CONFIG_IPV6 is not set -# CONFIG_NETWORK_SECMARK is not set -# CONFIG_NETWORK_PHY_TIMESTAMPING is not set -# CONFIG_NETFILTER is not set -# CONFIG_IP_DCCP is not set -# CONFIG_IP_SCTP is not set -# CONFIG_RDS is not set -# CONFIG_TIPC is not set -# CONFIG_ATM is not set -# CONFIG_L2TP is not set -# CONFIG_BRIDGE is not set -# CONFIG_NET_DSA is not set -# CONFIG_VLAN_8021Q is not set -# CONFIG_DECNET is not set -# CONFIG_LLC2 is not set -# CONFIG_IPX is not set -# CONFIG_ATALK is not set -# CONFIG_X25 is not set -# CONFIG_LAPB is not set -# CONFIG_ECONET is not set -# CONFIG_WAN_ROUTER is not set -# CONFIG_PHONET is not set -# CONFIG_IEEE802154 is not set -# CONFIG_NET_SCHED is not set -# CONFIG_DCB is not set -# CONFIG_BATMAN_ADV is not set -# CONFIG_OPENVSWITCH is not set -# CONFIG_NETPRIO_CGROUP is not set -CONFIG_BQL=y - -# -# Network testing -# -# CONFIG_NET_PKTGEN is not set -# CONFIG_HAMRADIO is not set -# CONFIG_CAN is not set -# CONFIG_IRDA is not set -# CONFIG_BT is not set -# CONFIG_AF_RXRPC is not set -CONFIG_WIRELESS=y -# CONFIG_CFG80211 is not set -# CONFIG_LIB80211 is not set - -# -# CFG80211 needs to be enabled for MAC80211 -# -# CONFIG_WIMAX is not set -# CONFIG_RFKILL is not set -# CONFIG_NET_9P is not set -# CONFIG_CAIF is not set -# CONFIG_CEPH_LIB is not set -# CONFIG_NFC is not set - -# -# UML Network Devices -# -CONFIG_UML_NET=y -CONFIG_UML_NET_ETHERTAP=y -CONFIG_UML_NET_TUNTAP=y -CONFIG_UML_NET_SLIP=y -CONFIG_UML_NET_DAEMON=y -# CONFIG_UML_NET_VDE is not set -CONFIG_UML_NET_MCAST=y -# CONFIG_UML_NET_PCAP is not set -CONFIG_UML_NET_SLIRP=y - -# -# File systems -# -# CONFIG_EXT2_FS is not set -# CONFIG_EXT3_FS is not set -CONFIG_EXT4_FS=y -CONFIG_EXT4_USE_FOR_EXT23=y -CONFIG_EXT4_FS_XATTR=y -# CONFIG_EXT4_FS_POSIX_ACL is not set -# CONFIG_EXT4_FS_SECURITY is not set -# CONFIG_EXT4_DEBUG is not set -CONFIG_JBD2=y -CONFIG_FS_MBCACHE=y -CONFIG_REISERFS_FS=y -# CONFIG_REISERFS_CHECK is not set -# CONFIG_REISERFS_PROC_INFO is not set -# CONFIG_REISERFS_FS_XATTR is not set -# CONFIG_JFS_FS is not set -# CONFIG_XFS_FS is not set -# CONFIG_GFS2_FS is not set -# CONFIG_BTRFS_FS is not set -# CONFIG_NILFS2_FS is not set -# CONFIG_FS_POSIX_ACL is not set -CONFIG_FILE_LOCKING=y -CONFIG_FSNOTIFY=y -CONFIG_DNOTIFY=y -CONFIG_INOTIFY_USER=y -# CONFIG_FANOTIFY is not set -CONFIG_QUOTA=y -# CONFIG_QUOTA_NETLINK_INTERFACE is not set -CONFIG_PRINT_QUOTA_WARNING=y -# CONFIG_QUOTA_DEBUG is not set -# CONFIG_QFMT_V1 is not set -# CONFIG_QFMT_V2 is not set -CONFIG_QUOTACTL=y -CONFIG_AUTOFS4_FS=m -# CONFIG_FUSE_FS is not set - -# -# Caches -# -# CONFIG_FSCACHE is not set - -# -# CD-ROM/DVD Filesystems -# -CONFIG_ISO9660_FS=m -CONFIG_JOLIET=y -# CONFIG_ZISOFS is not set -# CONFIG_UDF_FS is not set - -# -# DOS/FAT/NT Filesystems -# -# CONFIG_MSDOS_FS is not set -# CONFIG_VFAT_FS is not set -# CONFIG_NTFS_FS is not set - -# -# Pseudo filesystems -# -CONFIG_PROC_FS=y -CONFIG_PROC_KCORE=y -CONFIG_PROC_SYSCTL=y -CONFIG_PROC_PAGE_MONITOR=y -CONFIG_SYSFS=y -CONFIG_TMPFS=y -# CONFIG_TMPFS_POSIX_ACL is not set -# CONFIG_TMPFS_XATTR is not set -# CONFIG_HUGETLB_PAGE is not set -# CONFIG_CONFIGFS_FS is not set -CONFIG_MISC_FILESYSTEMS=y -# CONFIG_ADFS_FS is not set -# CONFIG_AFFS_FS is not set -# CONFIG_HFS_FS is not set -# CONFIG_HFSPLUS_FS is not set -# CONFIG_BEFS_FS is not set -# CONFIG_BFS_FS is not set -# CONFIG_EFS_FS is not set -# CONFIG_LOGFS is not set -# CONFIG_CRAMFS is not set -# CONFIG_SQUASHFS is not set -# CONFIG_VXFS_FS is not set -# CONFIG_MINIX_FS is not set -# CONFIG_OMFS_FS is not set -# CONFIG_HPFS_FS is not set -# CONFIG_QNX4FS_FS is not set -# CONFIG_ROMFS_FS is not set -# CONFIG_PSTORE is not set -# CONFIG_SYSV_FS is not set -# CONFIG_UFS_FS is not set -CONFIG_NETWORK_FILESYSTEMS=y -# CONFIG_NFS_FS is not set -# CONFIG_NFSD is not set -# CONFIG_CEPH_FS is not set -# CONFIG_CIFS is not set -# CONFIG_NCP_FS is not set -# CONFIG_CODA_FS is not set -# CONFIG_AFS_FS is not set -CONFIG_NLS=y -CONFIG_NLS_DEFAULT="iso8859-1" -# CONFIG_NLS_CODEPAGE_437 is not set -# CONFIG_NLS_CODEPAGE_737 is not set -# CONFIG_NLS_CODEPAGE_775 is not set -# CONFIG_NLS_CODEPAGE_850 is not set -# CONFIG_NLS_CODEPAGE_852 is not set -# CONFIG_NLS_CODEPAGE_855 is not set -# CONFIG_NLS_CODEPAGE_857 is not set -# CONFIG_NLS_CODEPAGE_860 is not set -# CONFIG_NLS_CODEPAGE_861 is not set -# CONFIG_NLS_CODEPAGE_862 is not set -# CONFIG_NLS_CODEPAGE_863 is not set -# CONFIG_NLS_CODEPAGE_864 is not set -# CONFIG_NLS_CODEPAGE_865 is not set -# CONFIG_NLS_CODEPAGE_866 is not set -# CONFIG_NLS_CODEPAGE_869 is not set -# CONFIG_NLS_CODEPAGE_936 is not set -# CONFIG_NLS_CODEPAGE_950 is not set -# CONFIG_NLS_CODEPAGE_932 is not set -# CONFIG_NLS_CODEPAGE_949 is not set -# CONFIG_NLS_CODEPAGE_874 is not set -# CONFIG_NLS_ISO8859_8 is not set -# CONFIG_NLS_CODEPAGE_1250 is not set -# CONFIG_NLS_CODEPAGE_1251 is not set -# CONFIG_NLS_ASCII is not set -# CONFIG_NLS_ISO8859_1 is not set -# CONFIG_NLS_ISO8859_2 is not set -# CONFIG_NLS_ISO8859_3 is not set -# CONFIG_NLS_ISO8859_4 is not set -# CONFIG_NLS_ISO8859_5 is not set -# CONFIG_NLS_ISO8859_6 is not set -# CONFIG_NLS_ISO8859_7 is not set -# CONFIG_NLS_ISO8859_9 is not set -# CONFIG_NLS_ISO8859_13 is not set -# CONFIG_NLS_ISO8859_14 is not set -# CONFIG_NLS_ISO8859_15 is not set -# CONFIG_NLS_KOI8_R is not set -# CONFIG_NLS_KOI8_U is not set -# CONFIG_NLS_UTF8 is not set - -# -# Security options -# -# CONFIG_KEYS is not set -# CONFIG_SECURITY_DMESG_RESTRICT is not set -# CONFIG_SECURITY is not set -# CONFIG_SECURITYFS is not set -CONFIG_DEFAULT_SECURITY_DAC=y -CONFIG_DEFAULT_SECURITY="" -CONFIG_CRYPTO=y - -# -# Crypto core or helper -# -# CONFIG_CRYPTO_FIPS is not set -CONFIG_CRYPTO_ALGAPI=m -CONFIG_CRYPTO_ALGAPI2=m -CONFIG_CRYPTO_RNG=m -CONFIG_CRYPTO_RNG2=m -# CONFIG_CRYPTO_MANAGER is not set -# CONFIG_CRYPTO_MANAGER2 is not set -# CONFIG_CRYPTO_USER is not set -# CONFIG_CRYPTO_GF128MUL is not set -# CONFIG_CRYPTO_NULL is not set -# CONFIG_CRYPTO_CRYPTD is not set -# CONFIG_CRYPTO_AUTHENC is not set -# CONFIG_CRYPTO_TEST is not set - -# -# Authenticated Encryption with Associated Data -# -# CONFIG_CRYPTO_CCM is not set -# CONFIG_CRYPTO_GCM is not set -# CONFIG_CRYPTO_SEQIV is not set - -# -# Block modes -# -# CONFIG_CRYPTO_CBC is not set -# CONFIG_CRYPTO_CTR is not set -# CONFIG_CRYPTO_CTS is not set -# CONFIG_CRYPTO_ECB is not set -# CONFIG_CRYPTO_LRW is not set -# CONFIG_CRYPTO_PCBC is not set -# CONFIG_CRYPTO_XTS is not set - -# -# Hash modes -# -# CONFIG_CRYPTO_HMAC is not set -# CONFIG_CRYPTO_XCBC is not set -# CONFIG_CRYPTO_VMAC is not set - -# -# Digest -# -# CONFIG_CRYPTO_CRC32C is not set -# CONFIG_CRYPTO_GHASH is not set -# CONFIG_CRYPTO_MD4 is not set -# CONFIG_CRYPTO_MD5 is not set -# CONFIG_CRYPTO_MICHAEL_MIC is not set -# CONFIG_CRYPTO_RMD128 is not set -# CONFIG_CRYPTO_RMD160 is not set -# CONFIG_CRYPTO_RMD256 is not set -# CONFIG_CRYPTO_RMD320 is not set -# CONFIG_CRYPTO_SHA1 is not set -# CONFIG_CRYPTO_SHA256 is not set -# CONFIG_CRYPTO_SHA512 is not set -# CONFIG_CRYPTO_TGR192 is not set -# CONFIG_CRYPTO_WP512 is not set - -# -# Ciphers -# -CONFIG_CRYPTO_AES=m -# CONFIG_CRYPTO_AES_586 is not set -# CONFIG_CRYPTO_ANUBIS is not set -# CONFIG_CRYPTO_ARC4 is not set -# CONFIG_CRYPTO_BLOWFISH is not set -# CONFIG_CRYPTO_CAMELLIA is not set -# CONFIG_CRYPTO_CAST5 is not set -# CONFIG_CRYPTO_CAST6 is not set -# CONFIG_CRYPTO_DES is not set -# CONFIG_CRYPTO_FCRYPT is not set -# CONFIG_CRYPTO_KHAZAD is not set -# CONFIG_CRYPTO_SALSA20 is not set -# CONFIG_CRYPTO_SALSA20_586 is not set -# CONFIG_CRYPTO_SEED is not set -# CONFIG_CRYPTO_SERPENT is not set -# CONFIG_CRYPTO_TEA is not set -# CONFIG_CRYPTO_TWOFISH is not set -# CONFIG_CRYPTO_TWOFISH_586 is not set - -# -# Compression -# -# CONFIG_CRYPTO_DEFLATE is not set -# CONFIG_CRYPTO_ZLIB is not set -# CONFIG_CRYPTO_LZO is not set - -# -# Random Number Generation -# -CONFIG_CRYPTO_ANSI_CPRNG=m -# CONFIG_CRYPTO_USER_API_HASH is not set -# CONFIG_CRYPTO_USER_API_SKCIPHER is not set -CONFIG_CRYPTO_HW=y -# CONFIG_BINARY_PRINTF is not set - -# -# Library routines -# -CONFIG_BITREVERSE=y -CONFIG_GENERIC_FIND_FIRST_BIT=y -CONFIG_GENERIC_IO=y -# CONFIG_CRC_CCITT is not set -CONFIG_CRC16=y -# CONFIG_CRC_T10DIF is not set -# CONFIG_CRC_ITU_T is not set -CONFIG_CRC32=y -# CONFIG_CRC7 is not set -# CONFIG_LIBCRC32C is not set -# CONFIG_CRC8 is not set -# CONFIG_XZ_DEC is not set -# CONFIG_XZ_DEC_BCJ is not set -CONFIG_DQL=y -CONFIG_NLATTR=y -# CONFIG_AVERAGE is not set -# CONFIG_CORDIC is not set - -# -# Kernel hacking -# -# CONFIG_PRINTK_TIME is not set -CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4 -CONFIG_ENABLE_WARN_DEPRECATED=y -CONFIG_ENABLE_MUST_CHECK=y -CONFIG_FRAME_WARN=1024 -# CONFIG_STRIP_ASM_SYMS is not set -# CONFIG_UNUSED_SYMBOLS is not set -# CONFIG_DEBUG_FS is not set -# CONFIG_DEBUG_SECTION_MISMATCH is not set -CONFIG_DEBUG_KERNEL=y -# CONFIG_DEBUG_SHIRQ is not set -# CONFIG_LOCKUP_DETECTOR is not set -# CONFIG_HARDLOCKUP_DETECTOR is not set -# CONFIG_DETECT_HUNG_TASK is not set -CONFIG_SCHED_DEBUG=y -# CONFIG_SCHEDSTATS is not set -# CONFIG_TIMER_STATS is not set -# CONFIG_DEBUG_OBJECTS is not set -# CONFIG_DEBUG_SLAB is not set -# CONFIG_DEBUG_RT_MUTEXES is not set -# CONFIG_RT_MUTEX_TESTER is not set -# CONFIG_DEBUG_SPINLOCK is not set -# CONFIG_DEBUG_MUTEXES is not set -# CONFIG_SPARSE_RCU_POINTER is not set -# CONFIG_DEBUG_ATOMIC_SLEEP is not set -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set -# CONFIG_DEBUG_STACK_USAGE is not set -# CONFIG_DEBUG_KOBJECT is not set -CONFIG_DEBUG_BUGVERBOSE=y -CONFIG_DEBUG_INFO=y -# CONFIG_DEBUG_INFO_REDUCED is not set -# CONFIG_DEBUG_VM is not set -# CONFIG_DEBUG_WRITECOUNT is not set -CONFIG_DEBUG_MEMORY_INIT=y -# CONFIG_DEBUG_LIST is not set -# CONFIG_TEST_LIST_SORT is not set -# CONFIG_DEBUG_SG is not set -# CONFIG_DEBUG_NOTIFIERS is not set -# CONFIG_DEBUG_CREDENTIALS is not set -CONFIG_FRAME_POINTER=y -# CONFIG_BOOT_PRINTK_DELAY is not set -# CONFIG_RCU_TORTURE_TEST is not set -# CONFIG_BACKTRACE_SELF_TEST is not set -# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set -# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set -# CONFIG_FAULT_INJECTION is not set -# CONFIG_SYSCTL_SYSCALL_CHECK is not set -# CONFIG_DEBUG_PAGEALLOC is not set -# CONFIG_ATOMIC64_SELFTEST is not set -# CONFIG_SAMPLES is not set -# CONFIG_TEST_KSTRTOX is not set -# CONFIG_GPROF is not set -# CONFIG_GCOV is not set -CONFIG_EARLY_PRINTK=y diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c index 3df3bd54449..29880c9b324 100644 --- a/arch/um/drivers/mconsole_kern.c +++ b/arch/um/drivers/mconsole_kern.c @@ -645,11 +645,9 @@ void mconsole_sysrq(struct mc_request *req)  static void stack_proc(void *arg)  { -	struct task_struct *from = current, *to = arg; +	struct task_struct *task = arg; -	to->thread.saved_task = from; -	rcu_user_hooks_switch(from, to); -	switch_to(from, to, from); +	show_stack(task, NULL);  }  /* diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c index 39f186252e0..7d26d9c0b2f 100644 --- a/arch/um/drivers/net_kern.c +++ b/arch/um/drivers/net_kern.c @@ -240,7 +240,7 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)  	spin_unlock_irqrestore(&lp->lock, flags); -	dev_kfree_skb(skb); +	dev_consume_skb_any(skb);  	return NETDEV_TX_OK;  } diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild index b30f34a7988..a5e4b606821 100644 --- a/arch/um/include/asm/Kbuild +++ b/arch/um/include/asm/Kbuild @@ -1,5 +1,28 @@ -generic-y += bug.h cputime.h device.h emergency-restart.h futex.h hardirq.h -generic-y += hw_irq.h irq_regs.h kdebug.h percpu.h sections.h topology.h xor.h -generic-y += ftrace.h pci.h io.h param.h delay.h mutex.h current.h exec.h -generic-y += switch_to.h clkdev.h +generic-y += barrier.h +generic-y += bug.h +generic-y += clkdev.h +generic-y += cputime.h +generic-y += current.h +generic-y += delay.h +generic-y += device.h +generic-y += emergency-restart.h +generic-y += exec.h +generic-y += ftrace.h +generic-y += futex.h +generic-y += hardirq.h +generic-y += hash.h +generic-y += hw_irq.h +generic-y += io.h +generic-y += irq_regs.h +generic-y += kdebug.h +generic-y += mcs_spinlock.h +generic-y += mutex.h +generic-y += param.h +generic-y += pci.h +generic-y += percpu.h +generic-y += preempt.h +generic-y += sections.h +generic-y += switch_to.h +generic-y += topology.h  generic-y += trace_clock.h +generic-y += xor.h diff --git a/arch/um/include/asm/fixmap.h b/arch/um/include/asm/fixmap.h index 21a423bae5e..3094ea3c73b 100644 --- a/arch/um/include/asm/fixmap.h +++ b/arch/um/include/asm/fixmap.h @@ -43,13 +43,6 @@ enum fixed_addresses {  extern void __set_fixmap (enum fixed_addresses idx,  			  unsigned long phys, pgprot_t flags); -#define set_fixmap(idx, phys) \ -		__set_fixmap(idx, phys, PAGE_KERNEL) -/* - * Some hardware wants to get fixmapped without caching. - */ -#define set_fixmap_nocache(idx, phys) \ -		__set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE)  /*   * used by vmalloc.c.   * @@ -62,37 +55,6 @@ extern void __set_fixmap (enum fixed_addresses idx,  #define FIXADDR_SIZE	(__end_of_fixed_addresses << PAGE_SHIFT)  #define FIXADDR_START	(FIXADDR_TOP - FIXADDR_SIZE) -#define __fix_to_virt(x)	(FIXADDR_TOP - ((x) << PAGE_SHIFT)) -#define __virt_to_fix(x)      ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT) - -extern void __this_fixmap_does_not_exist(void); - -/* - * 'index to address' translation. If anyone tries to use the idx - * directly without tranlation, we catch the bug with a NULL-deference - * kernel oops. Illegal ranges of incoming indices are caught too. - */ -static inline unsigned long fix_to_virt(const unsigned int idx) -{ -	/* -	 * this branch gets completely eliminated after inlining, -	 * except when someone tries to use fixaddr indices in an -	 * illegal way. (such as mixing up address types or using -	 * out-of-range indices). -	 * -	 * If it doesn't get removed, the linker will complain -	 * loudly with a reasonably clear error message.. -	 */ -	if (idx >= __end_of_fixed_addresses) -		__this_fixmap_does_not_exist(); - -        return __fix_to_virt(idx); -} - -static inline unsigned long virt_to_fix(const unsigned long vaddr) -{ -      BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START); -      return __virt_to_fix(vaddr); -} +#include <asm-generic/fixmap.h>  #endif diff --git a/arch/um/include/asm/processor-generic.h b/arch/um/include/asm/processor-generic.h index c03cd5a0236..cbc5edd5a90 100644 --- a/arch/um/include/asm/processor-generic.h +++ b/arch/um/include/asm/processor-generic.h @@ -19,16 +19,14 @@ struct task_struct;  struct mm_struct;  struct thread_struct { -	struct task_struct *saved_task;  	struct pt_regs regs; +	struct pt_regs *segv_regs;  	int singlestep_syscall;  	void *fault_addr;  	jmp_buf *fault_catcher;  	struct task_struct *prev_sched; -	unsigned long temp_stack;  	struct arch_thread arch;  	jmp_buf switch_buf; -	int mm_count;  	struct {  		int op;  		union { @@ -52,7 +50,6 @@ struct thread_struct {  	.regs		   	= EMPTY_REGS,	\  	.fault_addr		= NULL, \  	.prev_sched		= NULL, \ -	.temp_stack		= 0, \  	.arch			= INIT_ARCH_THREAD, \  	.request		= { 0 } \  } diff --git a/arch/um/include/asm/thread_info.h b/arch/um/include/asm/thread_info.h index 2c8eeb2df8b..1c5b2a83046 100644 --- a/arch/um/include/asm/thread_info.h +++ b/arch/um/include/asm/thread_info.h @@ -60,8 +60,6 @@ static inline struct thread_info *current_thread_info(void)  #endif -#define PREEMPT_ACTIVE		0x10000000 -  #define TIF_SYSCALL_TRACE	0	/* syscall trace active */  #define TIF_SIGPENDING		1	/* signal pending */  #define TIF_NEED_RESCHED	2	/* rescheduling necessary */ diff --git a/arch/um/include/asm/tlb.h b/arch/um/include/asm/tlb.h index 29b0301c18a..16eb63fac57 100644 --- a/arch/um/include/asm/tlb.h +++ b/arch/um/include/asm/tlb.h @@ -59,13 +59,25 @@ extern void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,  			       unsigned long end);  static inline void +tlb_flush_mmu_tlbonly(struct mmu_gather *tlb) +{ +	flush_tlb_mm_range(tlb->mm, tlb->start, tlb->end); +} + +static inline void +tlb_flush_mmu_free(struct mmu_gather *tlb) +{ +	init_tlb_gather(tlb); +} + +static inline void  tlb_flush_mmu(struct mmu_gather *tlb)  {  	if (!tlb->need_flush)  		return; -	flush_tlb_mm_range(tlb->mm, tlb->start, tlb->end); -	init_tlb_gather(tlb); +	tlb_flush_mmu_tlbonly(tlb); +	tlb_flush_mmu_free(tlb);  }  /* tlb_finish_mmu diff --git a/arch/um/include/shared/as-layout.h b/arch/um/include/shared/as-layout.h index 694c792bab4..41c8c774ec1 100644 --- a/arch/um/include/shared/as-layout.h +++ b/arch/um/include/shared/as-layout.h @@ -44,7 +44,6 @@ struct cpu_task {  extern struct cpu_task cpu_tasks[]; -extern unsigned long low_physmem;  extern unsigned long high_physmem;  extern unsigned long uml_physmem;  extern unsigned long uml_reserved; @@ -52,8 +51,6 @@ extern unsigned long end_vm;  extern unsigned long start_vm;  extern unsigned long long highmem; -extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end; -extern unsigned long _unprotected_end;  extern unsigned long brk_start;  extern unsigned long host_task_size; diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h index 021104d98cb..08eec0b691b 100644 --- a/arch/um/include/shared/os.h +++ b/arch/um/include/shared/os.h @@ -136,6 +136,7 @@ extern int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg);  extern int os_get_ifname(int fd, char *namebuf);  extern int os_set_slip(int fd);  extern int os_mode_fd(int fd, int mode); +extern int os_fsync_file(int fd);  extern int os_seek_file(int fd, unsigned long long offset);  extern int os_open_file(const char *file, struct openflags flags, int mode); @@ -227,6 +228,7 @@ extern void block_signals(void);  extern void unblock_signals(void);  extern int get_signals(void);  extern int set_signals(int enable); +extern int os_is_signal_stack(void);  /* util.c */  extern void stack_protections(unsigned long address); diff --git a/arch/um/kernel/exitcode.c b/arch/um/kernel/exitcode.c index 829df49dee9..41ebbfebb33 100644 --- a/arch/um/kernel/exitcode.c +++ b/arch/um/kernel/exitcode.c @@ -40,9 +40,11 @@ static ssize_t exitcode_proc_write(struct file *file,  		const char __user *buffer, size_t count, loff_t *pos)  {  	char *end, buf[sizeof("nnnnn\0")]; +	size_t size;  	int tmp; -	if (copy_from_user(buf, buffer, count)) +	size = min(count, sizeof(buf)); +	if (copy_from_user(buf, buffer, size))  		return -EFAULT;  	tmp = simple_strtol(buf, &end, 0); diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index 7ddb64baf32..8636e905426 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c @@ -279,8 +279,12 @@ pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)  	struct page *pte;  	pte = alloc_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); -	if (pte) -		pgtable_page_ctor(pte); +	if (!pte) +		return NULL; +	if (!pgtable_page_ctor(pte)) { +		__free_page(pte); +		return NULL; +	}  	return pte;  } diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c index f116db15d40..30fdd5d0067 100644 --- a/arch/um/kernel/physmem.c +++ b/arch/um/kernel/physmem.c @@ -103,6 +103,7 @@ void __init setup_physmem(unsigned long start, unsigned long reserve_end,  	 */  	os_seek_file(physmem_fd, __pa(&__syscall_stub_start));  	os_write_file(physmem_fd, &__syscall_stub_start, PAGE_SIZE); +	os_fsync_file(physmem_fd);  	bootmap_size = init_bootmem(pfn, pfn + delta);  	free_bootmem(__pa(reserve_end) + bootmap_size, diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index bbcef522bcb..f17bca8ed2c 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c @@ -82,19 +82,8 @@ void *__switch_to(struct task_struct *from, struct task_struct *to)  	to->thread.prev_sched = from;  	set_current(to); -	do { -		current->thread.saved_task = NULL; - -		switch_threads(&from->thread.switch_buf, -			       &to->thread.switch_buf); - -		arch_switch_to(current); - -		if (current->thread.saved_task) -			show_regs(&(current->thread.regs)); -		to = current->thread.saved_task; -		from = current; -	} while (current->thread.saved_task); +	switch_threads(&from->thread.switch_buf, &to->thread.switch_buf); +	arch_switch_to(current);  	return current->thread.prev_sched;  } @@ -370,7 +359,7 @@ int singlestepping(void * t)  /*   * Only x86 and x86_64 have an arch_align_stack().   * All other arches have "#define arch_align_stack(x) (x)" - * in their asm/system.h + * in their asm/exec.h   * As this is included in UML from asm-um/system-generic.h,   * we can use it to behave as the subarch does.   */ diff --git a/arch/um/kernel/sysrq.c b/arch/um/kernel/sysrq.c index 0dc4d1c6f98..799d7e413bf 100644 --- a/arch/um/kernel/sysrq.c +++ b/arch/um/kernel/sysrq.c @@ -1,6 +1,10 @@  /*   * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) - * Licensed under the GPL + * Copyright (C) 2013 Richard Weinberger <richrd@nod.at> + * + * 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.   */  #include <linux/kallsyms.h> @@ -8,59 +12,87 @@  #include <linux/module.h>  #include <linux/sched.h>  #include <asm/sysrq.h> +#include <os.h> -/* Catch non-i386 SUBARCH's. */ -#if !defined(CONFIG_UML_X86) || defined(CONFIG_64BIT) -void show_trace(struct task_struct *task, unsigned long * stack) +struct stack_frame { +	struct stack_frame *next_frame; +	unsigned long return_address; +}; + +static void do_stack_trace(unsigned long *sp, unsigned long bp)  { +	int reliable;  	unsigned long addr; +	struct stack_frame *frame = (struct stack_frame *)bp; -	if (!stack) { -		stack = (unsigned long*) &stack; -		WARN_ON(1); -	} - -	printk(KERN_INFO "Call Trace: \n"); -	while (((long) stack & (THREAD_SIZE-1)) != 0) { -		addr = *stack; +	printk(KERN_INFO "Call Trace:\n"); +	while (((long) sp & (THREAD_SIZE-1)) != 0) { +		addr = *sp;  		if (__kernel_text_address(addr)) { -			printk(KERN_INFO "%08lx:  [<%08lx>]", -			       (unsigned long) stack, addr); -			print_symbol(KERN_CONT " %s", addr); +			reliable = 0; +			if ((unsigned long) sp == bp + sizeof(long)) { +				frame = frame ? frame->next_frame : NULL; +				bp = (unsigned long)frame; +				reliable = 1; +			} + +			printk(KERN_INFO " [<%08lx>]", addr); +			printk(KERN_CONT " %s", reliable ? "" : "? "); +			print_symbol(KERN_CONT "%s", addr);  			printk(KERN_CONT "\n");  		} -		stack++; +		sp++;  	}  	printk(KERN_INFO "\n");  } -#endif -/*Stolen from arch/i386/kernel/traps.c */ -static const int kstack_depth_to_print = 24; +static unsigned long get_frame_pointer(struct task_struct *task, +				       struct pt_regs *segv_regs) +{ +	if (!task || task == current) +		return segv_regs ? PT_REGS_BP(segv_regs) : current_bp(); +	else +		return KSTK_EBP(task); +} -/* This recently started being used in arch-independent code too, as in - * kernel/sched/core.c.*/ -void show_stack(struct task_struct *task, unsigned long *esp) +static unsigned long *get_stack_pointer(struct task_struct *task, +					struct pt_regs *segv_regs)  { -	unsigned long *stack; +	if (!task || task == current) +		return segv_regs ? (unsigned long *)PT_REGS_SP(segv_regs) : current_sp(); +	else +		return (unsigned long *)KSTK_ESP(task); +} + +void show_stack(struct task_struct *task, unsigned long *stack) +{ +	unsigned long *sp = stack, bp = 0; +	struct pt_regs *segv_regs = current->thread.segv_regs;  	int i; -	if (esp == NULL) { -		if (task != current && task != NULL) { -			esp = (unsigned long *) KSTK_ESP(task); -		} else { -			esp = (unsigned long *) &esp; -		} +	if (!segv_regs && os_is_signal_stack()) { +		printk(KERN_ERR "Received SIGSEGV in SIGSEGV handler," +				" aborting stack trace!\n"); +		return;  	} -	stack = esp; -	for (i = 0; i < kstack_depth_to_print; i++) { +#ifdef CONFIG_FRAME_POINTER +	bp = get_frame_pointer(task, segv_regs); +#endif + +	if (!stack) +		sp = get_stack_pointer(task, segv_regs); + +	printk(KERN_INFO "Stack:\n"); +	stack = sp; +	for (i = 0; i < 3 * STACKSLOTS_PER_LINE; i++) {  		if (kstack_end(stack))  			break; -		if (i && ((i % 8) == 0)) -			printk(KERN_INFO "       "); -		printk(KERN_CONT "%08lx ", *stack++); +		if (i && ((i % STACKSLOTS_PER_LINE) == 0)) +			printk(KERN_CONT "\n"); +		printk(KERN_CONT " %08lx", *stack++);  	} +	printk(KERN_CONT "\n"); -	show_trace(task, esp); +	do_stack_trace(sp, bp);  } diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c index 9472079471b..f1b3eb14b85 100644 --- a/arch/um/kernel/tlb.c +++ b/arch/um/kernel/tlb.c @@ -12,6 +12,7 @@  #include <mem_user.h>  #include <os.h>  #include <skas.h> +#include <kern_util.h>  struct host_vm_change {  	struct host_vm_op { @@ -124,6 +125,9 @@ static int add_munmap(unsigned long addr, unsigned long len,  	struct host_vm_op *last;  	int ret = 0; +	if ((addr >= STUB_START) && (addr < STUB_END)) +		return -EINVAL; +  	if (hvc->index != 0) {  		last = &hvc->ops[hvc->index - 1];  		if ((last->type == MUNMAP) && @@ -283,8 +287,11 @@ void fix_range_common(struct mm_struct *mm, unsigned long start_addr,  	/* This is not an else because ret is modified above */  	if (ret) {  		printk(KERN_ERR "fix_range_common: failed, killing current " -		       "process\n"); +		       "process: %d\n", task_tgid_vnr(current)); +		/* We are under mmap_sem, release it such that current can terminate */ +		up_write(¤t->mm->mmap_sem);  		force_sig(SIGKILL, current); +		do_signal();  	}  } diff --git a/arch/um/kernel/trap.c b/arch/um/kernel/trap.c index 5c3aef74237..5678c3571e7 100644 --- a/arch/um/kernel/trap.c +++ b/arch/um/kernel/trap.c @@ -206,9 +206,12 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user,  	int is_write = FAULT_WRITE(fi);  	unsigned long address = FAULT_ADDRESS(fi); +	if (!is_user && regs) +		current->thread.segv_regs = container_of(regs, struct pt_regs, regs); +  	if (!is_user && (address >= start_vm) && (address < end_vm)) {  		flush_tlb_kernel_vm(); -		return 0; +		goto out;  	}  	else if (current->mm == NULL) {  		show_regs(container_of(regs, struct pt_regs, regs)); @@ -230,7 +233,7 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user,  	catcher = current->thread.fault_catcher;  	if (!err) -		return 0; +		goto out;  	else if (catcher != NULL) {  		current->thread.fault_addr = (void *) address;  		UML_LONGJMP(catcher, 1); @@ -238,7 +241,7 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user,  	else if (current->thread.fault_addr != NULL)  		panic("fault_addr set but no fault catcher");  	else if (!is_user && arch_fixup(ip, regs)) -		return 0; +		goto out;  	if (!is_user) {  		show_regs(container_of(regs, struct pt_regs, regs)); @@ -262,6 +265,11 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user,  		current->thread.arch.faultinfo = fi;  		force_sig_info(SIGSEGV, &si, current);  	} + +out: +	if (regs) +		current->thread.segv_regs = NULL; +  	return 0;  } diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index 87df5e3acc2..016adf0985d 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c @@ -13,6 +13,7 @@  #include <linux/sched.h>  #include <asm/pgtable.h>  #include <asm/processor.h> +#include <asm/sections.h>  #include <asm/setup.h>  #include <as-layout.h>  #include <arch.h> @@ -234,7 +235,6 @@ static int panic_exit(struct notifier_block *self, unsigned long unused1,  		      void *unused2)  {  	bust_spinlocks(1); -	show_regs(&(current->thread.regs));  	bust_spinlocks(0);  	uml_exitcode = 1;  	os_dump_core(); diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c index 07a750197bb..08d90fba952 100644 --- a/arch/um/os-Linux/file.c +++ b/arch/um/os-Linux/file.c @@ -237,6 +237,12 @@ void os_close_file(int fd)  {  	close(fd);  } +int os_fsync_file(int fd) +{ +	if (fsync(fd) < 0) +	    return -errno; +	return 0; +}  int os_seek_file(int fd, unsigned long long offset)  { diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index e1704ff600f..df9191acd92 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c @@ -151,6 +151,7 @@ int __init main(int argc, char **argv, char **envp)  #endif  	do_uml_initcalls(); +	change_sig(SIGPIPE, 0);  	ret = linux_main(argc, argv);  	/* diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c index 3c4af77e51a..897e9ad0c10 100644 --- a/arch/um/os-Linux/mem.c +++ b/arch/um/os-Linux/mem.c @@ -12,337 +12,117 @@  #include <string.h>  #include <sys/stat.h>  #include <sys/mman.h> -#include <sys/param.h> +#include <sys/vfs.h> +#include <linux/magic.h>  #include <init.h>  #include <os.h> -/* Modified by which_tmpdir, which is called during early boot */ -static char *default_tmpdir = "/tmp"; - -/* - *  Modified when creating the physical memory file and when checking - * the tmp filesystem for usability, both happening during early boot. - */ +/* Set by make_tempfile() during early boot. */  static char *tempdir = NULL; -static void __init find_tempdir(void) +/* Check if dir is on tmpfs. Return 0 if yes, -1 if no or error. */ +static int __init check_tmpfs(const char *dir)  { -	const char *dirs[] = { "TMP", "TEMP", "TMPDIR", NULL }; -	int i; -	char *dir = NULL; - -	if (tempdir != NULL) -		/* We've already been called */ -		return; -	for (i = 0; dirs[i]; i++) { -		dir = getenv(dirs[i]); -		if ((dir != NULL) && (*dir != '\0')) -			break; -	} -	if ((dir == NULL) || (*dir == '\0')) -		dir = default_tmpdir; +	struct statfs st; -	tempdir = malloc(strlen(dir) + 2); -	if (tempdir == NULL) { -		fprintf(stderr, "Failed to malloc tempdir, " -			"errno = %d\n", errno); -		return; -	} -	strcpy(tempdir, dir); -	strcat(tempdir, "/"); -} - -/* - * Remove bytes from the front of the buffer and refill it so that if there's a - * partial string that we care about, it will be completed, and we can recognize - * it. - */ -static int pop(int fd, char *buf, size_t size, size_t npop) -{ -	ssize_t n; -	size_t len = strlen(&buf[npop]); - -	memmove(buf, &buf[npop], len + 1); -	n = read(fd, &buf[len], size - len - 1); -	if (n < 0) -		return -errno; - -	buf[len + n] = '\0'; -	return 1; -} - -/* - * This will return 1, with the first character in buf being the - * character following the next instance of c in the file.  This will - * read the file as needed.  If there's an error, -errno is returned; - * if the end of the file is reached, 0 is returned. - */ -static int next(int fd, char *buf, size_t size, char c) -{ -	ssize_t n; -	char *ptr; - -	while ((ptr = strchr(buf, c)) == NULL) { -		n = read(fd, buf, size - 1); -		if (n == 0) -			return 0; -		else if (n < 0) -			return -errno; - -		buf[n] = '\0'; +	printf("Checking if %s is on tmpfs...", dir); +	if (statfs(dir, &st) < 0) { +		printf("%s\n", strerror(errno)); +	} else if (st.f_type != TMPFS_MAGIC) { +		printf("no\n"); +	} else { +		printf("OK\n"); +		return 0;  	} - -	return pop(fd, buf, size, ptr - buf + 1); +	return -1;  }  /* - * Decode an octal-escaped and space-terminated path of the form used by - * /proc/mounts. May be used to decode a path in-place. "out" must be at least - * as large as the input. The output is always null-terminated. "len" gets the - * length of the output, excluding the trailing null. Returns 0 if a full path - * was successfully decoded, otherwise an error. + * Choose the tempdir to use. We want something on tmpfs so that our memory is + * not subject to the host's vm.dirty_ratio. If a tempdir is specified in the + * environment, we use that even if it's not on tmpfs, but we warn the user. + * Otherwise, we try common tmpfs locations, and if no tmpfs directory is found + * then we fall back to /tmp.   */ -static int decode_path(const char *in, char *out, size_t *len) +static char * __init choose_tempdir(void)  { -	char *first = out; -	int c; +	static const char * const vars[] = { +		"TMPDIR", +		"TMP", +		"TEMP", +		NULL +	}; +	static const char fallback_dir[] = "/tmp"; +	static const char * const tmpfs_dirs[] = { +		"/dev/shm", +		fallback_dir, +		NULL +	};  	int i; -	int ret = -EINVAL; -	while (1) { -		switch (*in) { -		case '\0': -			goto out; - -		case ' ': -			ret = 0; -			goto out; - -		case '\\': -			in++; -			c = 0; -			for (i = 0; i < 3; i++) { -				if (*in < '0' || *in > '7') -					goto out; -				c = (c << 3) | (*in++ - '0'); -			} -			*(unsigned char *)out++ = (unsigned char) c; -			break; - -		default: -			*out++ = *in++; -			break; +	const char *dir; + +	printf("Checking environment variables for a tempdir..."); +	for (i = 0; vars[i]; i++) { +		dir = getenv(vars[i]); +		if ((dir != NULL) && (*dir != '\0')) { +			printf("%s\n", dir); +			if (check_tmpfs(dir) >= 0) +				goto done; +			else +				goto warn;  		}  	} +	printf("none found\n"); -out: -	*out = '\0'; -	*len = out - first; -	return ret; -} - -/* - * Computes the length of s when encoded with three-digit octal escape sequences - * for the characters in chars. - */ -static size_t octal_encoded_length(const char *s, const char *chars) -{ -	size_t len = strlen(s); -	while ((s = strpbrk(s, chars)) != NULL) { -		len += 3; -		s++; -	} - -	return len; -} - -enum { -	OUTCOME_NOTHING_MOUNTED, -	OUTCOME_TMPFS_MOUNT, -	OUTCOME_NON_TMPFS_MOUNT, -}; - -/* Read a line of /proc/mounts data looking for a tmpfs mount at "path". */ -static int read_mount(int fd, char *buf, size_t bufsize, const char *path, -		      int *outcome) -{ -	int found; -	int match; -	char *space; -	size_t len; - -	enum { -		MATCH_NONE, -		MATCH_EXACT, -		MATCH_PARENT, -	}; - -	found = next(fd, buf, bufsize, ' '); -	if (found != 1) -		return found; - -	/* -	 * If there's no following space in the buffer, then this path is -	 * truncated, so it can't be the one we're looking for. -	 */ -	space = strchr(buf, ' '); -	if (space) { -		match = MATCH_NONE; -		if (!decode_path(buf, buf, &len)) { -			if (!strcmp(buf, path)) -				match = MATCH_EXACT; -			else if (!strncmp(buf, path, len) -				 && (path[len] == '/' || !strcmp(buf, "/"))) -				match = MATCH_PARENT; -		} - -		found = pop(fd, buf, bufsize, space - buf + 1); -		if (found != 1) -			return found; - -		switch (match) { -		case MATCH_EXACT: -			if (!strncmp(buf, "tmpfs", strlen("tmpfs"))) -				*outcome = OUTCOME_TMPFS_MOUNT; -			else -				*outcome = OUTCOME_NON_TMPFS_MOUNT; -			break; - -		case MATCH_PARENT: -			/* This mount obscures any previous ones. */ -			*outcome = OUTCOME_NOTHING_MOUNTED; -			break; -		} +	for (i = 0; tmpfs_dirs[i]; i++) { +		dir = tmpfs_dirs[i]; +		if (check_tmpfs(dir) >= 0) +			goto done;  	} -	return next(fd, buf, bufsize, '\n'); +	dir = fallback_dir; +warn: +	printf("Warning: tempdir %s is not on tmpfs\n", dir); +done: +	/* Make a copy since getenv results may not remain valid forever. */ +	return strdup(dir);  } -/* which_tmpdir is called only during early boot */ -static int checked_tmpdir = 0; -  /* - * Look for a tmpfs mounted at /dev/shm.  I couldn't find a cleaner - * way to do this than to parse /proc/mounts.  statfs will return the - * same filesystem magic number and fs id for both /dev and /dev/shm - * when they are both tmpfs, so you can't tell if they are different - * filesystems.  Also, there seems to be no other way of finding the - * mount point of a filesystem from within it. - * - * If a /dev/shm tmpfs entry is found, then we switch to using it. - * Otherwise, we stay with the default /tmp. + * Create an unlinked tempfile in a suitable tempdir. template must be the + * basename part of the template with a leading '/'.   */ -static void which_tmpdir(void) +static int __init make_tempfile(const char *template)  { +	char *tempname;  	int fd; -	int found; -	int outcome; -	char *path; -	char *buf; -	size_t bufsize; -	if (checked_tmpdir) -		return; - -	checked_tmpdir = 1; - -	printf("Checking for tmpfs mount on /dev/shm..."); - -	path = realpath("/dev/shm", NULL); -	if (!path) { -		printf("failed to check real path, errno = %d\n", errno); -		return; -	} -	printf("%s...", path); - -	/* -	 * The buffer needs to be able to fit the full octal-escaped path, a -	 * space, and a trailing null in order to successfully decode it. -	 */ -	bufsize = octal_encoded_length(path, " \t\n\\") + 2; - -	if (bufsize < 128) -		bufsize = 128; - -	buf = malloc(bufsize); -	if (!buf) { -		printf("malloc failed, errno = %d\n", errno); -		goto out; -	} -	buf[0] = '\0'; - -	fd = open("/proc/mounts", O_RDONLY); -	if (fd < 0) { -		printf("failed to open /proc/mounts, errno = %d\n", errno); -		goto out1; -	} - -	outcome = OUTCOME_NOTHING_MOUNTED; -	while (1) { -		found = read_mount(fd, buf, bufsize, path, &outcome); -		if (found != 1) -			break; -	} - -	if (found < 0) { -		printf("read returned errno %d\n", -found); -	} else { -		switch (outcome) { -		case OUTCOME_TMPFS_MOUNT: -			printf("OK\n"); -			default_tmpdir = "/dev/shm"; -			break; - -		case OUTCOME_NON_TMPFS_MOUNT: -			printf("not tmpfs\n"); -			break; - -		default: -			printf("nothing mounted on /dev/shm\n"); -			break; +	if (tempdir == NULL) { +		tempdir = choose_tempdir(); +		if (tempdir == NULL) { +			fprintf(stderr, "Failed to choose tempdir: %s\n", +				strerror(errno)); +			return -1;  		}  	} -	close(fd); -out1: -	free(buf); -out: -	free(path); -} - -static int __init make_tempfile(const char *template, char **out_tempname, -				int do_unlink) -{ -	char *tempname; -	int fd; - -	which_tmpdir(); -	tempname = malloc(MAXPATHLEN); +	tempname = malloc(strlen(tempdir) + strlen(template) + 1);  	if (tempname == NULL)  		return -1; -	find_tempdir(); -	if ((tempdir == NULL) || (strlen(tempdir) >= MAXPATHLEN)) -		goto out; - -	if (template[0] != '/') -		strcpy(tempname, tempdir); -	else -		tempname[0] = '\0'; -	strncat(tempname, template, MAXPATHLEN-1-strlen(tempname)); +	strcpy(tempname, tempdir); +	strcat(tempname, template);  	fd = mkstemp(tempname);  	if (fd < 0) {  		fprintf(stderr, "open - cannot create %s: %s\n", tempname,  			strerror(errno));  		goto out;  	} -	if (do_unlink && (unlink(tempname) < 0)) { +	if (unlink(tempname) < 0) {  		perror("unlink");  		goto close;  	} -	if (out_tempname) { -		*out_tempname = tempname; -	} else -		free(tempname); +	free(tempname);  	return fd;  close:  	close(fd); @@ -351,14 +131,14 @@ out:  	return -1;  } -#define TEMPNAME_TEMPLATE "vm_file-XXXXXX" +#define TEMPNAME_TEMPLATE "/vm_file-XXXXXX"  static int __init create_tmp_file(unsigned long long len)  {  	int fd, err;  	char zero; -	fd = make_tempfile(TEMPNAME_TEMPLATE, NULL, 1); +	fd = make_tempfile(TEMPNAME_TEMPLATE);  	if (fd < 0)  		exit(1); @@ -402,7 +182,6 @@ int __init create_mem_file(unsigned long long len)  	return fd;  } -  void __init check_tmpexec(void)  {  	void *addr; @@ -410,14 +189,13 @@ void __init check_tmpexec(void)  	addr = mmap(NULL, UM_KERN_PAGE_SIZE,  		    PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, fd, 0); -	printf("Checking PROT_EXEC mmap in %s...",tempdir); -	fflush(stdout); +	printf("Checking PROT_EXEC mmap in %s...", tempdir);  	if (addr == MAP_FAILED) {  		err = errno; -		perror("failed"); +		printf("%s\n", strerror(err));  		close(fd);  		if (err == EPERM) -			printf("%s must be not mounted noexec\n",tempdir); +			printf("%s must be not mounted noexec\n", tempdir);  		exit(1);  	}  	printf("OK\n"); diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c index 905924b773d..7b605e4dfff 100644 --- a/arch/um/os-Linux/signal.c +++ b/arch/um/os-Linux/signal.c @@ -304,3 +304,11 @@ int set_signals(int enable)  	return ret;  } + +int os_is_signal_stack(void) +{ +	stack_t ss; +	sigaltstack(NULL, &ss); + +	return ss.ss_flags & SS_ONSTACK; +} diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c index d531879a461..908579f2b0a 100644 --- a/arch/um/os-Linux/skas/process.c +++ b/arch/um/os-Linux/skas/process.c @@ -54,7 +54,7 @@ static int ptrace_dump_regs(int pid)  void wait_stub_done(int pid)  { -	int n, status, err, bad_stop = 0; +	int n, status, err;  	while (1) {  		CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED | __WALL)); @@ -74,8 +74,6 @@ void wait_stub_done(int pid)  	if (((1 << WSTOPSIG(status)) & STUB_DONE_MASK) != 0)  		return; -	else -		bad_stop = 1;  bad_wait:  	err = ptrace_dump_regs(pid); @@ -85,10 +83,7 @@ bad_wait:  	printk(UM_KERN_ERR "wait_stub_done : failed to wait for SIGTRAP, "  	       "pid = %d, n = %d, errno = %d, status = 0x%x\n", pid, n, errno,  	       status); -	if (bad_stop) -		kill(pid, SIGKILL); -	else -		fatal_sigsegv(); +	fatal_sigsegv();  }  extern unsigned long current_stub_stack(void);  | 
