Skip to content

Commit

Permalink
Merge tag 'for-linus-4.1' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/rw/uml

Pull UML updates from Richard Weinberger:
 - hostfs saw a face lifting
 - old/broken stuff was removed (SMP, HIGHMEM, SKAS3/4)
 - random cleanups and bug fixes

* tag 'for-linus-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml: (26 commits)
  um: Print minimum physical memory requirement
  um: Move uml_postsetup in the init_thread stack
  um: add a kmsg_dumper
  x86, UML: fix integer overflow in ELF_ET_DYN_BASE
  um: hostfs: Reduce number of syscalls in readdir
  um: Remove broken highmem support
  um: Remove broken SMP support
  um: Remove SKAS3/4 support
  um: Remove ppc cruft
  um: Remove ia64 cruft
  um: Remove dead code from stacktrace
  hostfs: No need to box and later unbox the file mode
  hostfs: Use page_offset()
  hostfs: Set page flags in hostfs_readpage() correctly
  hostfs: Remove superfluous initializations in hostfs_open()
  hostfs: hostfs_open: Reset open flags upon each retry
  hostfs: Remove superfluous test in hostfs_open()
  hostfs: Report append flag in ->show_options()
  hostfs: Use __getname() in follow_link
  hostfs: Remove open coded strcpy()
  ...
  • Loading branch information
torvalds committed Apr 15, 2015
2 parents d613896 + fe205bd commit e44740c
Show file tree
Hide file tree
Showing 59 changed files with 323 additions and 2,067 deletions.
42 changes: 0 additions & 42 deletions arch/um/Kconfig.um
Original file line number Diff line number Diff line change
Expand Up @@ -95,48 +95,6 @@ config MAGIC_SYSRQ
The keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
unless you really know what this hack does.

config SMP
bool "Symmetric multi-processing support"
default n
depends on BROKEN
help
This option enables UML SMP support.
It is NOT related to having a real SMP box. Not directly, at least.

UML implements virtual SMP by allowing as many processes to run
simultaneously on the host as there are virtual processors configured.

Obviously, if the host is a uniprocessor, those processes will
timeshare, but, inside UML, will appear to be running simultaneously.
If the host is a multiprocessor, then UML processes may run
simultaneously, depending on the host scheduler.

This, however, is supported only in TT mode. So, if you use the SKAS
patch on your host, switching to TT mode and enabling SMP usually
gives you worse performances.
Also, since the support for SMP has been under-developed, there could
be some bugs being exposed by enabling SMP.

If you don't know what to do, say N.

config NR_CPUS
int "Maximum number of CPUs (2-32)"
range 2 32
depends on SMP
default "32"

config HIGHMEM
bool "Highmem support"
depends on !64BIT && BROKEN
default n
help
This was used to allow UML to run with big amounts of memory.
Currently it is unstable, so if unsure say N.

To use big amounts of memory, it is recommended enable static
linking (i.e. CONFIG_STATIC_LINK) - this should allow the
guest to use up to 2.75G of memory.

config KERNEL_STACK_ORDER
int "Kernel stack size order"
default 1 if 64BIT
Expand Down
1 change: 0 additions & 1 deletion arch/um/Makefile-ia64

This file was deleted.

9 changes: 0 additions & 9 deletions arch/um/Makefile-ppc

This file was deleted.

4 changes: 0 additions & 4 deletions arch/um/include/asm/fixmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
* fix-mapped?
*/
enum fixed_addresses {
#ifdef CONFIG_HIGHMEM
FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
#endif
__end_of_fixed_addresses
};

