Skip to content

Commit ec05901

Browse files
committed
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()
2 parents 1251704 + ce45860 commit ec05901

File tree

7 files changed

+17
-19
lines changed

7 files changed

+17
-19
lines changed

arch/um/Kconfig.common

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,8 @@ config HZ
5757
config SUBARCH
5858
string
5959
option env="SUBARCH"
60+
61+
config NR_CPUS
62+
int
63+
range 1 1
64+
default 1

arch/um/kernel/initrd.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
static char *initrd __initdata = NULL;
1515
static int load_initrd(char *filename, void *buf, int size);
1616

17-
static int __init read_initrd(void)
17+
int __init read_initrd(void)
1818
{
1919
void *area;
2020
long long size;
@@ -46,8 +46,6 @@ static int __init read_initrd(void)
4646
return 0;
4747
}
4848

49-
__uml_postsetup(read_initrd);
50-
5149
static int __init uml_initrd_setup(char *line, int *add)
5250
{
5351
initrd = line;

arch/um/kernel/sysrq.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@
2020

2121
static void _print_addr(void *data, unsigned long address, int reliable)
2222
{
23-
pr_info(" [<%08lx>]", address);
24-
pr_cont(" %s", reliable ? "" : "? ");
25-
print_symbol("%s", address);
26-
pr_cont("\n");
23+
pr_info(" [<%08lx>] %s%pF\n", address, reliable ? "" : "? ",
24+
(void *)address);
2725
}
2826

2927
static const struct stacktrace_ops stackops = {

arch/um/kernel/um_arch.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,17 @@ int __init linux_main(int argc, char **argv)
338338
return start_uml();
339339
}
340340

341+
int __init __weak read_initrd(void)
342+
{
343+
return 0;
344+
}
345+
341346
void __init setup_arch(char **cmdline_p)
342347
{
343348
stack_protections((unsigned long) &init_thread_info);
344349
setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem);
345350
mem_total_pages(physmem_size, iomem_size, highmem);
351+
read_initrd();
346352

347353
paging_init();
348354
strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);

arch/um/os-Linux/skas/process.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <registers.h>
2222
#include <skas.h>
2323
#include <sysdep/stub.h>
24+
#include <linux/threads.h>
2425

2526
int is_skas_winch(int pid, int fd, void *data)
2627
{
@@ -233,9 +234,6 @@ static int userspace_tramp(void *stack)
233234
return 0;
234235
}
235236

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

241239
int start_userspace(unsigned long stub_stack)

arch/x86/um/ptrace_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ int poke_user(struct task_struct *child, long addr, long data)
125125
else if ((addr >= offsetof(struct user, u_debugreg[0])) &&
126126
(addr <= offsetof(struct user, u_debugreg[7]))) {
127127
addr -= offsetof(struct user, u_debugreg[0]);
128-
addr = addr >> 2;
128+
addr = addr >> 3;
129129
if ((addr == 4) || (addr == 5))
130130
return -EIO;
131131
child->thread.arch.debugregs[addr] = data;

arch/x86/um/shared/sysdep/kernel-offsets.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,9 @@
22
#include <linux/sched.h>
33
#include <linux/elf.h>
44
#include <linux/crypto.h>
5+
#include <linux/kbuild.h>
56
#include <asm/mman.h>
67

7-
#define DEFINE(sym, val) \
8-
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
9-
10-
#define BLANK() asm volatile("\n->" : : )
11-
12-
#define OFFSET(sym, str, mem) \
13-
DEFINE(sym, offsetof(struct str, mem));
14-
158
void foo(void)
169
{
1710
#include <common-offsets.h>

0 commit comments

Comments
 (0)