diff options
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/Kconfig | 14 | ||||
-rw-r--r-- | arch/um/Kconfig.i386 | 19 | ||||
-rw-r--r-- | arch/um/Makefile | 19 | ||||
-rw-r--r-- | arch/um/defconfig | 240 | ||||
-rw-r--r-- | arch/um/drivers/cow_user.c | 2 | ||||
-rw-r--r-- | arch/um/kernel/irq.c | 93 | ||||
-rw-r--r-- | arch/um/kernel/physmem.c | 2 | ||||
-rw-r--r-- | arch/um/kernel/ptrace.c | 6 | ||||
-rw-r--r-- | arch/um/kernel/skas/Makefile | 10 | ||||
-rw-r--r-- | arch/um/kernel/time_kern.c | 2 | ||||
-rw-r--r-- | arch/um/os-Linux/file.c | 2 | ||||
-rw-r--r-- | arch/um/os-Linux/irq.c | 47 | ||||
-rw-r--r-- | arch/um/os-Linux/main.c | 30 | ||||
-rw-r--r-- | arch/um/os-Linux/process.c | 17 | ||||
-rw-r--r-- | arch/um/os-Linux/skas/process.c | 6 | ||||
-rw-r--r-- | arch/um/os-Linux/sys-i386/registers.c | 4 | ||||
-rw-r--r-- | arch/um/os-Linux/sys-x86_64/registers.c | 4 | ||||
-rw-r--r-- | arch/um/os-Linux/umid.c | 4 | ||||
-rw-r--r-- | arch/um/os-Linux/user_syms.c | 7 | ||||
-rw-r--r-- | arch/um/scripts/Makefile.rules | 12 | ||||
-rw-r--r-- | arch/um/sys-i386/Makefile | 13 | ||||
-rw-r--r-- | arch/um/sys-x86_64/Makefile | 13 |
22 files changed, 351 insertions, 215 deletions
diff --git a/arch/um/Kconfig b/arch/um/Kconfig index 05fbb20636cb..76e85bbaea55 100644 --- a/arch/um/Kconfig +++ b/arch/um/Kconfig | |||
@@ -57,20 +57,6 @@ config STATIC_LINK | |||
57 | chroot, and you disable CONFIG_MODE_TT, you probably want to say Y | 57 | chroot, and you disable CONFIG_MODE_TT, you probably want to say Y |
58 | here. | 58 | here. |
59 | 59 | ||
60 | config HOST_2G_2G | ||
61 | bool "2G/2G host address space split" | ||
62 | default n | ||
63 | depends on MODE_TT | ||
64 | help | ||
65 | This is needed when the host on which you run has a 2G/2G memory | ||
66 | split, instead of the customary 3G/1G. | ||
67 | |||
68 | Note that to enable such a host | ||
69 | configuration, which makes sense only in some cases, you need special | ||
70 | host patches. | ||
71 | |||
72 | So, if you do not know what to do here, say 'N'. | ||
73 | |||
74 | config KERNEL_HALF_GIGS | 60 | config KERNEL_HALF_GIGS |
75 | int "Kernel address space size (in .5G units)" | 61 | int "Kernel address space size (in .5G units)" |
76 | default "1" | 62 | default "1" |
diff --git a/arch/um/Kconfig.i386 b/arch/um/Kconfig.i386 index 85e6a55b3b59..f6eb72d117b9 100644 --- a/arch/um/Kconfig.i386 +++ b/arch/um/Kconfig.i386 | |||
@@ -16,6 +16,19 @@ config SEMAPHORE_SLEEPERS | |||
16 | bool | 16 | bool |
17 | default y | 17 | default y |
18 | 18 | ||
19 | config HOST_2G_2G | ||
20 | bool "2G/2G host address space split" | ||
21 | default n | ||
22 | help | ||
23 | This is needed when the host on which you run has a 2G/2G memory | ||
24 | split, instead of the customary 3G/1G. | ||
25 | |||
26 | Note that to enable such a host | ||
27 | configuration, which makes sense only in some cases, you need special | ||
28 | host patches. | ||
29 | |||
30 | So, if you do not know what to do here, say 'N'. | ||
31 | |||
19 | config TOP_ADDR | 32 | config TOP_ADDR |
20 | hex | 33 | hex |
21 | default 0xc0000000 if !HOST_2G_2G | 34 | default 0xc0000000 if !HOST_2G_2G |
@@ -35,11 +48,13 @@ config 3_LEVEL_PGTABLES | |||
35 | 48 | ||
36 | config STUB_CODE | 49 | config STUB_CODE |
37 | hex | 50 | hex |
38 | default 0xbfffe000 | 51 | default 0xbfffe000 if !HOST_2G_2G |
52 | default 0x7fffe000 if HOST_2G_2G | ||
39 | 53 | ||
40 | config STUB_DATA | 54 | config STUB_DATA |
41 | hex | 55 | hex |
42 | default 0xbffff000 | 56 | default 0xbffff000 if !HOST_2G_2G |
57 | default 0x7ffff000 if HOST_2G_2G | ||
43 | 58 | ||
44 | config STUB_START | 59 | config STUB_START |
45 | hex | 60 | hex |
diff --git a/arch/um/Makefile b/arch/um/Makefile index a508e7a02891..f6ad832faf13 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile | |||
@@ -96,7 +96,8 @@ PHONY += linux | |||
96 | all: linux | 96 | all: linux |
97 | 97 | ||
98 | linux: vmlinux | 98 | linux: vmlinux |
99 | ln -f $< $@ | 99 | @echo ' LINK $@' |
100 | $(Q)ln -f $< $@ | ||
100 | 101 | ||
101 | define archhelp | 102 | define archhelp |
102 | echo '* linux - Binary kernel image (./linux) - for backward' | 103 | echo '* linux - Binary kernel image (./linux) - for backward' |
@@ -117,6 +118,10 @@ prepare: $(ARCH_DIR)/include/kern_constants.h | |||
117 | LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static | 118 | LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static |
118 | LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib | 119 | LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib |
119 | 120 | ||
121 | CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,) \ | ||
122 | $(call cc-option, -fno-stack-protector,) \ | ||
123 | $(call cc-option, -fno-stack-protector-all,) | ||
124 | |||
120 | CPP_MODE-$(CONFIG_MODE_TT) := -DMODE_TT | 125 | CPP_MODE-$(CONFIG_MODE_TT) := -DMODE_TT |
121 | CONFIG_KERNEL_STACK_ORDER ?= 2 | 126 | CONFIG_KERNEL_STACK_ORDER ?= 2 |
122 | STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] ) | 127 | STACK_SIZE := $(shell echo $$[ 4096 * (1 << $(CONFIG_KERNEL_STACK_ORDER)) ] ) |
@@ -203,8 +208,8 @@ endef | |||
203 | $(ARCH_DIR)/include/uml-config.h : include/linux/autoconf.h | 208 | $(ARCH_DIR)/include/uml-config.h : include/linux/autoconf.h |
204 | $(call filechk,umlconfig) | 209 | $(call filechk,umlconfig) |
205 | 210 | ||
206 | $(ARCH_DIR)/user-offsets.s: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.c | 211 | $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s: FORCE |
207 | $(CC) $(USER_CFLAGS) -S -o $@ $< | 212 | $(Q)$(MAKE) $(build)=$(ARCH_DIR)/sys-$(SUBARCH) $@ |
208 | 213 | ||
209 | define filechk_gen-asm-offsets | 214 | define filechk_gen-asm-offsets |
210 | (set -e; \ | 215 | (set -e; \ |
@@ -219,13 +224,11 @@ define filechk_gen-asm-offsets | |||
219 | echo ""; ) | 224 | echo ""; ) |
220 | endef | 225 | endef |
221 | 226 | ||
222 | $(ARCH_DIR)/include/user_constants.h: $(ARCH_DIR)/user-offsets.s | 227 | $(ARCH_DIR)/include/user_constants.h: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s |
223 | $(call filechk,gen-asm-offsets) | 228 | $(call filechk,gen-asm-offsets) |
224 | 229 | ||
225 | CLEAN_FILES += $(ARCH_DIR)/user-offsets.s | ||
226 | |||
227 | $(ARCH_DIR)/include/kern_constants.h: $(objtree)/$(ARCH_DIR)/include | 230 | $(ARCH_DIR)/include/kern_constants.h: $(objtree)/$(ARCH_DIR)/include |
228 | @echo ' SYMLINK $@' | 231 | @echo ' SYMLINK $@' |
229 | $(Q) ln -sf ../../../include/asm-um/asm-offsets.h $@ | 232 | $(Q)ln -sf ../../../include/asm-um/asm-offsets.h $@ |
230 | 233 | ||
231 | export SUBARCH USER_CFLAGS OS | 234 | export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS |
diff --git a/arch/um/defconfig b/arch/um/defconfig index 80d30d19d750..402a74dc5026 100644 --- a/arch/um/defconfig +++ b/arch/um/defconfig | |||
@@ -1,14 +1,13 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.12-rc6-mm1 | 3 | # Linux kernel version: 2.6.17-rc3 |
4 | # Tue Jun 14 18:22:21 2005 | 4 | # Fri Apr 28 09:31:20 2006 |
5 | # | 5 | # |
6 | CONFIG_GENERIC_HARDIRQS=y | 6 | CONFIG_GENERIC_HARDIRQS=y |
7 | CONFIG_UML=y | 7 | CONFIG_UML=y |
8 | CONFIG_MMU=y | 8 | CONFIG_MMU=y |
9 | CONFIG_UID16=y | ||
10 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | ||
11 | CONFIG_GENERIC_CALIBRATE_DELAY=y | 9 | CONFIG_GENERIC_CALIBRATE_DELAY=y |
10 | CONFIG_IRQ_RELEASE_METHOD=y | ||
12 | 11 | ||
13 | # | 12 | # |
14 | # UML-specific options | 13 | # UML-specific options |
@@ -16,8 +15,50 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y | |||
16 | # CONFIG_MODE_TT is not set | 15 | # CONFIG_MODE_TT is not set |
17 | # CONFIG_STATIC_LINK is not set | 16 | # CONFIG_STATIC_LINK is not set |
18 | CONFIG_MODE_SKAS=y | 17 | CONFIG_MODE_SKAS=y |
18 | |||
19 | # | ||
20 | # Host processor type and features | ||
21 | # | ||
22 | # CONFIG_M386 is not set | ||
23 | # CONFIG_M486 is not set | ||
24 | # CONFIG_M586 is not set | ||
25 | # CONFIG_M586TSC is not set | ||
26 | # CONFIG_M586MMX is not set | ||
27 | CONFIG_M686=y | ||
28 | # CONFIG_MPENTIUMII is not set | ||
29 | # CONFIG_MPENTIUMIII is not set | ||
30 | # CONFIG_MPENTIUMM is not set | ||
31 | # CONFIG_MPENTIUM4 is not set | ||
32 | # CONFIG_MK6 is not set | ||
33 | # CONFIG_MK7 is not set | ||
34 | # CONFIG_MK8 is not set | ||
35 | # CONFIG_MCRUSOE is not set | ||
36 | # CONFIG_MEFFICEON is not set | ||
37 | # CONFIG_MWINCHIPC6 is not set | ||
38 | # CONFIG_MWINCHIP2 is not set | ||
39 | # CONFIG_MWINCHIP3D is not set | ||
40 | # CONFIG_MGEODEGX1 is not set | ||
41 | # CONFIG_MGEODE_LX is not set | ||
42 | # CONFIG_MCYRIXIII is not set | ||
43 | # CONFIG_MVIAC3_2 is not set | ||
44 | # CONFIG_X86_GENERIC is not set | ||
45 | CONFIG_X86_CMPXCHG=y | ||
46 | CONFIG_X86_XADD=y | ||
47 | CONFIG_X86_L1_CACHE_SHIFT=5 | ||
48 | CONFIG_RWSEM_XCHGADD_ALGORITHM=y | ||
49 | CONFIG_X86_PPRO_FENCE=y | ||
50 | CONFIG_X86_WP_WORKS_OK=y | ||
51 | CONFIG_X86_INVLPG=y | ||
52 | CONFIG_X86_BSWAP=y | ||
53 | CONFIG_X86_POPAD_OK=y | ||
54 | CONFIG_X86_CMPXCHG64=y | ||
55 | CONFIG_X86_GOOD_APIC=y | ||
56 | CONFIG_X86_USE_PPRO_CHECKSUM=y | ||
57 | CONFIG_X86_TSC=y | ||
19 | CONFIG_UML_X86=y | 58 | CONFIG_UML_X86=y |
20 | # CONFIG_64BIT is not set | 59 | # CONFIG_64BIT is not set |
60 | CONFIG_SEMAPHORE_SLEEPERS=y | ||
61 | # CONFIG_HOST_2G_2G is not set | ||
21 | CONFIG_TOP_ADDR=0xc0000000 | 62 | CONFIG_TOP_ADDR=0xc0000000 |
22 | # CONFIG_3_LEVEL_PGTABLES is not set | 63 | # CONFIG_3_LEVEL_PGTABLES is not set |
23 | CONFIG_STUB_CODE=0xbfffe000 | 64 | CONFIG_STUB_CODE=0xbfffe000 |
@@ -25,22 +66,24 @@ CONFIG_STUB_DATA=0xbffff000 | |||
25 | CONFIG_STUB_START=0xbfffe000 | 66 | CONFIG_STUB_START=0xbfffe000 |
26 | CONFIG_ARCH_HAS_SC_SIGNALS=y | 67 | CONFIG_ARCH_HAS_SC_SIGNALS=y |
27 | CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA=y | 68 | CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA=y |
69 | CONFIG_GENERIC_HWEIGHT=y | ||
28 | CONFIG_SELECT_MEMORY_MODEL=y | 70 | CONFIG_SELECT_MEMORY_MODEL=y |
29 | CONFIG_FLATMEM_MANUAL=y | 71 | CONFIG_FLATMEM_MANUAL=y |
30 | # CONFIG_DISCONTIGMEM_MANUAL is not set | 72 | # CONFIG_DISCONTIGMEM_MANUAL is not set |
31 | # CONFIG_SPARSEMEM_MANUAL is not set | 73 | # CONFIG_SPARSEMEM_MANUAL is not set |
32 | CONFIG_FLATMEM=y | 74 | CONFIG_FLATMEM=y |
33 | CONFIG_FLAT_NODE_MEM_MAP=y | 75 | CONFIG_FLAT_NODE_MEM_MAP=y |
76 | # CONFIG_SPARSEMEM_STATIC is not set | ||
77 | CONFIG_SPLIT_PTLOCK_CPUS=4 | ||
34 | CONFIG_LD_SCRIPT_DYN=y | 78 | CONFIG_LD_SCRIPT_DYN=y |
35 | CONFIG_NET=y | 79 | CONFIG_NET=y |
36 | CONFIG_BINFMT_ELF=y | 80 | CONFIG_BINFMT_ELF=y |
37 | CONFIG_BINFMT_MISC=m | 81 | CONFIG_BINFMT_MISC=m |
38 | # CONFIG_HOSTFS is not set | 82 | # CONFIG_HOSTFS is not set |
83 | # CONFIG_HPPFS is not set | ||
39 | CONFIG_MCONSOLE=y | 84 | CONFIG_MCONSOLE=y |
40 | # CONFIG_MAGIC_SYSRQ is not set | 85 | # CONFIG_MAGIC_SYSRQ is not set |
41 | # CONFIG_HOST_2G_2G is not set | ||
42 | CONFIG_NEST_LEVEL=0 | 86 | CONFIG_NEST_LEVEL=0 |
43 | CONFIG_KERNEL_HALF_GIGS=1 | ||
44 | # CONFIG_HIGHMEM is not set | 87 | # CONFIG_HIGHMEM is not set |
45 | CONFIG_KERNEL_STACK_ORDER=2 | 88 | CONFIG_KERNEL_STACK_ORDER=2 |
46 | CONFIG_UML_REAL_TIME_CLOCK=y | 89 | CONFIG_UML_REAL_TIME_CLOCK=y |
@@ -49,7 +92,6 @@ CONFIG_UML_REAL_TIME_CLOCK=y | |||
49 | # Code maturity level options | 92 | # Code maturity level options |
50 | # | 93 | # |
51 | CONFIG_EXPERIMENTAL=y | 94 | CONFIG_EXPERIMENTAL=y |
52 | CONFIG_CLEAN_COMPILE=y | ||
53 | CONFIG_BROKEN_ON_SMP=y | 95 | CONFIG_BROKEN_ON_SMP=y |
54 | CONFIG_INIT_ENV_ARG_LIMIT=32 | 96 | CONFIG_INIT_ENV_ARG_LIMIT=32 |
55 | 97 | ||
@@ -57,6 +99,7 @@ CONFIG_INIT_ENV_ARG_LIMIT=32 | |||
57 | # General setup | 99 | # General setup |
58 | # | 100 | # |
59 | CONFIG_LOCALVERSION="" | 101 | CONFIG_LOCALVERSION="" |
102 | CONFIG_LOCALVERSION_AUTO=y | ||
60 | CONFIG_SWAP=y | 103 | CONFIG_SWAP=y |
61 | CONFIG_SYSVIPC=y | 104 | CONFIG_SYSVIPC=y |
62 | CONFIG_POSIX_MQUEUE=y | 105 | CONFIG_POSIX_MQUEUE=y |
@@ -64,26 +107,28 @@ CONFIG_BSD_PROCESS_ACCT=y | |||
64 | # CONFIG_BSD_PROCESS_ACCT_V3 is not set | 107 | # CONFIG_BSD_PROCESS_ACCT_V3 is not set |
65 | CONFIG_SYSCTL=y | 108 | CONFIG_SYSCTL=y |
66 | # CONFIG_AUDIT is not set | 109 | # CONFIG_AUDIT is not set |
67 | # CONFIG_HOTPLUG is not set | ||
68 | CONFIG_KOBJECT_UEVENT=y | ||
69 | CONFIG_IKCONFIG=y | 110 | CONFIG_IKCONFIG=y |
70 | CONFIG_IKCONFIG_PROC=y | 111 | CONFIG_IKCONFIG_PROC=y |
112 | # CONFIG_RELAY is not set | ||
113 | CONFIG_INITRAMFS_SOURCE="" | ||
114 | CONFIG_UID16=y | ||
115 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
71 | # CONFIG_EMBEDDED is not set | 116 | # CONFIG_EMBEDDED is not set |
72 | CONFIG_KALLSYMS=y | 117 | CONFIG_KALLSYMS=y |
73 | # CONFIG_KALLSYMS_ALL is not set | 118 | # CONFIG_KALLSYMS_ALL is not set |
74 | CONFIG_KALLSYMS_EXTRA_PASS=y | 119 | CONFIG_KALLSYMS_EXTRA_PASS=y |
120 | CONFIG_HOTPLUG=y | ||
75 | CONFIG_PRINTK=y | 121 | CONFIG_PRINTK=y |
76 | CONFIG_BUG=y | 122 | CONFIG_BUG=y |
123 | CONFIG_ELF_CORE=y | ||
77 | CONFIG_BASE_FULL=y | 124 | CONFIG_BASE_FULL=y |
78 | CONFIG_FUTEX=y | 125 | CONFIG_FUTEX=y |
79 | CONFIG_EPOLL=y | 126 | CONFIG_EPOLL=y |
80 | CONFIG_SHMEM=y | 127 | CONFIG_SHMEM=y |
81 | CONFIG_CC_ALIGN_FUNCTIONS=0 | 128 | CONFIG_SLAB=y |
82 | CONFIG_CC_ALIGN_LABELS=0 | ||
83 | CONFIG_CC_ALIGN_LOOPS=0 | ||
84 | CONFIG_CC_ALIGN_JUMPS=0 | ||
85 | # CONFIG_TINY_SHMEM is not set | 129 | # CONFIG_TINY_SHMEM is not set |
86 | CONFIG_BASE_SMALL=0 | 130 | CONFIG_BASE_SMALL=0 |
131 | # CONFIG_SLOB is not set | ||
87 | 132 | ||
88 | # | 133 | # |
89 | # Loadable module support | 134 | # Loadable module support |
@@ -91,18 +136,43 @@ CONFIG_BASE_SMALL=0 | |||
91 | CONFIG_MODULES=y | 136 | CONFIG_MODULES=y |
92 | CONFIG_MODULE_UNLOAD=y | 137 | CONFIG_MODULE_UNLOAD=y |
93 | # CONFIG_MODULE_FORCE_UNLOAD is not set | 138 | # CONFIG_MODULE_FORCE_UNLOAD is not set |
94 | CONFIG_OBSOLETE_MODPARM=y | ||
95 | # CONFIG_MODVERSIONS is not set | 139 | # CONFIG_MODVERSIONS is not set |
96 | # CONFIG_MODULE_SRCVERSION_ALL is not set | 140 | # CONFIG_MODULE_SRCVERSION_ALL is not set |
97 | CONFIG_KMOD=y | 141 | CONFIG_KMOD=y |
98 | 142 | ||
99 | # | 143 | # |
100 | # Generic Driver Options | 144 | # Block layer |
101 | # | 145 | # |
102 | CONFIG_STANDALONE=y | 146 | # CONFIG_LBD is not set |
103 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 147 | # CONFIG_BLK_DEV_IO_TRACE is not set |
104 | # CONFIG_FW_LOADER is not set | 148 | # CONFIG_LSF is not set |
105 | # CONFIG_DEBUG_DRIVER is not set | 149 | |
150 | # | ||
151 | # IO Schedulers | ||
152 | # | ||
153 | CONFIG_IOSCHED_NOOP=y | ||
154 | CONFIG_IOSCHED_AS=y | ||
155 | CONFIG_IOSCHED_DEADLINE=y | ||
156 | CONFIG_IOSCHED_CFQ=y | ||
157 | CONFIG_DEFAULT_AS=y | ||
158 | # CONFIG_DEFAULT_DEADLINE is not set | ||
159 | # CONFIG_DEFAULT_CFQ is not set | ||
160 | # CONFIG_DEFAULT_NOOP is not set | ||
161 | CONFIG_DEFAULT_IOSCHED="anticipatory" | ||
162 | |||
163 | # | ||
164 | # Block devices | ||
165 | # | ||
166 | CONFIG_BLK_DEV_UBD=y | ||
167 | # CONFIG_BLK_DEV_UBD_SYNC is not set | ||
168 | CONFIG_BLK_DEV_COW_COMMON=y | ||
169 | # CONFIG_MMAPPER is not set | ||
170 | CONFIG_BLK_DEV_LOOP=m | ||
171 | # CONFIG_BLK_DEV_CRYPTOLOOP is not set | ||
172 | CONFIG_BLK_DEV_NBD=m | ||
173 | # CONFIG_BLK_DEV_RAM is not set | ||
174 | # CONFIG_BLK_DEV_INITRD is not set | ||
175 | # CONFIG_ATA_OVER_ETH is not set | ||
106 | 176 | ||
107 | # | 177 | # |
108 | # Character Devices | 178 | # Character Devices |
@@ -127,50 +197,23 @@ CONFIG_UML_SOUND=m | |||
127 | CONFIG_SOUND=m | 197 | CONFIG_SOUND=m |
128 | CONFIG_HOSTAUDIO=m | 198 | CONFIG_HOSTAUDIO=m |
129 | CONFIG_UML_RANDOM=y | 199 | CONFIG_UML_RANDOM=y |
130 | # CONFIG_MMAPPER is not set | ||
131 | |||
132 | # | ||
133 | # Block devices | ||
134 | # | ||
135 | CONFIG_BLK_DEV_UBD=y | ||
136 | CONFIG_BLK_DEV_UBD_SYNC=y | ||
137 | CONFIG_BLK_DEV_COW_COMMON=y | ||
138 | CONFIG_BLK_DEV_LOOP=m | ||
139 | # CONFIG_BLK_DEV_CRYPTOLOOP is not set | ||
140 | CONFIG_BLK_DEV_NBD=m | ||
141 | # CONFIG_BLK_DEV_RAM is not set | ||
142 | CONFIG_BLK_DEV_RAM_COUNT=16 | ||
143 | CONFIG_INITRAMFS_SOURCE="" | ||
144 | # CONFIG_LBD is not set | ||
145 | |||
146 | # | ||
147 | # IO Schedulers | ||
148 | # | ||
149 | CONFIG_IOSCHED_NOOP=y | ||
150 | CONFIG_IOSCHED_AS=y | ||
151 | CONFIG_IOSCHED_DEADLINE=y | ||
152 | CONFIG_IOSCHED_CFQ=y | ||
153 | # CONFIG_ATA_OVER_ETH is not set | ||
154 | CONFIG_NETDEVICES=y | ||
155 | 200 | ||
156 | # | 201 | # |
157 | # UML Network Devices | 202 | # Generic Driver Options |
158 | # | 203 | # |
159 | CONFIG_UML_NET=y | 204 | CONFIG_STANDALONE=y |
160 | CONFIG_UML_NET_ETHERTAP=y | 205 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
161 | CONFIG_UML_NET_TUNTAP=y | 206 | # CONFIG_FW_LOADER is not set |
162 | CONFIG_UML_NET_SLIP=y | 207 | # CONFIG_DEBUG_DRIVER is not set |
163 | CONFIG_UML_NET_DAEMON=y | ||
164 | CONFIG_UML_NET_MCAST=y | ||
165 | CONFIG_UML_NET_SLIRP=y | ||
166 | 208 | ||
167 | # | 209 | # |
168 | # Networking support | 210 | # Networking |
169 | # | 211 | # |
170 | 212 | ||
171 | # | 213 | # |
172 | # Networking options | 214 | # Networking options |
173 | # | 215 | # |
216 | # CONFIG_NETDEBUG is not set | ||
174 | CONFIG_PACKET=y | 217 | CONFIG_PACKET=y |
175 | CONFIG_PACKET_MMAP=y | 218 | CONFIG_PACKET_MMAP=y |
176 | CONFIG_UNIX=y | 219 | CONFIG_UNIX=y |
@@ -178,6 +221,7 @@ CONFIG_UNIX=y | |||
178 | CONFIG_INET=y | 221 | CONFIG_INET=y |
179 | # CONFIG_IP_MULTICAST is not set | 222 | # CONFIG_IP_MULTICAST is not set |
180 | # CONFIG_IP_ADVANCED_ROUTER is not set | 223 | # CONFIG_IP_ADVANCED_ROUTER is not set |
224 | CONFIG_IP_FIB_HASH=y | ||
181 | # CONFIG_IP_PNP is not set | 225 | # CONFIG_IP_PNP is not set |
182 | # CONFIG_NET_IPIP is not set | 226 | # CONFIG_NET_IPIP is not set |
183 | # CONFIG_NET_IPGRE is not set | 227 | # CONFIG_NET_IPGRE is not set |
@@ -186,27 +230,31 @@ CONFIG_INET=y | |||
186 | # CONFIG_INET_AH is not set | 230 | # CONFIG_INET_AH is not set |
187 | # CONFIG_INET_ESP is not set | 231 | # CONFIG_INET_ESP is not set |
188 | # CONFIG_INET_IPCOMP is not set | 232 | # CONFIG_INET_IPCOMP is not set |
233 | # CONFIG_INET_XFRM_TUNNEL is not set | ||
189 | # CONFIG_INET_TUNNEL is not set | 234 | # CONFIG_INET_TUNNEL is not set |
190 | CONFIG_IP_TCPDIAG=y | 235 | CONFIG_INET_DIAG=y |
191 | # CONFIG_IP_TCPDIAG_IPV6 is not set | 236 | CONFIG_INET_TCP_DIAG=y |
192 | 237 | # CONFIG_TCP_CONG_ADVANCED is not set | |
193 | # | ||
194 | # TCP congestion control | ||
195 | # | ||
196 | CONFIG_TCP_CONG_BIC=y | 238 | CONFIG_TCP_CONG_BIC=y |
197 | CONFIG_TCP_CONG_WESTWOOD=y | ||
198 | CONFIG_TCP_CONG_HTCP=y | ||
199 | # CONFIG_TCP_CONG_HSTCP is not set | ||
200 | # CONFIG_TCP_CONG_HYBLA is not set | ||
201 | # CONFIG_TCP_CONG_VEGAS is not set | ||
202 | # CONFIG_TCP_CONG_SCALABLE is not set | ||
203 | # CONFIG_IPV6 is not set | 239 | # CONFIG_IPV6 is not set |
240 | # CONFIG_INET6_XFRM_TUNNEL is not set | ||
241 | # CONFIG_INET6_TUNNEL is not set | ||
204 | # CONFIG_NETFILTER is not set | 242 | # CONFIG_NETFILTER is not set |
205 | 243 | ||
206 | # | 244 | # |
245 | # DCCP Configuration (EXPERIMENTAL) | ||
246 | # | ||
247 | # CONFIG_IP_DCCP is not set | ||
248 | |||
249 | # | ||
207 | # SCTP Configuration (EXPERIMENTAL) | 250 | # SCTP Configuration (EXPERIMENTAL) |
208 | # | 251 | # |
209 | # CONFIG_IP_SCTP is not set | 252 | # CONFIG_IP_SCTP is not set |
253 | |||
254 | # | ||
255 | # TIPC Configuration (EXPERIMENTAL) | ||
256 | # | ||
257 | # CONFIG_TIPC is not set | ||
210 | # CONFIG_ATM is not set | 258 | # CONFIG_ATM is not set |
211 | # CONFIG_BRIDGE is not set | 259 | # CONFIG_BRIDGE is not set |
212 | # CONFIG_VLAN_8021Q is not set | 260 | # CONFIG_VLAN_8021Q is not set |
@@ -224,27 +272,47 @@ CONFIG_TCP_CONG_HTCP=y | |||
224 | # QoS and/or fair queueing | 272 | # QoS and/or fair queueing |
225 | # | 273 | # |
226 | # CONFIG_NET_SCHED is not set | 274 | # CONFIG_NET_SCHED is not set |
227 | # CONFIG_NET_CLS_ROUTE is not set | ||
228 | 275 | ||
229 | # | 276 | # |
230 | # Network testing | 277 | # Network testing |
231 | # | 278 | # |
232 | # CONFIG_NET_PKTGEN is not set | 279 | # CONFIG_NET_PKTGEN is not set |
233 | # CONFIG_KGDBOE is not set | ||
234 | # CONFIG_NETPOLL is not set | ||
235 | # CONFIG_NETPOLL_RX is not set | ||
236 | # CONFIG_NETPOLL_TRAP is not set | ||
237 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
238 | # CONFIG_HAMRADIO is not set | 280 | # CONFIG_HAMRADIO is not set |
239 | # CONFIG_IRDA is not set | 281 | # CONFIG_IRDA is not set |
240 | # CONFIG_BT is not set | 282 | # CONFIG_BT is not set |
241 | # CONFIG_IEEE80211 is not set | 283 | # CONFIG_IEEE80211 is not set |
284 | |||
285 | # | ||
286 | # UML Network Devices | ||
287 | # | ||
288 | CONFIG_UML_NET=y | ||
289 | CONFIG_UML_NET_ETHERTAP=y | ||
290 | CONFIG_UML_NET_TUNTAP=y | ||
291 | CONFIG_UML_NET_SLIP=y | ||
292 | CONFIG_UML_NET_DAEMON=y | ||
293 | CONFIG_UML_NET_MCAST=y | ||
294 | # CONFIG_UML_NET_PCAP is not set | ||
295 | CONFIG_UML_NET_SLIRP=y | ||
296 | |||
297 | # | ||
298 | # Network device support | ||
299 | # | ||
300 | CONFIG_NETDEVICES=y | ||
242 | CONFIG_DUMMY=m | 301 | CONFIG_DUMMY=m |
243 | # CONFIG_BONDING is not set | 302 | # CONFIG_BONDING is not set |
244 | # CONFIG_EQUALIZER is not set | 303 | # CONFIG_EQUALIZER is not set |
245 | CONFIG_TUN=m | 304 | CONFIG_TUN=m |
246 | 305 | ||
247 | # | 306 | # |
307 | # PHY device support | ||
308 | # | ||
309 | |||
310 | # | ||
311 | # Wireless LAN (non-hamradio) | ||
312 | # | ||
313 | # CONFIG_NET_RADIO is not set | ||
314 | |||
315 | # | ||
248 | # Wan interfaces | 316 | # Wan interfaces |
249 | # | 317 | # |
250 | # CONFIG_WAN is not set | 318 | # CONFIG_WAN is not set |
@@ -263,6 +331,13 @@ CONFIG_SLIP=m | |||
263 | # CONFIG_SLIP_MODE_SLIP6 is not set | 331 | # CONFIG_SLIP_MODE_SLIP6 is not set |
264 | # CONFIG_SHAPER is not set | 332 | # CONFIG_SHAPER is not set |
265 | # CONFIG_NETCONSOLE is not set | 333 | # CONFIG_NETCONSOLE is not set |
334 | # CONFIG_NETPOLL is not set | ||
335 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
336 | |||
337 | # | ||
338 | # Connector - unified userspace <-> kernelspace linker | ||
339 | # | ||
340 | # CONFIG_CONNECTOR is not set | ||
266 | 341 | ||
267 | # | 342 | # |
268 | # File systems | 343 | # File systems |
@@ -274,17 +349,14 @@ CONFIG_EXT3_FS=y | |||
274 | # CONFIG_EXT3_FS_XATTR is not set | 349 | # CONFIG_EXT3_FS_XATTR is not set |
275 | CONFIG_JBD=y | 350 | CONFIG_JBD=y |
276 | # CONFIG_JBD_DEBUG is not set | 351 | # CONFIG_JBD_DEBUG is not set |
277 | # CONFIG_REISER4_FS is not set | ||
278 | CONFIG_REISERFS_FS=y | 352 | CONFIG_REISERFS_FS=y |
279 | # CONFIG_REISERFS_CHECK is not set | 353 | # CONFIG_REISERFS_CHECK is not set |
280 | # CONFIG_REISERFS_PROC_INFO is not set | 354 | # CONFIG_REISERFS_PROC_INFO is not set |
281 | # CONFIG_REISERFS_FS_XATTR is not set | 355 | # CONFIG_REISERFS_FS_XATTR is not set |
282 | # CONFIG_JFS_FS is not set | 356 | # CONFIG_JFS_FS is not set |
283 | 357 | # CONFIG_FS_POSIX_ACL is not set | |
284 | # | ||
285 | # XFS support | ||
286 | # | ||
287 | # CONFIG_XFS_FS is not set | 358 | # CONFIG_XFS_FS is not set |
359 | # CONFIG_OCFS2_FS is not set | ||
288 | # CONFIG_MINIX_FS is not set | 360 | # CONFIG_MINIX_FS is not set |
289 | # CONFIG_ROMFS_FS is not set | 361 | # CONFIG_ROMFS_FS is not set |
290 | CONFIG_INOTIFY=y | 362 | CONFIG_INOTIFY=y |
@@ -295,11 +367,6 @@ CONFIG_QUOTACTL=y | |||
295 | CONFIG_DNOTIFY=y | 367 | CONFIG_DNOTIFY=y |
296 | CONFIG_AUTOFS_FS=m | 368 | CONFIG_AUTOFS_FS=m |
297 | CONFIG_AUTOFS4_FS=m | 369 | CONFIG_AUTOFS4_FS=m |
298 | |||
299 | # | ||
300 | # Caches | ||
301 | # | ||
302 | # CONFIG_FSCACHE is not set | ||
303 | # CONFIG_FUSE_FS is not set | 370 | # CONFIG_FUSE_FS is not set |
304 | 371 | ||
305 | # | 372 | # |
@@ -323,14 +390,10 @@ CONFIG_JOLIET=y | |||
323 | CONFIG_PROC_FS=y | 390 | CONFIG_PROC_FS=y |
324 | CONFIG_PROC_KCORE=y | 391 | CONFIG_PROC_KCORE=y |
325 | CONFIG_SYSFS=y | 392 | CONFIG_SYSFS=y |
326 | # CONFIG_DEVFS_FS is not set | ||
327 | # CONFIG_DEVPTS_FS_XATTR is not set | ||
328 | CONFIG_TMPFS=y | 393 | CONFIG_TMPFS=y |
329 | # CONFIG_TMPFS_XATTR is not set | ||
330 | # CONFIG_HUGETLB_PAGE is not set | 394 | # CONFIG_HUGETLB_PAGE is not set |
331 | CONFIG_RAMFS=y | 395 | CONFIG_RAMFS=y |
332 | # CONFIG_CONFIGFS_FS is not set | 396 | # CONFIG_CONFIGFS_FS is not set |
333 | # CONFIG_RELAYFS_FS is not set | ||
334 | 397 | ||
335 | # | 398 | # |
336 | # Miscellaneous filesystems | 399 | # Miscellaneous filesystems |
@@ -430,6 +493,7 @@ CONFIG_NLS_DEFAULT="iso8859-1" | |||
430 | # Library routines | 493 | # Library routines |
431 | # | 494 | # |
432 | # CONFIG_CRC_CCITT is not set | 495 | # CONFIG_CRC_CCITT is not set |
496 | # CONFIG_CRC16 is not set | ||
433 | CONFIG_CRC32=m | 497 | CONFIG_CRC32=m |
434 | # CONFIG_LIBCRC32C is not set | 498 | # CONFIG_LIBCRC32C is not set |
435 | 499 | ||
@@ -448,12 +512,18 @@ CONFIG_LOG_BUF_SHIFT=14 | |||
448 | CONFIG_DETECT_SOFTLOCKUP=y | 512 | CONFIG_DETECT_SOFTLOCKUP=y |
449 | # CONFIG_SCHEDSTATS is not set | 513 | # CONFIG_SCHEDSTATS is not set |
450 | CONFIG_DEBUG_SLAB=y | 514 | CONFIG_DEBUG_SLAB=y |
515 | # CONFIG_DEBUG_SLAB_LEAK is not set | ||
516 | # CONFIG_DEBUG_MUTEXES is not set | ||
451 | # CONFIG_DEBUG_SPINLOCK is not set | 517 | # CONFIG_DEBUG_SPINLOCK is not set |
452 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set | 518 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set |
453 | # CONFIG_DEBUG_KOBJECT is not set | 519 | # CONFIG_DEBUG_KOBJECT is not set |
454 | CONFIG_DEBUG_INFO=y | 520 | CONFIG_DEBUG_INFO=y |
455 | # CONFIG_DEBUG_FS is not set | 521 | # CONFIG_DEBUG_FS is not set |
522 | # CONFIG_DEBUG_VM is not set | ||
456 | CONFIG_FRAME_POINTER=y | 523 | CONFIG_FRAME_POINTER=y |
524 | # CONFIG_UNWIND_INFO is not set | ||
525 | CONFIG_FORCED_INLINING=y | ||
526 | # CONFIG_RCU_TORTURE_TEST is not set | ||
457 | # CONFIG_GPROF is not set | 527 | # CONFIG_GPROF is not set |
458 | # CONFIG_GCOV is not set | 528 | # CONFIG_GCOV is not set |
459 | # CONFIG_SYSCALL_DEBUG is not set | 529 | # CONFIG_SYSCALL_DEBUG is not set |
diff --git a/arch/um/drivers/cow_user.c b/arch/um/drivers/cow_user.c index 6ab852bfcd3a..0ec4052db9c5 100644 --- a/arch/um/drivers/cow_user.c +++ b/arch/um/drivers/cow_user.c | |||
@@ -100,7 +100,7 @@ struct cow_header_v3_broken { | |||
100 | __u32 alignment; | 100 | __u32 alignment; |
101 | __u32 cow_format; | 101 | __u32 cow_format; |
102 | char backing_file[PATH_LEN_V3]; | 102 | char backing_file[PATH_LEN_V3]; |
103 | } __attribute__((packed)); | 103 | }; |
104 | 104 | ||
105 | /* COW format definitions - for now, we have only the usual COW bitmap */ | 105 | /* COW format definitions - for now, we have only the usual COW bitmap */ |
106 | #define COW_BITMAP 0 | 106 | #define COW_BITMAP 0 |
diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c index c39ea3abeda4..2ffda012385e 100644 --- a/arch/um/kernel/irq.c +++ b/arch/um/kernel/irq.c | |||
@@ -89,16 +89,18 @@ void sigio_handler(int sig, union uml_pt_regs *regs) | |||
89 | struct irq_fd *irq_fd; | 89 | struct irq_fd *irq_fd; |
90 | int n; | 90 | int n; |
91 | 91 | ||
92 | if(smp_sigio_handler()) return; | 92 | if (smp_sigio_handler()) |
93 | while(1){ | 93 | return; |
94 | |||
95 | while (1) { | ||
94 | n = os_waiting_for_events(active_fds); | 96 | n = os_waiting_for_events(active_fds); |
95 | if (n <= 0) { | 97 | if (n <= 0) { |
96 | if(n == -EINTR) continue; | 98 | if(n == -EINTR) continue; |
97 | else break; | 99 | else break; |
98 | } | 100 | } |
99 | 101 | ||
100 | for(irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next){ | 102 | for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) { |
101 | if(irq_fd->current_events != 0){ | 103 | if (irq_fd->current_events != 0) { |
102 | irq_fd->current_events = 0; | 104 | irq_fd->current_events = 0; |
103 | do_IRQ(irq_fd->irq, regs); | 105 | do_IRQ(irq_fd->irq, regs); |
104 | } | 106 | } |
@@ -110,19 +112,17 @@ void sigio_handler(int sig, union uml_pt_regs *regs) | |||
110 | 112 | ||
111 | static void maybe_sigio_broken(int fd, int type) | 113 | static void maybe_sigio_broken(int fd, int type) |
112 | { | 114 | { |
113 | if(os_isatty(fd)){ | 115 | if (os_isatty(fd)) { |
114 | if((type == IRQ_WRITE) && !pty_output_sigio){ | 116 | if ((type == IRQ_WRITE) && !pty_output_sigio) { |
115 | write_sigio_workaround(); | 117 | write_sigio_workaround(); |
116 | add_sigio_fd(fd, 0); | 118 | add_sigio_fd(fd, 0); |
117 | } | 119 | } else if ((type == IRQ_READ) && !pty_close_sigio) { |
118 | else if((type == IRQ_READ) && !pty_close_sigio){ | ||
119 | write_sigio_workaround(); | 120 | write_sigio_workaround(); |
120 | add_sigio_fd(fd, 1); | 121 | add_sigio_fd(fd, 1); |
121 | } | 122 | } |
122 | } | 123 | } |
123 | } | 124 | } |
124 | 125 | ||
125 | |||
126 | int activate_fd(int irq, int fd, int type, void *dev_id) | 126 | int activate_fd(int irq, int fd, int type, void *dev_id) |
127 | { | 127 | { |
128 | struct pollfd *tmp_pfd; | 128 | struct pollfd *tmp_pfd; |
@@ -132,16 +132,18 @@ int activate_fd(int irq, int fd, int type, void *dev_id) | |||
132 | 132 | ||
133 | pid = os_getpid(); | 133 | pid = os_getpid(); |
134 | err = os_set_fd_async(fd, pid); | 134 | err = os_set_fd_async(fd, pid); |
135 | if(err < 0) | 135 | if (err < 0) |
136 | goto out; | 136 | goto out; |
137 | 137 | ||
138 | new_fd = um_kmalloc(sizeof(*new_fd)); | 138 | new_fd = um_kmalloc(sizeof(*new_fd)); |
139 | err = -ENOMEM; | 139 | err = -ENOMEM; |
140 | if(new_fd == NULL) | 140 | if (new_fd == NULL) |
141 | goto out; | 141 | goto out; |
142 | 142 | ||
143 | if(type == IRQ_READ) events = UM_POLLIN | UM_POLLPRI; | 143 | if (type == IRQ_READ) |
144 | else events = UM_POLLOUT; | 144 | events = UM_POLLIN | UM_POLLPRI; |
145 | else | ||
146 | events = UM_POLLOUT; | ||
145 | *new_fd = ((struct irq_fd) { .next = NULL, | 147 | *new_fd = ((struct irq_fd) { .next = NULL, |
146 | .id = dev_id, | 148 | .id = dev_id, |
147 | .fd = fd, | 149 | .fd = fd, |
@@ -165,8 +167,8 @@ int activate_fd(int irq, int fd, int type, void *dev_id) | |||
165 | * a semaphore. | 167 | * a semaphore. |
166 | */ | 168 | */ |
167 | flags = irq_lock(); | 169 | flags = irq_lock(); |
168 | for(irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next){ | 170 | for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) { |
169 | if((irq_fd->fd == fd) && (irq_fd->type == type)){ | 171 | if ((irq_fd->fd == fd) && (irq_fd->type == type)) { |
170 | printk("Registering fd %d twice\n", fd); | 172 | printk("Registering fd %d twice\n", fd); |
171 | printk("Irqs : %d, %d\n", irq_fd->irq, irq); | 173 | printk("Irqs : %d, %d\n", irq_fd->irq, irq); |
172 | printk("Ids : 0x%p, 0x%p\n", irq_fd->id, dev_id); | 174 | printk("Ids : 0x%p, 0x%p\n", irq_fd->id, dev_id); |
@@ -175,13 +177,13 @@ int activate_fd(int irq, int fd, int type, void *dev_id) | |||
175 | } | 177 | } |
176 | 178 | ||
177 | /*-------------*/ | 179 | /*-------------*/ |
178 | if(type == IRQ_WRITE) | 180 | if (type == IRQ_WRITE) |
179 | fd = -1; | 181 | fd = -1; |
180 | 182 | ||
181 | tmp_pfd = NULL; | 183 | tmp_pfd = NULL; |
182 | n = 0; | 184 | n = 0; |
183 | 185 | ||
184 | while(1){ | 186 | while (1) { |
185 | n = os_create_pollfd(fd, events, tmp_pfd, n); | 187 | n = os_create_pollfd(fd, events, tmp_pfd, n); |
186 | if (n == 0) | 188 | if (n == 0) |
187 | break; | 189 | break; |
@@ -198,10 +200,8 @@ int activate_fd(int irq, int fd, int type, void *dev_id) | |||
198 | * then we free the buffer tmp_fds and try again. | 200 | * then we free the buffer tmp_fds and try again. |
199 | */ | 201 | */ |
200 | irq_unlock(flags); | 202 | irq_unlock(flags); |
201 | if (tmp_pfd != NULL) { | 203 | kfree(tmp_pfd); |
202 | kfree(tmp_pfd); | 204 | tmp_pfd = NULL; |
203 | tmp_pfd = NULL; | ||
204 | } | ||
205 | 205 | ||
206 | tmp_pfd = um_kmalloc(n); | 206 | tmp_pfd = um_kmalloc(n); |
207 | if (tmp_pfd == NULL) | 207 | if (tmp_pfd == NULL) |
@@ -249,7 +249,7 @@ static int same_irq_and_dev(struct irq_fd *irq, void *d) | |||
249 | { | 249 | { |
250 | struct irq_and_dev *data = d; | 250 | struct irq_and_dev *data = d; |
251 | 251 | ||
252 | return((irq->irq == data->irq) && (irq->id == data->dev)); | 252 | return ((irq->irq == data->irq) && (irq->id == data->dev)); |
253 | } | 253 | } |
254 | 254 | ||
255 | void free_irq_by_irq_and_dev(unsigned int irq, void *dev) | 255 | void free_irq_by_irq_and_dev(unsigned int irq, void *dev) |
@@ -262,7 +262,7 @@ void free_irq_by_irq_and_dev(unsigned int irq, void *dev) | |||
262 | 262 | ||
263 | static int same_fd(struct irq_fd *irq, void *fd) | 263 | static int same_fd(struct irq_fd *irq, void *fd) |
264 | { | 264 | { |
265 | return(irq->fd == *((int *) fd)); | 265 | return (irq->fd == *((int *)fd)); |
266 | } | 266 | } |
267 | 267 | ||
268 | void free_irq_by_fd(int fd) | 268 | void free_irq_by_fd(int fd) |
@@ -276,16 +276,17 @@ static struct irq_fd *find_irq_by_fd(int fd, int irqnum, int *index_out) | |||
276 | int i = 0; | 276 | int i = 0; |
277 | int fdi; | 277 | int fdi; |
278 | 278 | ||
279 | for(irq=active_fds; irq != NULL; irq = irq->next){ | 279 | for (irq = active_fds; irq != NULL; irq = irq->next) { |
280 | if((irq->fd == fd) && (irq->irq == irqnum)) break; | 280 | if ((irq->fd == fd) && (irq->irq == irqnum)) |
281 | break; | ||
281 | i++; | 282 | i++; |
282 | } | 283 | } |
283 | if(irq == NULL){ | 284 | if (irq == NULL) { |
284 | printk("find_irq_by_fd doesn't have descriptor %d\n", fd); | 285 | printk("find_irq_by_fd doesn't have descriptor %d\n", fd); |
285 | goto out; | 286 | goto out; |
286 | } | 287 | } |
287 | fdi = os_get_pollfd(i); | 288 | fdi = os_get_pollfd(i); |
288 | if((fdi != -1) && (fdi != fd)){ | 289 | if ((fdi != -1) && (fdi != fd)) { |
289 | printk("find_irq_by_fd - mismatch between active_fds and " | 290 | printk("find_irq_by_fd - mismatch between active_fds and " |
290 | "pollfds, fd %d vs %d, need %d\n", irq->fd, | 291 | "pollfds, fd %d vs %d, need %d\n", irq->fd, |
291 | fdi, fd); | 292 | fdi, fd); |
@@ -294,7 +295,7 @@ static struct irq_fd *find_irq_by_fd(int fd, int irqnum, int *index_out) | |||
294 | } | 295 | } |
295 | *index_out = i; | 296 | *index_out = i; |
296 | out: | 297 | out: |
297 | return(irq); | 298 | return irq; |
298 | } | 299 | } |
299 | 300 | ||
300 | void reactivate_fd(int fd, int irqnum) | 301 | void reactivate_fd(int fd, int irqnum) |
@@ -305,7 +306,7 @@ void reactivate_fd(int fd, int irqnum) | |||
305 | 306 | ||
306 | flags = irq_lock(); | 307 | flags = irq_lock(); |
307 | irq = find_irq_by_fd(fd, irqnum, &i); | 308 | irq = find_irq_by_fd(fd, irqnum, &i); |
308 | if(irq == NULL){ | 309 | if (irq == NULL) { |
309 | irq_unlock(flags); | 310 | irq_unlock(flags); |
310 | return; | 311 | return; |
311 | } | 312 | } |
@@ -326,7 +327,7 @@ void deactivate_fd(int fd, int irqnum) | |||
326 | 327 | ||
327 | flags = irq_lock(); | 328 | flags = irq_lock(); |
328 | irq = find_irq_by_fd(fd, irqnum, &i); | 329 | irq = find_irq_by_fd(fd, irqnum, &i); |
329 | if(irq == NULL) | 330 | if (irq == NULL) |
330 | goto out; | 331 | goto out; |
331 | os_set_pollfd(i, -1); | 332 | os_set_pollfd(i, -1); |
332 | out: | 333 | out: |
@@ -338,15 +339,15 @@ int deactivate_all_fds(void) | |||
338 | struct irq_fd *irq; | 339 | struct irq_fd *irq; |
339 | int err; | 340 | int err; |
340 | 341 | ||
341 | for(irq=active_fds;irq != NULL;irq = irq->next){ | 342 | for (irq = active_fds; irq != NULL; irq = irq->next) { |
342 | err = os_clear_fd_async(irq->fd); | 343 | err = os_clear_fd_async(irq->fd); |
343 | if(err) | 344 | if (err) |
344 | return(err); | 345 | return err; |
345 | } | 346 | } |
346 | /* If there is a signal already queued, after unblocking ignore it */ | 347 | /* If there is a signal already queued, after unblocking ignore it */ |
347 | os_set_ioignore(); | 348 | os_set_ioignore(); |
348 | 349 | ||
349 | return(0); | 350 | return 0; |
350 | } | 351 | } |
351 | 352 | ||
352 | void forward_interrupts(int pid) | 353 | void forward_interrupts(int pid) |
@@ -356,9 +357,9 @@ void forward_interrupts(int pid) | |||
356 | int err; | 357 | int err; |
357 | 358 | ||
358 | flags = irq_lock(); | 359 | flags = irq_lock(); |
359 | for(irq=active_fds;irq != NULL;irq = irq->next){ | 360 | for (irq = active_fds; irq != NULL; irq = irq->next) { |
360 | err = os_set_owner(irq->fd, pid); | 361 | err = os_set_owner(irq->fd, pid); |
361 | if(err < 0){ | 362 | if (err < 0) { |
362 | /* XXX Just remove the irq rather than | 363 | /* XXX Just remove the irq rather than |
363 | * print out an infinite stream of these | 364 | * print out an infinite stream of these |
364 | */ | 365 | */ |
@@ -379,7 +380,7 @@ void forward_interrupts(int pid) | |||
379 | unsigned int do_IRQ(int irq, union uml_pt_regs *regs) | 380 | unsigned int do_IRQ(int irq, union uml_pt_regs *regs) |
380 | { | 381 | { |
381 | irq_enter(); | 382 | irq_enter(); |
382 | __do_IRQ(irq, (struct pt_regs *) regs); | 383 | __do_IRQ(irq, (struct pt_regs *)regs); |
383 | irq_exit(); | 384 | irq_exit(); |
384 | return 1; | 385 | return 1; |
385 | } | 386 | } |
@@ -392,12 +393,12 @@ int um_request_irq(unsigned int irq, int fd, int type, | |||
392 | int err; | 393 | int err; |
393 | 394 | ||
394 | err = request_irq(irq, handler, irqflags, devname, dev_id); | 395 | err = request_irq(irq, handler, irqflags, devname, dev_id); |
395 | if(err) | 396 | if (err) |
396 | return(err); | 397 | return err; |
397 | 398 | ||
398 | if(fd != -1) | 399 | if (fd != -1) |
399 | err = activate_fd(irq, fd, type, dev_id); | 400 | err = activate_fd(irq, fd, type, dev_id); |
400 | return(err); | 401 | return err; |
401 | } | 402 | } |
402 | EXPORT_SYMBOL(um_request_irq); | 403 | EXPORT_SYMBOL(um_request_irq); |
403 | EXPORT_SYMBOL(reactivate_fd); | 404 | EXPORT_SYMBOL(reactivate_fd); |
@@ -409,7 +410,7 @@ unsigned long irq_lock(void) | |||
409 | unsigned long flags; | 410 | unsigned long flags; |
410 | 411 | ||
411 | spin_lock_irqsave(&irq_spinlock, flags); | 412 | spin_lock_irqsave(&irq_spinlock, flags); |
412 | return(flags); | 413 | return flags; |
413 | } | 414 | } |
414 | 415 | ||
415 | void irq_unlock(unsigned long flags) | 416 | void irq_unlock(unsigned long flags) |
@@ -452,7 +453,7 @@ void __init init_IRQ(void) | |||
452 | irq_desc[TIMER_IRQ].depth = 1; | 453 | irq_desc[TIMER_IRQ].depth = 1; |
453 | irq_desc[TIMER_IRQ].handler = &SIGVTALRM_irq_type; | 454 | irq_desc[TIMER_IRQ].handler = &SIGVTALRM_irq_type; |
454 | enable_irq(TIMER_IRQ); | 455 | enable_irq(TIMER_IRQ); |
455 | for(i=1;i<NR_IRQS;i++){ | 456 | for (i = 1; i < NR_IRQS; i++) { |
456 | irq_desc[i].status = IRQ_DISABLED; | 457 | irq_desc[i].status = IRQ_DISABLED; |
457 | irq_desc[i].action = NULL; | 458 | irq_desc[i].action = NULL; |
458 | irq_desc[i].depth = 1; | 459 | irq_desc[i].depth = 1; |
@@ -467,7 +468,7 @@ int init_aio_irq(int irq, char *name, irqreturn_t (*handler)(int, void *, | |||
467 | int fds[2], err; | 468 | int fds[2], err; |
468 | 469 | ||
469 | err = os_pipe(fds, 1, 1); | 470 | err = os_pipe(fds, 1, 1); |
470 | if(err){ | 471 | if (err) { |
471 | printk("init_aio_irq - os_pipe failed, err = %d\n", -err); | 472 | printk("init_aio_irq - os_pipe failed, err = %d\n", -err); |
472 | goto out; | 473 | goto out; |
473 | } | 474 | } |
@@ -475,7 +476,7 @@ int init_aio_irq(int irq, char *name, irqreturn_t (*handler)(int, void *, | |||
475 | err = um_request_irq(irq, fds[0], IRQ_READ, handler, | 476 | err = um_request_irq(irq, fds[0], IRQ_READ, handler, |
476 | SA_INTERRUPT | SA_SAMPLE_RANDOM, name, | 477 | SA_INTERRUPT | SA_SAMPLE_RANDOM, name, |
477 | (void *) (long) fds[0]); | 478 | (void *) (long) fds[0]); |
478 | if(err){ | 479 | if (err) { |
479 | printk("init_aio_irq - : um_request_irq failed, err = %d\n", | 480 | printk("init_aio_irq - : um_request_irq failed, err = %d\n", |
480 | err); | 481 | err); |
481 | goto out_close; | 482 | goto out_close; |
@@ -488,5 +489,5 @@ int init_aio_irq(int irq, char *name, irqreturn_t (*handler)(int, void *, | |||
488 | os_close_file(fds[0]); | 489 | os_close_file(fds[0]); |
489 | os_close_file(fds[1]); | 490 | os_close_file(fds[1]); |
490 | out: | 491 | out: |
491 | return(err); | 492 | return err; |
492 | } | 493 | } |
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c index 0500800df1c1..fc0f0b085ca7 100644 --- a/arch/um/kernel/physmem.c +++ b/arch/um/kernel/physmem.c | |||
@@ -407,6 +407,8 @@ unsigned long find_iomem(char *driver, unsigned long *len_out) | |||
407 | *len_out = region->size; | 407 | *len_out = region->size; |
408 | return(region->virt); | 408 | return(region->virt); |
409 | } | 409 | } |
410 | |||
411 | region = region->next; | ||
410 | } | 412 | } |
411 | 413 | ||
412 | return(0); | 414 | return(0); |
diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c index 60d2eda995c1..9a77fb3c269d 100644 --- a/arch/um/kernel/ptrace.c +++ b/arch/um/kernel/ptrace.c | |||
@@ -275,15 +275,13 @@ void syscall_trace(union uml_pt_regs *regs, int entryexit) | |||
275 | 275 | ||
276 | if (unlikely(current->audit_context)) { | 276 | if (unlikely(current->audit_context)) { |
277 | if (!entryexit) | 277 | if (!entryexit) |
278 | audit_syscall_entry(current, | 278 | audit_syscall_entry(HOST_AUDIT_ARCH, |
279 | HOST_AUDIT_ARCH, | ||
280 | UPT_SYSCALL_NR(regs), | 279 | UPT_SYSCALL_NR(regs), |
281 | UPT_SYSCALL_ARG1(regs), | 280 | UPT_SYSCALL_ARG1(regs), |
282 | UPT_SYSCALL_ARG2(regs), | 281 | UPT_SYSCALL_ARG2(regs), |
283 | UPT_SYSCALL_ARG3(regs), | 282 | UPT_SYSCALL_ARG3(regs), |
284 | UPT_SYSCALL_ARG4(regs)); | 283 | UPT_SYSCALL_ARG4(regs)); |
285 | else audit_syscall_exit(current, | 284 | else audit_syscall_exit(AUDITSC_RESULT(UPT_SYSCALL_RET(regs)), |
286 | AUDITSC_RESULT(UPT_SYSCALL_RET(regs)), | ||
287 | UPT_SYSCALL_RET(regs)); | 285 | UPT_SYSCALL_RET(regs)); |
288 | } | 286 | } |
289 | 287 | ||
diff --git a/arch/um/kernel/skas/Makefile b/arch/um/kernel/skas/Makefile index 57181a920d48..ea3a8e409a6e 100644 --- a/arch/um/kernel/skas/Makefile +++ b/arch/um/kernel/skas/Makefile | |||
@@ -6,9 +6,11 @@ | |||
6 | obj-y := clone.o exec_kern.o mem.o mmu.o process_kern.o \ | 6 | obj-y := clone.o exec_kern.o mem.o mmu.o process_kern.o \ |
7 | syscall.o tlb.o uaccess.o | 7 | syscall.o tlb.o uaccess.o |
8 | 8 | ||
9 | USER_OBJS := clone.o | 9 | # clone.o is in the stub, so it can't be built with profiling |
10 | # GCC hardened also auto-enables -fpic, but we need %ebx so it can't work -> | ||
11 | # disable it | ||
10 | 12 | ||
11 | include arch/um/scripts/Makefile.rules | 13 | CFLAGS_clone.o := $(CFLAGS_NO_HARDENING) |
14 | UNPROFILE_OBJS := clone.o | ||
12 | 15 | ||
13 | # clone.o is in the stub, so it can't be built with profiling | 16 | include arch/um/scripts/Makefile.rules |
14 | $(obj)/clone.o : c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) | ||
diff --git a/arch/um/kernel/time_kern.c b/arch/um/kernel/time_kern.c index 3c7626cdba4b..528cf623f8b4 100644 --- a/arch/um/kernel/time_kern.c +++ b/arch/um/kernel/time_kern.c | |||
@@ -209,4 +209,4 @@ int __init timer_init(void) | |||
209 | return(0); | 209 | return(0); |
210 | } | 210 | } |
211 | 211 | ||
212 | __initcall(timer_init); | 212 | arch_initcall(timer_init); |
diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c index 3bd10deea280..09251338d99e 100644 --- a/arch/um/os-Linux/file.c +++ b/arch/um/os-Linux/file.c | |||
@@ -171,7 +171,7 @@ int os_sigio_async(int master, int slave) | |||
171 | 171 | ||
172 | flags = fcntl(master, F_GETFL); | 172 | flags = fcntl(master, F_GETFL); |
173 | if(flags < 0) | 173 | if(flags < 0) |
174 | return errno; | 174 | return -errno; |
175 | 175 | ||
176 | if((fcntl(master, F_SETFL, flags | O_NONBLOCK | O_ASYNC) < 0) || | 176 | if((fcntl(master, F_SETFL, flags | O_NONBLOCK | O_ASYNC) < 0) || |
177 | (fcntl(master, F_SETOWN, os_getpid()) < 0)) | 177 | (fcntl(master, F_SETOWN, os_getpid()) < 0)) |
diff --git a/arch/um/os-Linux/irq.c b/arch/um/os-Linux/irq.c index e599be423da1..3788d4568d33 100644 --- a/arch/um/os-Linux/irq.c +++ b/arch/um/os-Linux/irq.c | |||
@@ -29,21 +29,21 @@ int os_waiting_for_events(struct irq_fd *active_fds) | |||
29 | int i, n, err; | 29 | int i, n, err; |
30 | 30 | ||
31 | n = poll(pollfds, pollfds_num, 0); | 31 | n = poll(pollfds, pollfds_num, 0); |
32 | if(n < 0){ | 32 | if (n < 0) { |
33 | err = -errno; | 33 | err = -errno; |
34 | if(errno != EINTR) | 34 | if (errno != EINTR) |
35 | printk("sigio_handler: os_waiting_for_events:" | 35 | printk("sigio_handler: os_waiting_for_events:" |
36 | " poll returned %d, errno = %d\n", n, errno); | 36 | " poll returned %d, errno = %d\n", n, errno); |
37 | return err; | 37 | return err; |
38 | } | 38 | } |
39 | 39 | ||
40 | if(n == 0) | 40 | if (n == 0) |
41 | return 0; | 41 | return 0; |
42 | 42 | ||
43 | irq_fd = active_fds; | 43 | irq_fd = active_fds; |
44 | 44 | ||
45 | for(i = 0; i < pollfds_num; i++){ | 45 | for (i = 0; i < pollfds_num; i++) { |
46 | if(pollfds[i].revents != 0){ | 46 | if (pollfds[i].revents != 0) { |
47 | irq_fd->current_events = pollfds[i].revents; | 47 | irq_fd->current_events = pollfds[i].revents; |
48 | pollfds[i].fd = -1; | 48 | pollfds[i].fd = -1; |
49 | } | 49 | } |
@@ -54,7 +54,7 @@ int os_waiting_for_events(struct irq_fd *active_fds) | |||
54 | 54 | ||
55 | int os_isatty(int fd) | 55 | int os_isatty(int fd) |
56 | { | 56 | { |
57 | return(isatty(fd)); | 57 | return isatty(fd); |
58 | } | 58 | } |
59 | 59 | ||
60 | int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds) | 60 | int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds) |
@@ -65,7 +65,7 @@ int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds) | |||
65 | return((pollfds_size + 1) * sizeof(pollfds[0])); | 65 | return((pollfds_size + 1) * sizeof(pollfds[0])); |
66 | } | 66 | } |
67 | 67 | ||
68 | if(pollfds != NULL){ | 68 | if (pollfds != NULL) { |
69 | memcpy(tmp_pfd, pollfds, | 69 | memcpy(tmp_pfd, pollfds, |
70 | sizeof(pollfds[0]) * pollfds_size); | 70 | sizeof(pollfds[0]) * pollfds_size); |
71 | /* remove old pollfds */ | 71 | /* remove old pollfds */ |
@@ -73,18 +73,15 @@ int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds) | |||
73 | } | 73 | } |
74 | pollfds = tmp_pfd; | 74 | pollfds = tmp_pfd; |
75 | pollfds_size++; | 75 | pollfds_size++; |
76 | } else { | 76 | } else |
77 | /* remove not used tmp_pfd */ | 77 | kfree(tmp_pfd); /* remove not used tmp_pfd */ |
78 | if (tmp_pfd != NULL) | ||
79 | kfree(tmp_pfd); | ||
80 | } | ||
81 | 78 | ||
82 | pollfds[pollfds_num] = ((struct pollfd) { .fd = fd, | 79 | pollfds[pollfds_num] = ((struct pollfd) { .fd = fd, |
83 | .events = events, | 80 | .events = events, |
84 | .revents = 0 }); | 81 | .revents = 0 }); |
85 | pollfds_num++; | 82 | pollfds_num++; |
86 | 83 | ||
87 | return(0); | 84 | return 0; |
88 | } | 85 | } |
89 | 86 | ||
90 | void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg, | 87 | void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg, |
@@ -94,11 +91,11 @@ void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg, | |||
94 | int i = 0; | 91 | int i = 0; |
95 | 92 | ||
96 | prev = &active_fds; | 93 | prev = &active_fds; |
97 | while(*prev != NULL){ | 94 | while (*prev != NULL) { |
98 | if((*test)(*prev, arg)){ | 95 | if ((*test)(*prev, arg)) { |
99 | struct irq_fd *old_fd = *prev; | 96 | struct irq_fd *old_fd = *prev; |
100 | if((pollfds[i].fd != -1) && | 97 | if ((pollfds[i].fd != -1) && |
101 | (pollfds[i].fd != (*prev)->fd)){ | 98 | (pollfds[i].fd != (*prev)->fd)) { |
102 | printk("os_free_irq_by_cb - mismatch between " | 99 | printk("os_free_irq_by_cb - mismatch between " |
103 | "active_fds and pollfds, fd %d vs %d\n", | 100 | "active_fds and pollfds, fd %d vs %d\n", |
104 | (*prev)->fd, pollfds[i].fd); | 101 | (*prev)->fd, pollfds[i].fd); |
@@ -110,7 +107,6 @@ void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg, | |||
110 | /* This moves the *whole* array after pollfds[i] | 107 | /* This moves the *whole* array after pollfds[i] |
111 | * (though it doesn't spot as such)! | 108 | * (though it doesn't spot as such)! |
112 | */ | 109 | */ |
113 | |||
114 | memmove(&pollfds[i], &pollfds[i + 1], | 110 | memmove(&pollfds[i], &pollfds[i + 1], |
115 | (pollfds_num - i) * sizeof(pollfds[0])); | 111 | (pollfds_num - i) * sizeof(pollfds[0])); |
116 | if(*last_irq_ptr2 == &old_fd->next) | 112 | if(*last_irq_ptr2 == &old_fd->next) |
@@ -129,10 +125,9 @@ void os_free_irq_by_cb(int (*test)(struct irq_fd *, void *), void *arg, | |||
129 | return; | 125 | return; |
130 | } | 126 | } |
131 | 127 | ||
132 | |||
133 | int os_get_pollfd(int i) | 128 | int os_get_pollfd(int i) |
134 | { | 129 | { |
135 | return(pollfds[i].fd); | 130 | return pollfds[i].fd; |
136 | } | 131 | } |
137 | 132 | ||
138 | void os_set_pollfd(int i, int fd) | 133 | void os_set_pollfd(int i, int fd) |
@@ -151,8 +146,10 @@ void init_irq_signals(int on_sigstack) | |||
151 | int flags; | 146 | int flags; |
152 | 147 | ||
153 | flags = on_sigstack ? SA_ONSTACK : 0; | 148 | flags = on_sigstack ? SA_ONSTACK : 0; |
154 | if(timer_irq_inited) h = (__sighandler_t) alarm_handler; | 149 | if (timer_irq_inited) |
155 | else h = boot_timer_handler; | 150 | h = (__sighandler_t)alarm_handler; |
151 | else | ||
152 | h = boot_timer_handler; | ||
156 | 153 | ||
157 | set_handler(SIGVTALRM, h, flags | SA_RESTART, | 154 | set_handler(SIGVTALRM, h, flags | SA_RESTART, |
158 | SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1); | 155 | SIGUSR1, SIGIO, SIGWINCH, SIGALRM, -1); |
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index 2878e89a674f..3a0ac38e978b 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c | |||
@@ -74,6 +74,34 @@ static void last_ditch_exit(int sig) | |||
74 | exit(1); | 74 | exit(1); |
75 | } | 75 | } |
76 | 76 | ||
77 | #define UML_LIB_PATH ":/usr/lib/uml" | ||
78 | |||
79 | static void setup_env_path(void) | ||
80 | { | ||
81 | char *new_path = NULL; | ||
82 | char *old_path = NULL; | ||
83 | int path_len = 0; | ||
84 | |||
85 | old_path = getenv("PATH"); | ||
86 | /* if no PATH variable is set or it has an empty value | ||
87 | * just use the default + /usr/lib/uml | ||
88 | */ | ||
89 | if (!old_path || (path_len = strlen(old_path)) == 0) { | ||
90 | putenv("PATH=:/bin:/usr/bin/" UML_LIB_PATH); | ||
91 | return; | ||
92 | } | ||
93 | |||
94 | /* append /usr/lib/uml to the existing path */ | ||
95 | path_len += strlen("PATH=" UML_LIB_PATH) + 1; | ||
96 | new_path = malloc(path_len); | ||
97 | if (!new_path) { | ||
98 | perror("coudn't malloc to set a new PATH"); | ||
99 | return; | ||
100 | } | ||
101 | snprintf(new_path, path_len, "PATH=%s" UML_LIB_PATH, old_path); | ||
102 | putenv(new_path); | ||
103 | } | ||
104 | |||
77 | extern int uml_exitcode; | 105 | extern int uml_exitcode; |
78 | 106 | ||
79 | extern void scan_elf_aux( char **envp); | 107 | extern void scan_elf_aux( char **envp); |
@@ -114,6 +142,8 @@ int main(int argc, char **argv, char **envp) | |||
114 | 142 | ||
115 | set_stklim(); | 143 | set_stklim(); |
116 | 144 | ||
145 | setup_env_path(); | ||
146 | |||
117 | new_argv = malloc((argc + 1) * sizeof(char *)); | 147 | new_argv = malloc((argc + 1) * sizeof(char *)); |
118 | if(new_argv == NULL){ | 148 | if(new_argv == NULL){ |
119 | perror("Mallocing argv"); | 149 | perror("Mallocing argv"); |
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c index 3505f44f8a25..233be2f4f8cb 100644 --- a/arch/um/os-Linux/process.c +++ b/arch/um/os-Linux/process.c | |||
@@ -206,29 +206,36 @@ int os_drop_memory(void *addr, int length) | |||
206 | int can_drop_memory(void) | 206 | int can_drop_memory(void) |
207 | { | 207 | { |
208 | void *addr; | 208 | void *addr; |
209 | int fd; | 209 | int fd, ok = 0; |
210 | 210 | ||
211 | printk("Checking host MADV_REMOVE support..."); | 211 | printk("Checking host MADV_REMOVE support..."); |
212 | fd = create_mem_file(UM_KERN_PAGE_SIZE); | 212 | fd = create_mem_file(UM_KERN_PAGE_SIZE); |
213 | if(fd < 0){ | 213 | if(fd < 0){ |
214 | printk("Creating test memory file failed, err = %d\n", -fd); | 214 | printk("Creating test memory file failed, err = %d\n", -fd); |
215 | return 0; | 215 | goto out; |
216 | } | 216 | } |
217 | 217 | ||
218 | addr = mmap64(NULL, UM_KERN_PAGE_SIZE, PROT_READ | PROT_WRITE, | 218 | addr = mmap64(NULL, UM_KERN_PAGE_SIZE, PROT_READ | PROT_WRITE, |
219 | MAP_SHARED, fd, 0); | 219 | MAP_SHARED, fd, 0); |
220 | if(addr == MAP_FAILED){ | 220 | if(addr == MAP_FAILED){ |
221 | printk("Mapping test memory file failed, err = %d\n", -errno); | 221 | printk("Mapping test memory file failed, err = %d\n", -errno); |
222 | return 0; | 222 | goto out_close; |
223 | } | 223 | } |
224 | 224 | ||
225 | if(madvise(addr, UM_KERN_PAGE_SIZE, MADV_REMOVE) != 0){ | 225 | if(madvise(addr, UM_KERN_PAGE_SIZE, MADV_REMOVE) != 0){ |
226 | printk("MADV_REMOVE failed, err = %d\n", -errno); | 226 | printk("MADV_REMOVE failed, err = %d\n", -errno); |
227 | return 0; | 227 | goto out_unmap; |
228 | } | 228 | } |
229 | 229 | ||
230 | printk("OK\n"); | 230 | printk("OK\n"); |
231 | return 1; | 231 | ok = 1; |
232 | |||
233 | out_unmap: | ||
234 | munmap(addr, UM_KERN_PAGE_SIZE); | ||
235 | out_close: | ||
236 | close(fd); | ||
237 | out: | ||
238 | return ok; | ||
232 | } | 239 | } |
233 | 240 | ||
234 | void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)) | 241 | void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)) |
diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c index 0776bc18ca85..bd89c6b99d5d 100644 --- a/arch/um/os-Linux/skas/process.c +++ b/arch/um/os-Linux/skas/process.c | |||
@@ -344,12 +344,12 @@ int copy_context_skas0(unsigned long new_stack, int pid) | |||
344 | err = ptrace_setregs(pid, regs); | 344 | err = ptrace_setregs(pid, regs); |
345 | if(err < 0) | 345 | if(err < 0) |
346 | panic("copy_context_skas0 : PTRACE_SETREGS failed, " | 346 | panic("copy_context_skas0 : PTRACE_SETREGS failed, " |
347 | "pid = %d, errno = %d\n", pid, errno); | 347 | "pid = %d, errno = %d\n", pid, -err); |
348 | 348 | ||
349 | err = ptrace_setfpregs(pid, fp_regs); | 349 | err = ptrace_setfpregs(pid, fp_regs); |
350 | if(err < 0) | 350 | if(err < 0) |
351 | panic("copy_context_skas0 : PTRACE_SETFPREGS failed, " | 351 | panic("copy_context_skas0 : PTRACE_SETFPREGS failed, " |
352 | "pid = %d, errno = %d\n", pid, errno); | 352 | "pid = %d, errno = %d\n", pid, -err); |
353 | 353 | ||
354 | /* set a well known return code for detection of child write failure */ | 354 | /* set a well known return code for detection of child write failure */ |
355 | child_data->err = 12345678; | 355 | child_data->err = 12345678; |
@@ -362,7 +362,7 @@ int copy_context_skas0(unsigned long new_stack, int pid) | |||
362 | pid = data->err; | 362 | pid = data->err; |
363 | if(pid < 0) | 363 | if(pid < 0) |
364 | panic("copy_context_skas0 - stub-parent reports error %d\n", | 364 | panic("copy_context_skas0 - stub-parent reports error %d\n", |
365 | pid); | 365 | -pid); |
366 | 366 | ||
367 | /* Wait, until child has finished too: read child's result from | 367 | /* Wait, until child has finished too: read child's result from |
368 | * child's stack and check it. | 368 | * child's stack and check it. |
diff --git a/arch/um/os-Linux/sys-i386/registers.c b/arch/um/os-Linux/sys-i386/registers.c index 7a6f6b99ceff..516f66dd87e3 100644 --- a/arch/um/os-Linux/sys-i386/registers.c +++ b/arch/um/os-Linux/sys-i386/registers.c | |||
@@ -104,7 +104,7 @@ void init_registers(int pid) | |||
104 | err = ptrace(PTRACE_GETREGS, pid, 0, exec_regs); | 104 | err = ptrace(PTRACE_GETREGS, pid, 0, exec_regs); |
105 | if(err) | 105 | if(err) |
106 | panic("check_ptrace : PTRACE_GETREGS failed, errno = %d", | 106 | panic("check_ptrace : PTRACE_GETREGS failed, errno = %d", |
107 | err); | 107 | errno); |
108 | 108 | ||
109 | errno = 0; | 109 | errno = 0; |
110 | err = ptrace(PTRACE_GETFPXREGS, pid, 0, exec_fpx_regs); | 110 | err = ptrace(PTRACE_GETFPXREGS, pid, 0, exec_fpx_regs); |
@@ -119,7 +119,7 @@ void init_registers(int pid) | |||
119 | err = ptrace(PTRACE_GETFPREGS, pid, 0, exec_fp_regs); | 119 | err = ptrace(PTRACE_GETFPREGS, pid, 0, exec_fp_regs); |
120 | if(err) | 120 | if(err) |
121 | panic("check_ptrace : PTRACE_GETFPREGS failed, errno = %d", | 121 | panic("check_ptrace : PTRACE_GETFPREGS failed, errno = %d", |
122 | err); | 122 | errno); |
123 | } | 123 | } |
124 | 124 | ||
125 | void get_safe_registers(unsigned long *regs, unsigned long *fp_regs) | 125 | void get_safe_registers(unsigned long *regs, unsigned long *fp_regs) |
diff --git a/arch/um/os-Linux/sys-x86_64/registers.c b/arch/um/os-Linux/sys-x86_64/registers.c index 001941fa1a1e..becd898d9398 100644 --- a/arch/um/os-Linux/sys-x86_64/registers.c +++ b/arch/um/os-Linux/sys-x86_64/registers.c | |||
@@ -62,12 +62,12 @@ void init_registers(int pid) | |||
62 | err = ptrace(PTRACE_GETREGS, pid, 0, exec_regs); | 62 | err = ptrace(PTRACE_GETREGS, pid, 0, exec_regs); |
63 | if(err) | 63 | if(err) |
64 | panic("check_ptrace : PTRACE_GETREGS failed, errno = %d", | 64 | panic("check_ptrace : PTRACE_GETREGS failed, errno = %d", |
65 | err); | 65 | errno); |
66 | 66 | ||
67 | err = ptrace(PTRACE_GETFPREGS, pid, 0, exec_fp_regs); | 67 | err = ptrace(PTRACE_GETFPREGS, pid, 0, exec_fp_regs); |
68 | if(err) | 68 | if(err) |
69 | panic("check_ptrace : PTRACE_GETFPREGS failed, errno = %d", | 69 | panic("check_ptrace : PTRACE_GETFPREGS failed, errno = %d", |
70 | err); | 70 | errno); |
71 | } | 71 | } |
72 | 72 | ||
73 | void get_safe_registers(unsigned long *regs, unsigned long *fp_regs) | 73 | void get_safe_registers(unsigned long *regs, unsigned long *fp_regs) |
diff --git a/arch/um/os-Linux/umid.c b/arch/um/os-Linux/umid.c index 34bfc1bb9e38..362db059fe30 100644 --- a/arch/um/os-Linux/umid.c +++ b/arch/um/os-Linux/umid.c | |||
@@ -178,14 +178,14 @@ static void __init create_pid_file(void) | |||
178 | fd = open(file, O_RDWR | O_CREAT | O_EXCL, 0644); | 178 | fd = open(file, O_RDWR | O_CREAT | O_EXCL, 0644); |
179 | if(fd < 0){ | 179 | if(fd < 0){ |
180 | printk("Open of machine pid file \"%s\" failed: %s\n", | 180 | printk("Open of machine pid file \"%s\" failed: %s\n", |
181 | file, strerror(-fd)); | 181 | file, strerror(errno)); |
182 | return; | 182 | return; |
183 | } | 183 | } |
184 | 184 | ||
185 | snprintf(pid, sizeof(pid), "%d\n", getpid()); | 185 | snprintf(pid, sizeof(pid), "%d\n", getpid()); |
186 | n = write(fd, pid, strlen(pid)); | 186 | n = write(fd, pid, strlen(pid)); |
187 | if(n != strlen(pid)) | 187 | if(n != strlen(pid)) |
188 | printk("Write of pid file failed - err = %d\n", -n); | 188 | printk("Write of pid file failed - err = %d\n", errno); |
189 | 189 | ||
190 | close(fd); | 190 | close(fd); |
191 | } | 191 | } |
diff --git a/arch/um/os-Linux/user_syms.c b/arch/um/os-Linux/user_syms.c index 2598158e1f53..3f33165ada68 100644 --- a/arch/um/os-Linux/user_syms.c +++ b/arch/um/os-Linux/user_syms.c | |||
@@ -96,6 +96,13 @@ EXPORT_SYMBOL_PROTO(getuid); | |||
96 | EXPORT_SYMBOL_PROTO(fsync); | 96 | EXPORT_SYMBOL_PROTO(fsync); |
97 | EXPORT_SYMBOL_PROTO(fdatasync); | 97 | EXPORT_SYMBOL_PROTO(fdatasync); |
98 | 98 | ||
99 | /* Export symbols used by GCC for the stack protector. */ | ||
100 | extern void __stack_smash_handler(void *) __attribute__((weak)); | ||
101 | EXPORT_SYMBOL(__stack_smash_handler); | ||
102 | |||
103 | extern long __guard __attribute__((weak)); | ||
104 | EXPORT_SYMBOL(__guard); | ||
105 | |||
99 | /* | 106 | /* |
100 | * Overrides for Emacs so that we follow Linus's tabbing style. | 107 | * Overrides for Emacs so that we follow Linus's tabbing style. |
101 | * Emacs will notice this stuff at the end of the file and automatically | 108 | * Emacs will notice this stuff at the end of the file and automatically |
diff --git a/arch/um/scripts/Makefile.rules b/arch/um/scripts/Makefile.rules index 5e7a9c310aa5..1347dc6d5218 100644 --- a/arch/um/scripts/Makefile.rules +++ b/arch/um/scripts/Makefile.rules | |||
@@ -7,11 +7,19 @@ USER_SINGLE_OBJS := \ | |||
7 | USER_OBJS += $(filter %_user.o,$(obj-y) $(obj-m) $(USER_SINGLE_OBJS)) | 7 | USER_OBJS += $(filter %_user.o,$(obj-y) $(obj-m) $(USER_SINGLE_OBJS)) |
8 | USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) | 8 | USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) |
9 | 9 | ||
10 | $(USER_OBJS) $(USER_OBJS:.o=.i) $(USER_OBJS:.o=.s) $(USER_OBJS:.o=.lst): \ | 10 | $(USER_OBJS:.o=.%): \ |
11 | c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(notdir $@)) | 11 | c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(*F).o) |
12 | $(USER_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \ | 12 | $(USER_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \ |
13 | -Dunix -D__unix__ -D__$(SUBARCH)__ | 13 | -Dunix -D__unix__ -D__$(SUBARCH)__ |
14 | 14 | ||
15 | # These are like USER_OBJS but filter USER_CFLAGS through unprofile instead of | ||
16 | # using it directly. | ||
17 | UNPROFILE_OBJS := $(foreach file,$(UNPROFILE_OBJS),$(obj)/$(file)) | ||
18 | |||
19 | $(UNPROFILE_OBJS:.o=.%): \ | ||
20 | c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) $(CFLAGS_$(*F).o) | ||
21 | $(UNPROFILE_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \ | ||
22 | -Dunix -D__unix__ -D__$(SUBARCH)__ | ||
15 | 23 | ||
16 | # The stubs and unmap.o can't try to call mcount or update basic block data | 24 | # The stubs and unmap.o can't try to call mcount or update basic block data |
17 | define unprofile | 25 | define unprofile |
diff --git a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile index 98b20b7bba4f..374d61a19439 100644 --- a/arch/um/sys-i386/Makefile +++ b/arch/um/sys-i386/Makefile | |||
@@ -8,11 +8,16 @@ subarch-obj-y = lib/bitops.o kernel/semaphore.o | |||
8 | subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem.o | 8 | subarch-obj-$(CONFIG_HIGHMEM) += mm/highmem.o |
9 | subarch-obj-$(CONFIG_MODULES) += kernel/module.o | 9 | subarch-obj-$(CONFIG_MODULES) += kernel/module.o |
10 | 10 | ||
11 | USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o stub_segv.o | 11 | USER_OBJS := bugs.o ptrace_user.o sigcontext.o fault.o |
12 | 12 | ||
13 | include arch/um/scripts/Makefile.rules | 13 | USER_OBJS += user-offsets.s |
14 | extra-y += user-offsets.s | ||
14 | 15 | ||
15 | extra-$(CONFIG_MODE_TT) += unmap.o | 16 | extra-$(CONFIG_MODE_TT) += unmap.o |
16 | 17 | ||
17 | $(obj)/stub_segv.o $(obj)/unmap.o: \ | 18 | UNPROFILE_OBJS := stub_segv.o |
18 | _c_flags = $(call unprofile,$(CFLAGS)) | 19 | CFLAGS_stub_segv.o := $(CFLAGS_NO_HARDENING) |
20 | |||
21 | include arch/um/scripts/Makefile.rules | ||
22 | |||
23 | $(obj)/unmap.%: _c_flags = $(call unprofile,$(CFLAGS)) | ||
diff --git a/arch/um/sys-x86_64/Makefile b/arch/um/sys-x86_64/Makefile index b5fc22babddf..c19794d435d6 100644 --- a/arch/um/sys-x86_64/Makefile +++ b/arch/um/sys-x86_64/Makefile | |||
@@ -16,11 +16,16 @@ subarch-obj-$(CONFIG_MODULES) += kernel/module.o | |||
16 | 16 | ||
17 | ldt-y = ../sys-i386/ldt.o | 17 | ldt-y = ../sys-i386/ldt.o |
18 | 18 | ||
19 | USER_OBJS := ptrace_user.o sigcontext.o stub_segv.o | 19 | USER_OBJS := ptrace_user.o sigcontext.o |
20 | 20 | ||
21 | include arch/um/scripts/Makefile.rules | 21 | USER_OBJS += user-offsets.s |
22 | extra-y += user-offsets.s | ||
22 | 23 | ||
23 | extra-$(CONFIG_MODE_TT) += unmap.o | 24 | extra-$(CONFIG_MODE_TT) += unmap.o |
24 | 25 | ||
25 | $(obj)/stub_segv.o $(obj)/unmap.o: \ | 26 | UNPROFILE_OBJS := stub_segv.o |
26 | _c_flags = $(call unprofile,$(CFLAGS)) | 27 | CFLAGS_stub_segv.o := $(CFLAGS_NO_HARDENING) |
28 | |||
29 | include arch/um/scripts/Makefile.rules | ||
30 | |||
31 | $(obj)/unmap.%: _c_flags = $(call unprofile,$(CFLAGS)) | ||