Expand Down
6 changes: 1 addition & 5 deletions arch/um/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,7 @@ extern unsigned long end_iomem;
#define VMALLOC_OFFSET (__va_space)
#define VMALLOC_START ((end_iomem + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
#define PKMAP_BASE ((FIXADDR_START - LAST_PKMAP * PAGE_SIZE) & PMD_MASK)
#ifdef CONFIG_HIGHMEM
# define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE)
#else
# define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE)
#endif
#define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE)
#define MODULES_VADDR VMALLOC_START
#define MODULES_END VMALLOC_END
#define MODULES_LEN (MODULES_VADDR - MODULES_END)
Expand Down
8 changes: 0 additions & 8 deletions arch/um/include/asm/processor-generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,8 @@ struct cpuinfo_um {

extern struct cpuinfo_um boot_cpu_data;

#define my_cpu_data cpu_data[smp_processor_id()]

#ifdef CONFIG_SMP
extern struct cpuinfo_um cpu_data[];
#define current_cpu_data cpu_data[smp_processor_id()]
#else
#define cpu_data (&boot_cpu_data)
#define current_cpu_data boot_cpu_data
#endif


#define KSTK_REG(tsk, reg) get_thread_reg(reg, &tsk->thread.switch_buf)
extern unsigned long get_wchan(struct task_struct *p);
Expand Down
26 changes: 0 additions & 26 deletions arch/um/include/asm/smp.h
Original file line number Diff line number Diff line change
@@ -1,32 +1,6 @@
#ifndef __UM_SMP_H
#define __UM_SMP_H

#ifdef CONFIG_SMP

#include <linux/bitops.h>
#include <asm/current.h>
#include <linux/cpumask.h>

#define raw_smp_processor_id() (current_thread->cpu)

#define cpu_logical_map(n) (n)
#define cpu_number_map(n) (n)
extern int hard_smp_processor_id(void);
#define NO_PROC_ID -1

extern int ncpus;


static inline void smp_cpus_done(unsigned int maxcpus)
{
}

extern struct task_struct *idle_threads[NR_CPUS];

#else

#define hard_smp_processor_id() 0

#endif

#endif
1 change: 1 addition & 0 deletions arch/um/include/shared/as-layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ extern unsigned long brk_start;
extern unsigned long host_task_size;

extern int linux_main(int argc, char **argv);
extern void uml_finishsetup(void);

struct siginfo;
extern void (*sig_info[])(int, struct siginfo *si, struct uml_pt_regs *);
Expand Down
2 changes: 0 additions & 2 deletions arch/um/include/shared/os.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ extern unsigned long long os_makedev(unsigned major, unsigned minor);

/* start_up.c */
extern void os_early_checks(void);
extern void can_do_skas(void);
extern void os_check_bugs(void);
extern void check_host_supports_tls(int *supports_tls, int *tls_min);

Expand All @@ -187,7 +186,6 @@ extern int os_process_parent(int pid);
extern void os_stop_process(int pid);
extern void os_kill_process(int pid, int reap_child);
extern void os_kill_ptraced_process(int pid, int reap_child);
extern long os_ptrace_ldt(long pid, long addr, long data);

extern int os_getpid(void);
extern int os_getpgrp(void);
Expand Down
44 changes: 0 additions & 44 deletions arch/um/include/shared/skas/proc_mm.h

This file was deleted.

3 changes: 0 additions & 3 deletions arch/um/include/shared/skas/skas.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@
#include <sysdep/ptrace.h>

extern int userspace_pid[];
extern int proc_mm, ptrace_faultinfo, ptrace_ldt;
extern int skas_needs_stub;

extern int user_thread(unsigned long stack, int flags);
extern void new_thread_handler(void);
extern void handle_syscall(struct uml_pt_regs *regs);
extern int new_mm(unsigned long stack);
extern long execute_syscall_skas(void *r);
extern unsigned long current_stub_stack(void);

Expand Down
14 changes: 0 additions & 14 deletions arch/um/include/shared/skas_ptrace.h

This file was deleted.

4 changes: 2 additions & 2 deletions arch/um/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ clean-files :=

obj-y = config.o exec.o exitcode.o irq.o ksyms.o mem.o \
physmem.o process.o ptrace.o reboot.o sigio.o \
signal.o smp.o syscall.o sysrq.o time.o tlb.o trap.o \
um_arch.o umid.o maccess.o skas/
signal.o syscall.o sysrq.o time.o tlb.o trap.o \
um_arch.o umid.o maccess.o kmsg_dump.o skas/

obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o
obj-$(CONFIG_GPROF) += gprof_syms.o
Expand Down
3 changes: 0 additions & 3 deletions arch/um/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ void sigio_handler(int sig, struct siginfo *unused_si, struct uml_pt_regs *regs)
struct irq_fd *irq_fd;
int n;

if (smp_sigio_handler())
return;

while (1) {
n = os_waiting_for_events(active_fds);
if (n <= 0) {
Expand Down
43 changes: 43 additions & 0 deletions arch/um/kernel/kmsg_dump.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#include <linux/kmsg_dump.h>
#include <linux/console.h>
#include <shared/init.h>
#include <shared/kern.h>
#include <os.h>

static void kmsg_dumper_stdout(struct kmsg_dumper *dumper,
enum kmsg_dump_reason reason)
{
static char line[1024];

size_t len = 0;
bool con_available = false;

/* only dump kmsg when no console is available */
if (!console_trylock())
return;

if (console_drivers != NULL)
con_available = true;

console_unlock();

if (con_available == true)
return;

printf("kmsg_dump:\n");
while (kmsg_dump_get_line(dumper, true, line, sizeof(line), &len)) {
line[len] = '\0';
printf("%s", line);
}
}

static struct kmsg_dumper kmsg_dumper = {
.dump = kmsg_dumper_stdout
};

int __init kmsg_dumper_stdout_init(void)
{
return kmsg_dump_register(&kmsg_dumper);
}

__uml_postsetup(kmsg_dumper_stdout_init);
66 changes: 0 additions & 66 deletions arch/um/kernel/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,6 @@ int kmalloc_ok = 0;
/* Used during early boot */
static unsigned long brk_end;

#ifdef CONFIG_HIGHMEM
static void setup_highmem(unsigned long highmem_start,
unsigned long highmem_len)
{
unsigned long highmem_pfn;
int i;

highmem_pfn = __pa(highmem_start) >> PAGE_SHIFT;
for (i = 0; i < highmem_len >> PAGE_SHIFT; i++)
free_highmem_page(&mem_map[highmem_pfn + i]);
}
#endif

void __init mem_init(void)
{
/* clear the zero-page */
Expand All @@ -67,9 +54,6 @@ void __init mem_init(void)
/* this will put all low memory onto the freelists */
free_all_bootmem();
max_low_pfn = totalram_pages;
#ifdef CONFIG_HIGHMEM
setup_highmem(end_iomem, highmem);
#endif
max_pfn = totalram_pages;
mem_init_print_info(NULL);
kmalloc_ok = 1;
Expand Down Expand Up @@ -127,49 +111,6 @@ static void __init fixrange_init(unsigned long start, unsigned long end,
}
}

#ifdef CONFIG_HIGHMEM
pte_t *kmap_pte;
pgprot_t kmap_prot;

#define kmap_get_fixmap_pte(vaddr) \
pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), (vaddr)),\
(vaddr)), (vaddr))

