Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'for-linus-5.2-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/rw/uml

Pull UML updates from Richard Weinberger:

- Kconfig cleanups

- Fix cpu_all_mask() usage

- Various bug fixes

* tag 'for-linus-5.2-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/rw/uml:
um: irq: don't set the chip for all irqs
um: define set_pte_at() as a static inline function, not a macro
um: remove uses of variable length arrays
um: remove unused variable
uml: fix a boot splat wrt use of cpu_all_mask
um: Do not unlock mutex that is not hold.
hostfs: fix mismatch between link_file definition and declaration
arch: um: drivers: Kconfig: pedantic formatting
arch: um: Kconfig: pedantic indention cleanups
um: Revert to using stack for pt_regs in signal handling

+239 -225
+31 -27
arch/um/Kconfig
··· 80 80 bool 81 81 default y 82 82 depends on !LD_SCRIPT_STATIC 83 - select MODULE_REL_CRCS if MODVERSIONS 83 + select MODULE_REL_CRCS if MODVERSIONS 84 84 85 85 config HOSTFS 86 86 tristate "Host filesystem" 87 87 help 88 - While the User-Mode Linux port uses its own root file system for 89 - booting and normal file access, this module lets the UML user 90 - access files stored on the host. It does not require any 91 - network connection between the Host and UML. An example use of 92 - this might be: 88 + While the User-Mode Linux port uses its own root file system for 89 + booting and normal file access, this module lets the UML user 90 + access files stored on the host. It does not require any 91 + network connection between the Host and UML. An example use of 92 + this might be: 93 93 94 - mount none /tmp/fromhost -t hostfs -o /tmp/umlshare 94 + mount none /tmp/fromhost -t hostfs -o /tmp/umlshare 95 95 96 - where /tmp/fromhost is an empty directory inside UML and 97 - /tmp/umlshare is a directory on the host with files the UML user 98 - wishes to access. 96 + where /tmp/fromhost is an empty directory inside UML and 97 + /tmp/umlshare is a directory on the host with files the UML user 98 + wishes to access. 99 99 100 - For more information, see 101 - <http://user-mode-linux.sourceforge.net/hostfs.html>. 100 + For more information, see 101 + <http://user-mode-linux.sourceforge.net/hostfs.html>. 102 102 103 - If you'd like to be able to work with files stored on the host, 104 - say Y or M here; otherwise say N. 103 + If you'd like to be able to work with files stored on the host, 104 + say Y or M here; otherwise say N. 105 105 106 106 config MCONSOLE 107 107 bool "Management console" 108 108 depends on PROC_FS 109 109 default y 110 110 help 111 - The user mode linux management console is a low-level interface to 112 - the kernel, somewhat like the i386 SysRq interface. Since there is 113 - a full-blown operating system running under every user mode linux 114 - instance, there is much greater flexibility possible than with the 115 - SysRq mechanism. 111 + The user mode linux management console is a low-level interface to 112 + the kernel, somewhat like the i386 SysRq interface. Since there is 113 + a full-blown operating system running under every user mode linux 114 + instance, there is much greater flexibility possible than with the 115 + SysRq mechanism. 116 116 117 - If you answer 'Y' to this option, to use this feature, you need the 118 - mconsole client (called uml_mconsole) which is present in CVS in 119 - 2.4.5-9um and later (path /tools/mconsole), and is also in the 120 - distribution RPM package in 2.4.6 and later. 117 + If you answer 'Y' to this option, to use this feature, you need the 118 + mconsole client (called uml_mconsole) which is present in CVS in 119 + 2.4.5-9um and later (path /tools/mconsole), and is also in the 120 + distribution RPM package in 2.4.6 and later. 121 121 122 - It is safe to say 'Y' here. 122 + It is safe to say 'Y' here. 123 123 124 124 config MAGIC_SYSRQ 125 125 bool "Magic SysRq key" ··· 142 142 143 143 config KERNEL_STACK_ORDER 144 144 int "Kernel stack size order" 145 - default 1 if 64BIT 146 - range 1 10 if 64BIT 147 - default 0 if !64BIT 145 + default 2 if 64BIT 146 + range 2 10 if 64BIT 147 + default 1 if !64BIT 148 148 help 149 149 This option determines the size of UML kernel stacks. They will 150 150 be 1 << order pages. The default is OK unless you're running Valgrind 151 151 on UML, in which case, set this to 3. 152 + It is possible to reduce the stack to 1 for 64BIT and 0 for 32BIT on 153 + older (pre-2017) CPUs. It is not recommended on newer CPUs due to the 154 + increase in the size of the state which needs to be saved when handling 155 + signals. 152 156 153 157 config MMAPPER 154 158 tristate "iomem emulation driver"
+162 -162
arch/um/drivers/Kconfig
··· 11 11 config SSL 12 12 bool "Virtual serial line" 13 13 help 14 - The User-Mode Linux environment allows you to create virtual serial 15 - lines on the UML that are usually made to show up on the host as 16 - ttys or ptys. 14 + The User-Mode Linux environment allows you to create virtual serial 15 + lines on the UML that are usually made to show up on the host as 16 + ttys or ptys. 17 17 18 - See <http://user-mode-linux.sourceforge.net/old/input.html> for more 19 - information and command line examples of how to use this facility. 18 + See <http://user-mode-linux.sourceforge.net/old/input.html> for more 19 + information and command line examples of how to use this facility. 20 20 21 - Unless you have a specific reason for disabling this, say Y. 21 + Unless you have a specific reason for disabling this, say Y. 22 22 23 23 config NULL_CHAN 24 24 bool "null channel support" 25 25 help 26 - This option enables support for attaching UML consoles and serial 27 - lines to a device similar to /dev/null. Data written to it disappears 28 - and there is never any data to be read. 26 + This option enables support for attaching UML consoles and serial 27 + lines to a device similar to /dev/null. Data written to it disappears 28 + and there is never any data to be read. 29 29 30 30 config PORT_CHAN 31 31 bool "port channel support" 32 32 help 33 - This option enables support for attaching UML consoles and serial 34 - lines to host portals. They may be accessed with 'telnet <host> 35 - <port number>'. Any number of consoles and serial lines may be 36 - attached to a single portal, although what UML device you get when 37 - you telnet to that portal will be unpredictable. 38 - It is safe to say 'Y' here. 33 + This option enables support for attaching UML consoles and serial 34 + lines to host portals. They may be accessed with 'telnet <host> 35 + <port number>'. Any number of consoles and serial lines may be 36 + attached to a single portal, although what UML device you get when 37 + you telnet to that portal will be unpredictable. 38 + It is safe to say 'Y' here. 39 39 40 40 config PTY_CHAN 41 41 bool "pty channel support" 42 42 help 43 - This option enables support for attaching UML consoles and serial 44 - lines to host pseudo-terminals. Access to both traditional 45 - pseudo-terminals (/dev/pty*) and pts pseudo-terminals are controlled 46 - with this option. The assignment of UML devices to host devices 47 - will be announced in the kernel message log. 48 - It is safe to say 'Y' here. 43 + This option enables support for attaching UML consoles and serial 44 + lines to host pseudo-terminals. Access to both traditional 45 + pseudo-terminals (/dev/pty*) and pts pseudo-terminals are controlled 46 + with this option. The assignment of UML devices to host devices 47 + will be announced in the kernel message log. 48 + It is safe to say 'Y' here. 49 49 50 50 config TTY_CHAN 51 51 bool "tty channel support" 52 52 help 53 - This option enables support for attaching UML consoles and serial 54 - lines to host terminals. Access to both virtual consoles 55 - (/dev/tty*) and the slave side of pseudo-terminals (/dev/ttyp* and 56 - /dev/pts/*) are controlled by this option. 57 - It is safe to say 'Y' here. 53 + This option enables support for attaching UML consoles and serial 54 + lines to host terminals. Access to both virtual consoles 55 + (/dev/tty*) and the slave side of pseudo-terminals (/dev/ttyp* and 56 + /dev/pts/*) are controlled by this option. 57 + It is safe to say 'Y' here. 58 58 59 59 config XTERM_CHAN 60 60 bool "xterm channel support" 61 61 help 62 - This option enables support for attaching UML consoles and serial 63 - lines to xterms. Each UML device so assigned will be brought up in 64 - its own xterm. 65 - It is safe to say 'Y' here. 62 + This option enables support for attaching UML consoles and serial 63 + lines to xterms. Each UML device so assigned will be brought up in 64 + its own xterm. 65 + It is safe to say 'Y' here. 66 66 67 67 config NOCONFIG_CHAN 68 68 bool ··· 72 72 string "Default main console channel initialization" 73 73 default "fd:0,fd:1" 74 74 help 75 - This is the string describing the channel to which the main console 76 - will be attached by default. This value can be overridden from the 77 - command line. The default value is "fd:0,fd:1", which attaches the 78 - main console to stdin and stdout. 79 - It is safe to leave this unchanged. 75 + This is the string describing the channel to which the main console 76 + will be attached by default. This value can be overridden from the 77 + command line. The default value is "fd:0,fd:1", which attaches the 78 + main console to stdin and stdout. 79 + It is safe to leave this unchanged. 80 80 81 81 config CON_CHAN 82 82 string "Default console channel initialization" 83 83 default "xterm" 84 84 help 85 - This is the string describing the channel to which all consoles 86 - except the main console will be attached by default. This value can 87 - be overridden from the command line. The default value is "xterm", 88 - which brings them up in xterms. 89 - It is safe to leave this unchanged, although you may wish to change 90 - this if you expect the UML that you build to be run in environments 91 - which don't have X or xterm available. 85 + This is the string describing the channel to which all consoles 86 + except the main console will be attached by default. This value can 87 + be overridden from the command line. The default value is "xterm", 88 + which brings them up in xterms. 89 + It is safe to leave this unchanged, although you may wish to change 90 + this if you expect the UML that you build to be run in environments 91 + which don't have X or xterm available. 92 92 93 93 config SSL_CHAN 94 94 string "Default serial line channel initialization" 95 95 default "pty" 96 96 help 97 - This is the string describing the channel to which the serial lines 98 - will be attached by default. This value can be overridden from the 99 - command line. The default value is "pty", which attaches them to 100 - traditional pseudo-terminals. 101 - It is safe to leave this unchanged, although you may wish to change 102 - this if you expect the UML that you build to be run in environments 103 - which don't have a set of /dev/pty* devices. 97 + This is the string describing the channel to which the serial lines 98 + will be attached by default. This value can be overridden from the 99 + command line. The default value is "pty", which attaches them to 100 + traditional pseudo-terminals. 101 + It is safe to leave this unchanged, although you may wish to change 102 + this if you expect the UML that you build to be run in environments 103 + which don't have a set of /dev/pty* devices. 104 104 105 105 config UML_SOUND 106 106 tristate "Sound support" 107 107 help 108 - This option enables UML sound support. If enabled, it will pull in 109 - soundcore and the UML hostaudio relay, which acts as a intermediary 110 - between the host's dsp and mixer devices and the UML sound system. 111 - It is safe to say 'Y' here. 108 + This option enables UML sound support. If enabled, it will pull in 109 + soundcore and the UML hostaudio relay, which acts as a intermediary 110 + between the host's dsp and mixer devices and the UML sound system. 111 + It is safe to say 'Y' here. 112 112 113 113 config SOUND 114 114 tristate ··· 131 131 config UML_NET 132 132 bool "Virtual network device" 133 133 help 134 - While the User-Mode port cannot directly talk to any physical 135 - hardware devices, this choice and the following transport options 136 - provide one or more virtual network devices through which the UML 137 - kernels can talk to each other, the host, and with the host's help, 138 - machines on the outside world. 134 + While the User-Mode port cannot directly talk to any physical 135 + hardware devices, this choice and the following transport options 136 + provide one or more virtual network devices through which the UML 137 + kernels can talk to each other, the host, and with the host's help, 138 + machines on the outside world. 139 139 140 - For more information, including explanations of the networking and 141 - sample configurations, see 142 - <http://user-mode-linux.sourceforge.net/old/networking.html>. 140 + For more information, including explanations of the networking and 141 + sample configurations, see 142 + <http://user-mode-linux.sourceforge.net/old/networking.html>. 143 143 144 - If you'd like to be able to enable networking in the User-Mode 145 - linux environment, say Y; otherwise say N. Note that you must 146 - enable at least one of the following transport options to actually 147 - make use of UML networking. 144 + If you'd like to be able to enable networking in the User-Mode 145 + linux environment, say Y; otherwise say N. Note that you must 146 + enable at least one of the following transport options to actually 147 + make use of UML networking. 148 148 149 149 config UML_NET_ETHERTAP 150 150 bool "Ethertap transport" 151 151 depends on UML_NET 152 152 help 153 - The Ethertap User-Mode Linux network transport allows a single 154 - running UML to exchange packets with its host over one of the 155 - host's Ethertap devices, such as /dev/tap0. Additional running 156 - UMLs can use additional Ethertap devices, one per running UML. 157 - While the UML believes it's on a (multi-device, broadcast) virtual 158 - Ethernet network, it's in fact communicating over a point-to-point 159 - link with the host. 153 + The Ethertap User-Mode Linux network transport allows a single 154 + running UML to exchange packets with its host over one of the 155 + host's Ethertap devices, such as /dev/tap0. Additional running 156 + UMLs can use additional Ethertap devices, one per running UML. 157 + While the UML believes it's on a (multi-device, broadcast) virtual 158 + Ethernet network, it's in fact communicating over a point-to-point 159 + link with the host. 160 160 161 - To use this, your host kernel must have support for Ethertap 162 - devices. Also, if your host kernel is 2.4.x, it must have 163 - CONFIG_NETLINK_DEV configured as Y or M. 161 + To use this, your host kernel must have support for Ethertap 162 + devices. Also, if your host kernel is 2.4.x, it must have 163 + CONFIG_NETLINK_DEV configured as Y or M. 164 164 165 - For more information, see 166 - <http://user-mode-linux.sourceforge.net/old/networking.html> That site 167 - has examples of the UML command line to use to enable Ethertap 168 - networking. 165 + For more information, see 166 + <http://user-mode-linux.sourceforge.net/old/networking.html> That site 167 + has examples of the UML command line to use to enable Ethertap 168 + networking. 169 169 170 - If you'd like to set up an IP network with the host and/or the 171 - outside world, say Y to this, the Daemon Transport and/or the 172 - Slip Transport. You'll need at least one of them, but may choose 173 - more than one without conflict. If you don't need UML networking, 174 - say N. 170 + If you'd like to set up an IP network with the host and/or the 171 + outside world, say Y to this, the Daemon Transport and/or the 172 + Slip Transport. You'll need at least one of them, but may choose 173 + more than one without conflict. If you don't need UML networking, 174 + say N. 175 175 176 176 config UML_NET_TUNTAP 177 177 bool "TUN/TAP transport" 178 178 depends on UML_NET 179 179 help 180 - The UML TUN/TAP network transport allows a UML instance to exchange 181 - packets with the host over a TUN/TAP device. This option will only 182 - work with a 2.4 host, unless you've applied the TUN/TAP patch to 183 - your 2.2 host kernel. 180 + The UML TUN/TAP network transport allows a UML instance to exchange 181 + packets with the host over a TUN/TAP device. This option will only 182 + work with a 2.4 host, unless you've applied the TUN/TAP patch to 183 + your 2.2 host kernel. 184 184 185 - To use this transport, your host kernel must have support for TUN/TAP 186 - devices, either built-in or as a module. 185 + To use this transport, your host kernel must have support for TUN/TAP 186 + devices, either built-in or as a module. 187 187 188 188 config UML_NET_SLIP 189 189 bool "SLIP transport" 190 190 depends on UML_NET 191 191 help 192 - The slip User-Mode Linux network transport allows a running UML to 193 - network with its host over a point-to-point link. Unlike Ethertap, 194 - which can carry any Ethernet frame (and hence even non-IP packets), 195 - the slip transport can only carry IP packets. 192 + The slip User-Mode Linux network transport allows a running UML to 193 + network with its host over a point-to-point link. Unlike Ethertap, 194 + which can carry any Ethernet frame (and hence even non-IP packets), 195 + the slip transport can only carry IP packets. 196 196 197 - To use this, your host must support slip devices. 197 + To use this, your host must support slip devices. 198 198 199 - For more information, see 200 - <http://user-mode-linux.sourceforge.net/old/networking.html>. 201 - has examples of the UML command line to use to enable slip 202 - networking, and details of a few quirks with it. 199 + For more information, see 200 + <http://user-mode-linux.sourceforge.net/old/networking.html>. 201 + has examples of the UML command line to use to enable slip 202 + networking, and details of a few quirks with it. 203 203 204 - The Ethertap Transport is preferred over slip because of its 205 - limitations. If you prefer slip, however, say Y here. Otherwise 206 - choose the Multicast transport (to network multiple UMLs on 207 - multiple hosts), Ethertap (to network with the host and the 208 - outside world), and/or the Daemon transport (to network multiple 209 - UMLs on a single host). You may choose more than one without 210 - conflict. If you don't need UML networking, say N. 204 + The Ethertap Transport is preferred over slip because of its 205 + limitations. If you prefer slip, however, say Y here. Otherwise 206 + choose the Multicast transport (to network multiple UMLs on 207 + multiple hosts), Ethertap (to network with the host and the 208 + outside world), and/or the Daemon transport (to network multiple 209 + UMLs on a single host). You may choose more than one without 210 + conflict. If you don't need UML networking, say N. 211 211 212 212 config UML_NET_DAEMON 213 213 bool "Daemon transport" 214 214 depends on UML_NET 215 215 help 216 - This User-Mode Linux network transport allows one or more running 217 - UMLs on a single host to communicate with each other, but not to 218 - the host. 216 + This User-Mode Linux network transport allows one or more running 217 + UMLs on a single host to communicate with each other, but not to 218 + the host. 219 219 220 - To use this form of networking, you'll need to run the UML 221 - networking daemon on the host. 220 + To use this form of networking, you'll need to run the UML 221 + networking daemon on the host. 222 222 223 - For more information, see 224 - <http://user-mode-linux.sourceforge.net/old/networking.html> That site 225 - has examples of the UML command line to use to enable Daemon 226 - networking. 223 + For more information, see 224 + <http://user-mode-linux.sourceforge.net/old/networking.html> That site 225 + has examples of the UML command line to use to enable Daemon 226 + networking. 227 227 228 - If you'd like to set up a network with other UMLs on a single host, 229 - say Y. If you need a network between UMLs on multiple physical 230 - hosts, choose the Multicast Transport. To set up a network with 231 - the host and/or other IP machines, say Y to the Ethertap or Slip 232 - transports. You'll need at least one of them, but may choose 233 - more than one without conflict. If you don't need UML networking, 234 - say N. 228 + If you'd like to set up a network with other UMLs on a single host, 229 + say Y. If you need a network between UMLs on multiple physical 230 + hosts, choose the Multicast Transport. To set up a network with 231 + the host and/or other IP machines, say Y to the Ethertap or Slip 232 + transports. You'll need at least one of them, but may choose 233 + more than one without conflict. If you don't need UML networking, 234 + say N. 235 235 236 236 config UML_NET_VECTOR 237 237 bool "Vector I/O high performance network devices" ··· 270 270 bool "Multicast transport" 271 271 depends on UML_NET 272 272 help 273 - This Multicast User-Mode Linux network transport allows multiple 274 - UMLs (even ones running on different host machines!) to talk to 275 - each other over a virtual ethernet network. However, it requires 276 - at least one UML with one of the other transports to act as a 277 - bridge if any of them need to be able to talk to their hosts or any 278 - other IP machines. 273 + This Multicast User-Mode Linux network transport allows multiple 274 + UMLs (even ones running on different host machines!) to talk to 275 + each other over a virtual ethernet network. However, it requires 276 + at least one UML with one of the other transports to act as a 277 + bridge if any of them need to be able to talk to their hosts or any 278 + other IP machines. 279 279 280 - To use this, your host kernel(s) must support IP Multicasting. 280 + To use this, your host kernel(s) must support IP Multicasting. 281 281 282 - For more information, see 283 - <http://user-mode-linux.sourceforge.net/old/networking.html> That site 284 - has examples of the UML command line to use to enable Multicast 285 - networking, and notes about the security of this approach. 282 + For more information, see 283 + <http://user-mode-linux.sourceforge.net/old/networking.html> That site 284 + has examples of the UML command line to use to enable Multicast 285 + networking, and notes about the security of this approach. 286 286 287 - If you need UMLs on multiple physical hosts to communicate as if 288 - they shared an Ethernet network, say Y. If you need to communicate 289 - with other IP machines, make sure you select one of the other 290 - transports (possibly in addition to Multicast; they're not 291 - exclusive). If you don't need to network UMLs say N to each of 292 - the transports. 287 + If you need UMLs on multiple physical hosts to communicate as if 288 + they shared an Ethernet network, say Y. If you need to communicate 289 + with other IP machines, make sure you select one of the other 290 + transports (possibly in addition to Multicast; they're not 291 + exclusive). If you don't need to network UMLs say N to each of 292 + the transports. 293 293 294 294 config UML_NET_PCAP 295 295 bool "pcap transport" ··· 300 300 UML act as a network monitor for the host. You must have libcap 301 301 installed in order to build the pcap transport into UML. 302 302 303 - For more information, see 304 - <http://user-mode-linux.sourceforge.net/old/networking.html> That site 305 - has examples of the UML command line to use to enable this option. 303 + For more information, see 304 + <http://user-mode-linux.sourceforge.net/old/networking.html> That site 305 + has examples of the UML command line to use to enable this option. 306 306 307 307 If you intend to use UML as a network monitor for the host, say 308 308 Y here. Otherwise, say N. ··· 311 311 bool "SLiRP transport" 312 312 depends on UML_NET 313 313 help 314 - The SLiRP User-Mode Linux network transport allows a running UML 315 - to network by invoking a program that can handle SLIP encapsulated 316 - packets. This is commonly (but not limited to) the application 317 - known as SLiRP, a program that can re-socket IP packets back onto 318 - the host on which it is run. Only IP packets are supported, 319 - unlike other network transports that can handle all Ethernet 320 - frames. In general, slirp allows the UML the same IP connectivity 321 - to the outside world that the host user is permitted, and unlike 322 - other transports, SLiRP works without the need of root level 323 - privleges, setuid binaries, or SLIP devices on the host. This 324 - also means not every type of connection is possible, but most 325 - situations can be accommodated with carefully crafted slirp 326 - commands that can be passed along as part of the network device's 327 - setup string. The effect of this transport on the UML is similar 328 - that of a host behind a firewall that masquerades all network 329 - connections passing through it (but is less secure). 314 + The SLiRP User-Mode Linux network transport allows a running UML 315 + to network by invoking a program that can handle SLIP encapsulated 316 + packets. This is commonly (but not limited to) the application 317 + known as SLiRP, a program that can re-socket IP packets back onto 318 + he host on which it is run. Only IP packets are supported, 319 + unlike other network transports that can handle all Ethernet 320 + frames. In general, slirp allows the UML the same IP connectivity 321 + to the outside world that the host user is permitted, and unlike 322 + other transports, SLiRP works without the need of root level 323 + privleges, setuid binaries, or SLIP devices on the host. This 324 + also means not every type of connection is possible, but most 325 + situations can be accommodated with carefully crafted slirp 326 + commands that can be passed along as part of the network device's 327 + setup string. The effect of this transport on the UML is similar 328 + that of a host behind a firewall that masquerades all network 329 + connections passing through it (but is less secure). 330 330 331 - To use this you should first have slirp compiled somewhere 332 - accessible on the host, and have read its documentation. If you 333 - don't need UML networking, say N. 331 + To use this you should first have slirp compiled somewhere 332 + accessible on the host, and have read its documentation. If you 333 + don't need UML networking, say N. 334 334 335 - Startup example: "eth0=slirp,FE:FD:01:02:03:04,/usr/local/bin/slirp" 335 + Startup example: "eth0=slirp,FE:FD:01:02:03:04,/usr/local/bin/slirp" 336 336 337 337 endmenu
+2 -2
arch/um/drivers/ubd_kern.c
··· 276 276 str++; 277 277 if(!strcmp(str, "sync")){ 278 278 global_openflags = of_sync(global_openflags); 279 - goto out1; 279 + return err; 280 280 } 281 281 282 282 err = -EINVAL; 283 283 major = simple_strtoul(str, &end, 0); 284 284 if((*end != '\0') || (end == str)){ 285 285 *error_out = "Didn't parse major number"; 286 - goto out1; 286 + return err; 287 287 } 288 288 289 289 mutex_lock(&ubd_lock);
+6 -1
arch/um/include/asm/pgtable.h
··· 263 263 *pteptr = pte_mknewpage(*pteptr); 264 264 if(pte_present(*pteptr)) *pteptr = pte_mknewprot(*pteptr); 265 265 } 266 - #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval) 266 + 267 + static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, 268 + pte_t *pteptr, pte_t pteval) 269 + { 270 + set_pte(pteptr, pteval); 271 + } 267 272 268 273 #define __HAVE_ARCH_PTE_SAME 269 274 static inline int pte_same(pte_t pte_a, pte_t pte_b)
+1 -1
arch/um/kernel/irq.c
··· 479 479 irq_set_chip_and_handler(TIMER_IRQ, &SIGVTALRM_irq_type, handle_edge_irq); 480 480 481 481 482 - for (i = 1; i < NR_IRQS; i++) 482 + for (i = 1; i < LAST_IRQ; i++) 483 483 irq_set_chip_and_handler(i, &normal_irq_type, handle_edge_irq); 484 484 /* Initialize EPOLL Loop */ 485 485 os_setup_epoll();
-1
arch/um/kernel/skas/uaccess.c
··· 59 59 static int do_op_one_page(unsigned long addr, int len, int is_write, 60 60 int (*op)(unsigned long addr, int len, void *arg), void *arg) 61 61 { 62 - jmp_buf buf; 63 62 struct page *page; 64 63 pte_t *pte; 65 64 int n;
+1 -1
arch/um/kernel/time.c
··· 56 56 static struct clock_event_device timer_clockevent = { 57 57 .name = "posix-timer", 58 58 .rating = 250, 59 - .cpumask = cpu_all_mask, 59 + .cpumask = cpu_possible_mask, 60 60 .features = CLOCK_EVT_FEAT_PERIODIC | 61 61 CLOCK_EVT_FEAT_ONESHOT, 62 62 .set_state_shutdown = itimer_shutdown,
+8 -20
arch/um/os-Linux/signal.c
··· 31 31 32 32 static void sig_handler_common(int sig, struct siginfo *si, mcontext_t *mc) 33 33 { 34 - struct uml_pt_regs *r; 34 + struct uml_pt_regs r; 35 35 int save_errno = errno; 36 36 37 - r = uml_kmalloc(sizeof(struct uml_pt_regs), UM_GFP_ATOMIC); 38 - if (!r) 39 - panic("out of memory"); 40 - 41 - r->is_user = 0; 37 + r.is_user = 0; 42 38 if (sig == SIGSEGV) { 43 39 /* For segfaults, we want the data from the sigcontext. */ 44 - get_regs_from_mc(r, mc); 45 - GET_FAULTINFO_FROM_MC(r->faultinfo, mc); 40 + get_regs_from_mc(&r, mc); 41 + GET_FAULTINFO_FROM_MC(r.faultinfo, mc); 46 42 } 47 43 48 44 /* enable signals if sig isn't IRQ signal */ 49 45 if ((sig != SIGIO) && (sig != SIGWINCH) && (sig != SIGALRM)) 50 46 unblock_signals(); 51 47 52 - (*sig_info[sig])(sig, si, r); 48 + (*sig_info[sig])(sig, si, &r); 53 49 54 50 errno = save_errno; 55 - 56 - free(r); 57 51 } 58 52 59 53 /* ··· 85 91 86 92 static void timer_real_alarm_handler(mcontext_t *mc) 87 93 { 88 - struct uml_pt_regs *regs; 89 - 90 - regs = uml_kmalloc(sizeof(struct uml_pt_regs), UM_GFP_ATOMIC); 91 - if (!regs) 92 - panic("out of memory"); 94 + struct uml_pt_regs regs; 93 95 94 96 if (mc != NULL) 95 - get_regs_from_mc(regs, mc); 96 - timer_handler(SIGALRM, NULL, regs); 97 - 98 - free(regs); 97 + get_regs_from_mc(&regs, mc); 98 + timer_handler(SIGALRM, NULL, &regs); 99 99 } 100 100 101 101 void timer_alarm_handler(int sig, struct siginfo *unused_si, mcontext_t *mc)
+27 -9
arch/um/os-Linux/umid.c
··· 135 135 */ 136 136 static inline int is_umdir_used(char *dir) 137 137 { 138 - char file[strlen(uml_dir) + UMID_LEN + sizeof("/pid\0")]; 139 - char pid[sizeof("nnnnn\0")], *end; 138 + char pid[sizeof("nnnnn\0")], *end, *file; 140 139 int dead, fd, p, n, err; 140 + size_t filelen; 141 141 142 - n = snprintf(file, sizeof(file), "%s/pid", dir); 143 - if (n >= sizeof(file)) { 142 + err = asprintf(&file, "%s/pid", dir); 143 + if (err < 0) 144 + return 0; 145 + 146 + filelen = strlen(file); 147 + 148 + n = snprintf(file, filelen, "%s/pid", dir); 149 + if (n >= filelen) { 144 150 printk(UM_KERN_ERR "is_umdir_used - pid filename too long\n"); 145 151 err = -E2BIG; 146 152 goto out; ··· 191 185 out_close: 192 186 close(fd); 193 187 out: 188 + free(file); 194 189 return 0; 195 190 } 196 191 ··· 217 210 218 211 static void __init create_pid_file(void) 219 212 { 220 - char file[strlen(uml_dir) + UMID_LEN + sizeof("/pid\0")]; 221 - char pid[sizeof("nnnnn\0")]; 213 + char pid[sizeof("nnnnn\0")], *file; 222 214 int fd, n; 223 215 224 - if (umid_file_name("pid", file, sizeof(file))) 216 + file = malloc(strlen(uml_dir) + UMID_LEN + sizeof("/pid\0")); 217 + if (!file) 225 218 return; 219 + 220 + if (umid_file_name("pid", file, sizeof(file))) 221 + goto out; 226 222 227 223 fd = open(file, O_RDWR | O_CREAT | O_EXCL, 0644); 228 224 if (fd < 0) { 229 225 printk(UM_KERN_ERR "Open of machine pid file \"%s\" failed: " 230 226 "%s\n", file, strerror(errno)); 231 - return; 227 + goto out; 232 228 } 233 229 234 230 snprintf(pid, sizeof(pid), "%d\n", getpid()); ··· 241 231 errno); 242 232 243 233 close(fd); 234 + out: 235 + free(file); 244 236 } 245 237 246 238 int __init set_umid(char *name) ··· 397 385 398 386 static void remove_umid_dir(void) 399 387 { 400 - char dir[strlen(uml_dir) + UMID_LEN + 1], err; 388 + char *dir, err; 389 + 390 + dir = malloc(strlen(uml_dir) + UMID_LEN + 1); 391 + if (!dir) 392 + return; 401 393 402 394 sprintf(dir, "%s%s", uml_dir, umid); 403 395 err = remove_files_and_dir(dir); 404 396 if (err) 405 397 os_warn("%s - remove_files_and_dir failed with err = %d\n", 406 398 __func__, err); 399 + 400 + free(dir); 407 401 } 408 402 409 403 __uml_exitcall(remove_umid_dir);
+1 -1
fs/hostfs/hostfs.h
··· 87 87 extern int hostfs_do_rmdir(const char *file); 88 88 extern int do_mknod(const char *file, int mode, unsigned int major, 89 89 unsigned int minor); 90 - extern int link_file(const char *from, const char *to); 90 + extern int link_file(const char *to, const char *from); 91 91 extern int hostfs_do_readlink(char *file, char *buf, int size); 92 92 extern int rename_file(char *from, char *to); 93 93 extern int rename2_file(char *from, char *to, unsigned int flags);