Skip to content

Commit

Permalink
Merge branch 'for-linus-4.12-rc1' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/rw/uml

Pull UML fixes from Richard Weinberger:
 "No new stuff, just fixes"

* 'for-linus-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
  um: Add missing NR_CPUS include
  um: Fix to call read_initrd after init_bootmem
  um: Include kbuild.h instead of duplicating its macros
  um: Fix PTRACE_POKEUSER on x86_64
  um: Set number of CPUs
  um: Fix _print_addr()
  • Loading branch information
torvalds committed May 13, 2017
2 parents 1251704 + ce45860 commit ec05901
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 19 deletions.
5 changes: 5 additions & 0 deletions arch/um/Kconfig.common
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,8 @@ config HZ
config SUBARCH
string
option env="SUBARCH"

config NR_CPUS
int
range 1 1
default 1
4 changes: 1 addition & 3 deletions arch/um/kernel/initrd.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
static char *initrd __initdata = NULL;
static int load_initrd(char *filename, void *buf, int size);

static int __init read_initrd(void)
int __init read_initrd(void)
{
void *area;
long long size;
Expand Down Expand Up @@ -46,8 +46,6 @@ static int __init read_initrd(void)
return 0;
}

__uml_postsetup(read_initrd);

static int __init uml_initrd_setup(char *line, int *add)
{
initrd = line;
Expand Down
6 changes: 2 additions & 4 deletions arch/um/kernel/sysrq.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@

static void _print_addr(void *data, unsigned long address, int reliable)
{
pr_info(" [<%08lx>]", address);
pr_cont(" %s", reliable ? "" : "? ");
print_symbol("%s", address);
pr_cont("\n");
pr_info(" [<%08lx>] %s%pF\n", address, reliable ? "" : "? ",
(void *)address);
}

static const struct stacktrace_ops stackops = {
Expand Down
6 changes: 6 additions & 0 deletions arch/um/kernel/um_arch.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,17 @@ int __init linux_main(int argc, char **argv)
return start_uml();
}

int __init __weak read_initrd(void)
{
return 0;
}

void __init setup_arch(char **cmdline_p)
{
stack_protections((unsigned long) &init_thread_info);
setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem);
mem_total_pages(physmem_size, iomem_size, highmem);
read_initrd();

paging_init();
strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
Expand Down
4 changes: 1 addition & 3 deletions arch/um/os-Linux/skas/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <registers.h>
#include <skas.h>
#include <sysdep/stub.h>
#include <linux/threads.h>

int is_skas_winch(int pid, int fd, void *data)
{
Expand Down Expand Up @@ -233,9 +234,6 @@ static int userspace_tramp(void *stack)
return 0;
}

/* Each element set once, and only accessed by a single processor anyway */
#undef NR_CPUS
#define NR_CPUS 1
int userspace_pid[NR_CPUS];

int start_userspace(unsigned long stub_stack)
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/um/ptrace_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ int poke_user(struct task_struct *child, long addr, long data)
else if ((addr >= offsetof(struct user, u_debugreg[0])) &&
(addr <= offsetof(struct user, u_debugreg[7]))) {
addr -= offsetof(struct user, u_debugreg[0]);
addr = addr >> 2;
addr = addr >> 3;
if ((addr == 4) || (addr == 5))
return -EIO;
child->thread.arch.debugregs[addr] = data;
Expand Down
9 changes: 1 addition & 8 deletions arch/x86/um/shared/sysdep/kernel-offsets.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@
#include <linux/sched.h>
#include <linux/elf.h>
#include <linux/crypto.h>
#include <linux/kbuild.h>
#include <asm/mman.h>

#define DEFINE(sym, val) \
asm volatile("\n->" #sym " %0 " #val : : "i" (val))

#define BLANK() asm volatile("\n->" : : )

#define OFFSET(sym, str, mem) \
DEFINE(sym, offsetof(struct str, mem));

void foo(void)
{
#include <common-offsets.h>
Expand Down

0 comments on commit ec05901

Please sign in to comment.