static void __init kmap_init(void)
{
unsigned long kmap_vstart;

/* cache the first kmap pte */
kmap_vstart = __fix_to_virt(FIX_KMAP_BEGIN);
kmap_pte = kmap_get_fixmap_pte(kmap_vstart);

kmap_prot = PAGE_KERNEL;
}

static void __init init_highmem(void)
{
pgd_t *pgd;
pud_t *pud;
pmd_t *pmd;
pte_t *pte;
unsigned long vaddr;

/*
* Permanent kmaps:
*/
vaddr = PKMAP_BASE;
fixrange_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, swapper_pg_dir);

pgd = swapper_pg_dir + pgd_index(vaddr);
pud = pud_offset(pgd, vaddr);
pmd = pmd_offset(pud, vaddr);
pte = pte_offset_kernel(pmd, vaddr);
pkmap_page_table = pte;

kmap_init();
}
#endif /* CONFIG_HIGHMEM */

static void __init fixaddr_user_init( void)
{
#ifdef CONFIG_ARCH_REUSE_HOST_VSYSCALL_AREA
Expand Down Expand Up @@ -211,9 +152,6 @@ void __init paging_init(void)

zones_size[ZONE_NORMAL] = (end_iomem >> PAGE_SHIFT) -
(uml_physmem >> PAGE_SHIFT);
#ifdef CONFIG_HIGHMEM
zones_size[ZONE_HIGHMEM] = highmem >> PAGE_SHIFT;
#endif
free_area_init(zones_size);

/*
Expand All @@ -224,10 +162,6 @@ void __init paging_init(void)
fixrange_init(vaddr, FIXADDR_TOP, swapper_pg_dir);

fixaddr_user_init();

#ifdef CONFIG_HIGHMEM
init_highmem();
#endif
}

/*
Expand Down
Loading

0 comments on commit e44740c

Please sign in to comment.