Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://github.com/richardweinberger/linux
Browse files Browse the repository at this point in the history
* 'for-linus' of git://github.com/richardweinberger/linux: (90 commits)
  um: fix ubd cow size
  um: Fix kmalloc argument order in um/vdso/vma.c
  um: switch to use of drivers/Kconfig
  UserModeLinux-HOWTO.txt: fix a typo
  UserModeLinux-HOWTO.txt: remove ^H characters
  um: we need sys/user.h only on i386
  um: merge delay_{32,64}.c
  um: distribute exports to where exported stuff is defined
  um: kill system-um.h
  um: generic ftrace.h will do...
  um: segment.h is x86-only and needed only there
  um: asm/pda.h is not needed anymore
  um: hw_irq.h can go generic as well
  um: switch to generic-y
  um: clean Kconfig up a bit
  um: a couple of missing dependencies...
  um: kill useless argument of free_chan() and free_one_chan()
  um: unify ptrace_user.h
  um: unify KSTK_...
  um: fix gcov build breakage
  ...
  • Loading branch information
torvalds committed Nov 2, 2011
2 parents 994c0e9 + 8535639 commit de0a534
Show file tree
Hide file tree
Showing 253 changed files with 1,666 additions and 3,326 deletions.
532 changes: 266 additions & 266 deletions Documentation/virtual/uml/UserModeLinux-HOWTO.txt

Large diffs are not rendered by default.

114 changes: 1 addition & 113 deletions arch/um/Kconfig.char
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

menu "Character Devices"
menu "UML Character Devices"

config STDERR_CONSOLE
bool "stderr console"
Expand Down Expand Up @@ -105,92 +104,6 @@ config SSL_CHAN
this if you expect the UML that you build to be run in environments
which don't have a set of /dev/pty* devices.

config UNIX98_PTYS
bool "Unix98 PTY support"
help
A pseudo terminal (PTY) is a software device consisting of two
halves: a master and a slave. The slave device behaves identical to
a physical terminal; the master device is used by a process to
read data from and write data to the slave, thereby emulating a
terminal. Typical programs for the master side are telnet servers
and xterms.

Linux has traditionally used the BSD-like names /dev/ptyxx for
masters and /dev/ttyxx for slaves of pseudo terminals. This scheme
has a number of problems. The GNU C library glibc 2.1 and later,
however, supports the Unix98 naming standard: in order to acquire a
pseudo terminal, a process opens /dev/ptmx; the number of the pseudo
terminal is then made available to the process and the pseudo
terminal slave can be accessed as /dev/pts/<number>. What was
traditionally /dev/ttyp2 will then be /dev/pts/2, for example.

All modern Linux systems use the Unix98 ptys. Say Y unless
you're on an embedded system and want to conserve memory.

config LEGACY_PTYS
bool "Legacy (BSD) PTY support"
default y
help
A pseudo terminal (PTY) is a software device consisting of two
halves: a master and a slave. The slave device behaves identical to
a physical terminal; the master device is used by a process to
read data from and write data to the slave, thereby emulating a
terminal. Typical programs for the master side are telnet servers
and xterms.

Linux has traditionally used the BSD-like names /dev/ptyxx
for masters and /dev/ttyxx for slaves of pseudo
terminals. This scheme has a number of problems, including
security. This option enables these legacy devices; on most
systems, it is safe to say N.

config RAW_DRIVER
tristate "RAW driver (/dev/raw/rawN)"
depends on BLOCK
help
The raw driver permits block devices to be bound to /dev/raw/rawN.
Once bound, I/O against /dev/raw/rawN uses efficient zero-copy I/O.
See the raw(8) manpage for more details.

Applications should preferably open the device (eg /dev/hda1)
with the O_DIRECT flag.

config MAX_RAW_DEVS
int "Maximum number of RAW devices to support (1-8192)"
depends on RAW_DRIVER
default "256"
help
The maximum number of RAW devices that are supported.
Default is 256. Increase this number in case you need lots of
raw devices.

config LEGACY_PTY_COUNT
int "Maximum number of legacy PTY in use"
depends on LEGACY_PTYS
default "256"
help
The maximum number of legacy PTYs that can be used at any one time.
The default is 256, and should be more than enough. Embedded
systems may want to reduce this to save memory.

When not in use, each legacy PTY occupies 12 bytes on 32-bit
architectures and 24 bytes on 64-bit architectures.

config WATCHDOG
bool "Watchdog Timer Support"

config WATCHDOG_NOWAYOUT
bool "Disable watchdog shutdown on close"
depends on WATCHDOG

