1
0
Fork 0

Merge branch 'for-linus-4.12-rc1' of git://git.kernel.org/pub/scm/linux/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()
zero-colors
Linus Torvalds 2017-05-13 10:20:02 -07:00
commit ec059019b7
7 changed files with 17 additions and 19 deletions

View File

@ -57,3 +57,8 @@ config HZ
config SUBARCH
string
option env="SUBARCH"
config NR_CPUS
int
range 1 1
default 1

View File

@ -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;
@ -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;

View File

@ -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 = {

View File

@ -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);

View File

@ -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)
{
@ -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)

View File

@ -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;

View File

@ -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>