mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
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()
This commit is contained in:
commit
ec059019b7
7 changed files with 17 additions and 19 deletions
|
@ -57,3 +57,8 @@ config HZ
|
||||||
config SUBARCH
|
config SUBARCH
|
||||||
string
|
string
|
||||||
option env="SUBARCH"
|
option env="SUBARCH"
|
||||||
|
|
||||||
|
config NR_CPUS
|
||||||
|
int
|
||||||
|
range 1 1
|
||||||
|
default 1
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
static char *initrd __initdata = NULL;
|
static char *initrd __initdata = NULL;
|
||||||
static int load_initrd(char *filename, void *buf, int size);
|
static int load_initrd(char *filename, void *buf, int size);
|
||||||
|
|
||||||
static int __init read_initrd(void)
|
int __init read_initrd(void)
|
||||||
{
|
{
|
||||||
void *area;
|
void *area;
|
||||||
long long size;
|
long long size;
|
||||||
|
@ -46,8 +46,6 @@ static int __init read_initrd(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__uml_postsetup(read_initrd);
|
|
||||||
|
|
||||||
static int __init uml_initrd_setup(char *line, int *add)
|
static int __init uml_initrd_setup(char *line, int *add)
|
||||||
{
|
{
|
||||||
initrd = line;
|
initrd = line;
|
||||||
|
|
|
@ -20,10 +20,8 @@
|
||||||
|
|
||||||
static void _print_addr(void *data, unsigned long address, int reliable)
|
static void _print_addr(void *data, unsigned long address, int reliable)
|
||||||
{
|
{
|
||||||
pr_info(" [<%08lx>]", address);
|
pr_info(" [<%08lx>] %s%pF\n", address, reliable ? "" : "? ",
|
||||||
pr_cont(" %s", reliable ? "" : "? ");
|
(void *)address);
|
||||||
print_symbol("%s", address);
|
|
||||||
pr_cont("\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct stacktrace_ops stackops = {
|
static const struct stacktrace_ops stackops = {
|
||||||
|
|
|
@ -338,11 +338,17 @@ int __init linux_main(int argc, char **argv)
|
||||||
return start_uml();
|
return start_uml();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int __init __weak read_initrd(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void __init setup_arch(char **cmdline_p)
|
void __init setup_arch(char **cmdline_p)
|
||||||
{
|
{
|
||||||
stack_protections((unsigned long) &init_thread_info);
|
stack_protections((unsigned long) &init_thread_info);
|
||||||
setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem);
|
setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem);
|
||||||
mem_total_pages(physmem_size, iomem_size, highmem);
|
mem_total_pages(physmem_size, iomem_size, highmem);
|
||||||
|
read_initrd();
|
||||||
|
|
||||||
paging_init();
|
paging_init();
|
||||||
strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
|
strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <registers.h>
|
#include <registers.h>
|
||||||
#include <skas.h>
|
#include <skas.h>
|
||||||
#include <sysdep/stub.h>
|
#include <sysdep/stub.h>
|
||||||
|
#include <linux/threads.h>
|
||||||
|
|
||||||
int is_skas_winch(int pid, int fd, void *data)
|
int is_skas_winch(int pid, int fd, void *data)
|
||||||
{
|
{
|
||||||
|
@ -233,9 +234,6 @@ static int userspace_tramp(void *stack)
|
||||||
return 0;
|
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 userspace_pid[NR_CPUS];
|
||||||
|
|
||||||
int start_userspace(unsigned long stub_stack)
|
int start_userspace(unsigned long stub_stack)
|
||||||
|
|
|
@ -125,7 +125,7 @@ int poke_user(struct task_struct *child, long addr, long data)
|
||||||
else if ((addr >= offsetof(struct user, u_debugreg[0])) &&
|
else if ((addr >= offsetof(struct user, u_debugreg[0])) &&
|
||||||
(addr <= offsetof(struct user, u_debugreg[7]))) {
|
(addr <= offsetof(struct user, u_debugreg[7]))) {
|
||||||
addr -= offsetof(struct user, u_debugreg[0]);
|
addr -= offsetof(struct user, u_debugreg[0]);
|
||||||
addr = addr >> 2;
|
addr = addr >> 3;
|
||||||
if ((addr == 4) || (addr == 5))
|
if ((addr == 4) || (addr == 5))
|
||||||
return -EIO;
|
return -EIO;
|
||||||
child->thread.arch.debugregs[addr] = data;
|
child->thread.arch.debugregs[addr] = data;
|
||||||
|
|
|
@ -2,16 +2,9 @@
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/elf.h>
|
#include <linux/elf.h>
|
||||||
#include <linux/crypto.h>
|
#include <linux/crypto.h>
|
||||||
|
#include <linux/kbuild.h>
|
||||||
#include <asm/mman.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)
|
void foo(void)
|
||||||
{
|
{
|
||||||
#include <common-offsets.h>
|
#include <common-offsets.h>
|
||||||
|
|
Loading…
Add table
Reference in a new issue