config SOFT_WATCHDOG
tristate "Software Watchdog"
depends on WATCHDOG

config UML_WATCHDOG
tristate "UML watchdog"
depends on WATCHDOG

config UML_SOUND
tristate "Sound support"
help
Expand All @@ -211,29 +124,4 @@ config HOSTAUDIO
tristate
default UML_SOUND

#It is selected elsewhere, so kconfig would warn without this.
config HW_RANDOM
tristate
default n

config UML_RANDOM
tristate "Hardware random number generator"
help
This option enables UML's "hardware" random number generator. It
attaches itself to the host's /dev/random, supplying as much entropy
as the host has, rather than the small amount the UML gets from its
own drivers. It registers itself as a standard hardware random number
generator, major 10, minor 183, and the canonical device name is
/dev/hwrng.
The way to make use of this is to install the rng-tools package
(check your distro, or download from
http://sourceforge.net/projects/gkernel/). rngd periodically reads
/dev/hwrng and injects the entropy into /dev/random.

config MMAPPER
tristate "iomem emulation driver"
help
This driver allows a host file to be used as emulated IO memory inside
UML.

endmenu
23 changes: 1 addition & 22 deletions arch/um/Kconfig.rest
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,14 @@ source "init/Kconfig"

source "kernel/Kconfig.freezer"

source "drivers/block/Kconfig"

source "arch/um/Kconfig.char"

source "drivers/base/Kconfig"
source "drivers/Kconfig"

source "net/Kconfig"

source "arch/um/Kconfig.net"

source "drivers/net/Kconfig"

source "drivers/connector/Kconfig"

source "fs/Kconfig"

source "security/Kconfig"
Expand All @@ -24,19 +18,4 @@ source "crypto/Kconfig"

source "lib/Kconfig"

source "drivers/scsi/Kconfig"

source "drivers/md/Kconfig"

if BROKEN
source "drivers/mtd/Kconfig"
endif

source "drivers/leds/Kconfig"

#This is just to shut up some Kconfig warnings, so no prompt.
config INPUT
tristate
default n

source "arch/um/Kconfig.debug"
6 changes: 6 additions & 0 deletions arch/um/Kconfig.um
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,11 @@ config KERNEL_STACK_ORDER
be 1 << order pages. The default is OK unless you're running Valgrind
on UML, in which case, set this to 3.

config MMAPPER
tristate "iomem emulation driver"
help
This driver allows a host file to be used as emulated IO memory inside
UML.

config NO_DMA
def_bool y
49 changes: 26 additions & 23 deletions arch/um/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,27 @@ core-y += $(ARCH_DIR)/kernel/ \

MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include/shared/skas

HEADER_ARCH := $(SUBARCH)

# Additional ARCH settings for x86
ifeq ($(SUBARCH),i386)
HEADER_ARCH := x86
endif
ifeq ($(SUBARCH),x86_64)
HEADER_ARCH := x86
endif

HOST_DIR := arch/$(HEADER_ARCH)

include $(srctree)/$(ARCH_DIR)/Makefile-skas
include $(srctree)/$(HOST_DIR)/Makefile.um

core-y += $(HOST_DIR)/um/

SHARED_HEADERS := $(ARCH_DIR)/include/shared
ARCH_INCLUDE := -I$(srctree)/$(SHARED_HEADERS)
ARCH_INCLUDE += -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH)/shared
ifneq ($(KBUILD_SRC),)
ARCH_INCLUDE += -I$(SHARED_HEADERS)
endif
KBUILD_CPPFLAGS += -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH)
ARCH_INCLUDE += -I$(srctree)/$(HOST_DIR)/um/shared
KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/um

# -Dvmap=kernel_vmap prevents anything from referencing the libpcap.o symbol so
# named - it's a common symbol in libpcap, so we get a binary which crashes.
Expand All @@ -47,14 +59,12 @@ KBUILD_AFLAGS += $(ARCH_INCLUDE)

USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\
$(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \
$(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64

include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
$(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64 -idirafter include

#This will adjust *FLAGS accordingly to the platform.
include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)

KBUILD_CPPFLAGS += -I$(srctree)/arch/$(HEADER_ARCH)/include
KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/include

# -Derrno=kernel_errno - This turns all kernel references to errno into
# kernel_errno to separate them from the libc errno. This allows -fno-common
Expand Down Expand Up @@ -84,10 +94,9 @@ define archhelp
echo ' find in the kernel root.'
endef

KBUILD_KCONFIG := arch/um/Kconfig.$(HEADER_ARCH)
KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig

archprepare: $(SHARED_HEADERS)/user_constants.h
archprepare: $(SHARED_HEADERS)/kern_constants.h
archprepare: include/generated/user_constants.h

LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib
Expand Down Expand Up @@ -118,18 +127,16 @@ endef

# When cleaning we don't include .config, so we don't include
# TT or skas makefiles and don't clean skas_ptregs.h.
CLEAN_FILES += linux x.i gmon.out \
$(SHARED_HEADERS)/user_constants.h \
$(SHARED_HEADERS)/kern_constants.h
CLEAN_FILES += linux x.i gmon.out

archclean:
@find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \
-o -name '*.gcov' \) -type f -print | xargs rm -f

# Generated files

$(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s: FORCE
$(Q)$(MAKE) $(build)=$(ARCH_DIR)/sys-$(SUBARCH) $@
$(HOST_DIR)/um/user-offsets.s: FORCE
$(Q)$(MAKE) $(build)=$(HOST_DIR)/um $@

define filechk_gen-asm-offsets
(set -e; \
Expand All @@ -144,11 +151,7 @@ define filechk_gen-asm-offsets
echo ""; )
endef

$(SHARED_HEADERS)/user_constants.h: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s
include/generated/user_constants.h: $(HOST_DIR)/um/user-offsets.s
$(call filechk,gen-asm-offsets)

$(SHARED_HEADERS)/kern_constants.h:
$(Q)mkdir -p $(dir $@)
$(Q)echo '#include "../../../../include/generated/asm-offsets.h"' >$@

export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS HEADER_ARCH DEV_NULL_PATH
export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS DEV_NULL_PATH
26 changes: 0 additions & 26 deletions arch/um/Makefile-x86_64

This file was deleted.

6 changes: 3 additions & 3 deletions arch/um/include/shared/chan_kern.h → arch/um/drivers/chan.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#ifndef __CHAN_KERN_H__
#define __CHAN_KERN_H__

#include "linux/tty.h"
#include "linux/list.h"
#include "linux/console.h"
#include <linux/tty.h>
#include <linux/list.h>
#include <linux/console.h>
#include "chan_user.h"
#include "line.h"

Expand Down
12 changes: 6 additions & 6 deletions arch/um/drivers/chan_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <linux/slab.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include "chan_kern.h"
#include "chan.h"
#include "os.h"

#ifdef CONFIG_NOCONFIG_CHAN
Expand Down Expand Up @@ -358,11 +358,11 @@ int chan_window_size(struct list_head *chans, unsigned short *rows_out,
return 0;
}

static void free_one_chan(struct chan *chan, int delay_free_irq)
static void free_one_chan(struct chan *chan)
{
list_del(&chan->list);

close_one_chan(chan, delay_free_irq);
close_one_chan(chan, 0);

if (chan->ops->free != NULL)
(*chan->ops->free)(chan->data);
Expand All @@ -372,14 +372,14 @@ static void free_one_chan(struct chan *chan, int delay_free_irq)
kfree(chan);
}

static void free_chan(struct list_head *chans, int delay_free_irq)
static void free_chan(struct list_head *chans)
{
struct list_head *ele, *next;
struct chan *chan;

list_for_each_safe(ele, next, chans) {
chan = list_entry(ele, struct chan, list);
free_one_chan(chan, delay_free_irq);
free_one_chan(chan);
}
}

Expand Down Expand Up @@ -547,7 +547,7 @@ int parse_chan_pair(char *str, struct line *line, int device,
char *in, *out;

if (!list_empty(chans)) {
free_chan(chans, 0);
free_chan(chans);
INIT_LIST_HEAD(chans);
}

Expand Down
9 changes: 6 additions & 3 deletions arch/um/drivers/chan_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
#include <termios.h>
#include <sys/ioctl.h>
#include "chan_user.h"
#include "kern_constants.h"
#include "os.h"
#include "um_malloc.h"
#include "user.h"

void generic_close(int fd, void *unused)
{
Expand Down Expand Up @@ -283,7 +281,12 @@ void register_winch(int fd, struct tty_struct *tty)
return;

pid = tcgetpgrp(fd);
if (!is_skas_winch(pid, fd, tty) && (pid == -1)) {
if (is_skas_winch(pid, fd, tty)) {
register_winch_irq(-1, fd, -1, tty, 0);
return;
}

if (pid == -1) {
thread = winch_tramp(fd, tty, &thread_fd, &stack);
if (thread < 0)
return;
Expand Down
File renamed without changes.
Loading

0 comments on commit de0a534

Please sign in to comment.