diff options
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/Makefile | 4 | ||||
-rw-r--r-- | arch/mips/kernel/asm-offsets.c | 66 | ||||
-rw-r--r-- | arch/mips/kernel/binfmt_elfo32.c | 4 | ||||
-rw-r--r-- | arch/mips/kernel/cevt-r4k.c | 4 | ||||
-rw-r--r-- | arch/mips/kernel/mips_machine.c | 22 | ||||
-rw-r--r-- | arch/mips/kernel/proc.c | 2 | ||||
-rw-r--r-- | arch/mips/kernel/prom.c | 33 | ||||
-rw-r--r-- | arch/mips/kernel/setup.c | 22 | ||||
-rw-r--r-- | arch/mips/kernel/smp.c | 1 | ||||
-rw-r--r-- | arch/mips/kernel/traps.c | 20 |
10 files changed, 146 insertions, 32 deletions
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile index 3d95062173c7..cb96ace5c8c5 100644 --- a/arch/mips/kernel/Makefile +++ b/arch/mips/kernel/Makefile | |||
@@ -5,7 +5,7 @@ | |||
5 | extra-y := head.o vmlinux.lds | 5 | extra-y := head.o vmlinux.lds |
6 | 6 | ||
7 | obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \ | 7 | obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \ |
8 | ptrace.o reset.o setup.o signal.o syscall.o \ | 8 | prom.o ptrace.o reset.o setup.o signal.o syscall.o \ |
9 | time.o topology.o traps.o unaligned.o watch.o vdso.o | 9 | time.o topology.o traps.o unaligned.o watch.o vdso.o |
10 | 10 | ||
11 | ifdef CONFIG_FUNCTION_TRACER | 11 | ifdef CONFIG_FUNCTION_TRACER |
@@ -87,8 +87,6 @@ obj-$(CONFIG_EARLY_PRINTK) += early_printk.o | |||
87 | obj-$(CONFIG_SPINLOCK_TEST) += spinlock_test.o | 87 | obj-$(CONFIG_SPINLOCK_TEST) += spinlock_test.o |
88 | obj-$(CONFIG_MIPS_MACHINE) += mips_machine.o | 88 | obj-$(CONFIG_MIPS_MACHINE) += mips_machine.o |
89 | 89 | ||
90 | obj-$(CONFIG_OF) += prom.o | ||
91 | |||
92 | CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(KBUILD_CFLAGS) -Wa,-mdaddi -c -o /dev/null -x c /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi) | 90 | CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(KBUILD_CFLAGS) -Wa,-mdaddi -c -o /dev/null -x c /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi) |
93 | 91 | ||
94 | obj-$(CONFIG_HAVE_STD_PC_SERIAL_PORT) += 8250-platform.o | 92 | obj-$(CONFIG_HAVE_STD_PC_SERIAL_PORT) += 8250-platform.o |
diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c index 50285b2c7ffe..0845091ba480 100644 --- a/arch/mips/kernel/asm-offsets.c +++ b/arch/mips/kernel/asm-offsets.c | |||
@@ -17,6 +17,8 @@ | |||
17 | #include <asm/ptrace.h> | 17 | #include <asm/ptrace.h> |
18 | #include <asm/processor.h> | 18 | #include <asm/processor.h> |
19 | 19 | ||
20 | #include <linux/kvm_host.h> | ||
21 | |||
20 | void output_ptreg_defines(void) | 22 | void output_ptreg_defines(void) |
21 | { | 23 | { |
22 | COMMENT("MIPS pt_regs offsets."); | 24 | COMMENT("MIPS pt_regs offsets."); |
@@ -328,3 +330,67 @@ void output_pbe_defines(void) | |||
328 | BLANK(); | 330 | BLANK(); |
329 | } | 331 | } |
330 | #endif | 332 | #endif |
333 | |||
334 | void output_kvm_defines(void) | ||
335 | { | ||
336 | COMMENT(" KVM/MIPS Specfic offsets. "); | ||
337 | DEFINE(VCPU_ARCH_SIZE, sizeof(struct kvm_vcpu_arch)); | ||
338 | OFFSET(VCPU_RUN, kvm_vcpu, run); | ||
339 | OFFSET(VCPU_HOST_ARCH, kvm_vcpu, arch); | ||
340 | |||
341 | OFFSET(VCPU_HOST_EBASE, kvm_vcpu_arch, host_ebase); | ||
342 | OFFSET(VCPU_GUEST_EBASE, kvm_vcpu_arch, guest_ebase); | ||
343 | |||
344 | OFFSET(VCPU_HOST_STACK, kvm_vcpu_arch, host_stack); | ||
345 | OFFSET(VCPU_HOST_GP, kvm_vcpu_arch, host_gp); | ||
346 | |||
347 | OFFSET(VCPU_HOST_CP0_BADVADDR, kvm_vcpu_arch, host_cp0_badvaddr); | ||
348 | OFFSET(VCPU_HOST_CP0_CAUSE, kvm_vcpu_arch, host_cp0_cause); | ||
349 | OFFSET(VCPU_HOST_EPC, kvm_vcpu_arch, host_cp0_epc); | ||
350 | OFFSET(VCPU_HOST_ENTRYHI, kvm_vcpu_arch, host_cp0_entryhi); | ||
351 | |||
352 | OFFSET(VCPU_GUEST_INST, kvm_vcpu_arch, guest_inst); | ||
353 | |||
354 | OFFSET(VCPU_R0, kvm_vcpu_arch, gprs[0]); | ||
355 | OFFSET(VCPU_R1, kvm_vcpu_arch, gprs[1]); | ||
356 | OFFSET(VCPU_R2, kvm_vcpu_arch, gprs[2]); | ||
357 | OFFSET(VCPU_R3, kvm_vcpu_arch, gprs[3]); | ||
358 | OFFSET(VCPU_R4, kvm_vcpu_arch, gprs[4]); | ||
359 | OFFSET(VCPU_R5, kvm_vcpu_arch, gprs[5]); | ||
360 | OFFSET(VCPU_R6, kvm_vcpu_arch, gprs[6]); | ||
361 | OFFSET(VCPU_R7, kvm_vcpu_arch, gprs[7]); | ||
362 | OFFSET(VCPU_R8, kvm_vcpu_arch, gprs[8]); | ||
363 | OFFSET(VCPU_R9, kvm_vcpu_arch, gprs[9]); | ||
364 | OFFSET(VCPU_R10, kvm_vcpu_arch, gprs[10]); | ||
365 | OFFSET(VCPU_R11, kvm_vcpu_arch, gprs[11]); | ||
366 | OFFSET(VCPU_R12, kvm_vcpu_arch, gprs[12]); | ||
367 | OFFSET(VCPU_R13, kvm_vcpu_arch, gprs[13]); | ||
368 | OFFSET(VCPU_R14, kvm_vcpu_arch, gprs[14]); | ||
369 | OFFSET(VCPU_R15, kvm_vcpu_arch, gprs[15]); | ||
370 | OFFSET(VCPU_R16, kvm_vcpu_arch, gprs[16]); | ||
371 | OFFSET(VCPU_R17, kvm_vcpu_arch, gprs[17]); | ||
372 | OFFSET(VCPU_R18, kvm_vcpu_arch, gprs[18]); | ||
373 | OFFSET(VCPU_R19, kvm_vcpu_arch, gprs[19]); | ||
374 | OFFSET(VCPU_R20, kvm_vcpu_arch, gprs[20]); | ||
375 | OFFSET(VCPU_R21, kvm_vcpu_arch, gprs[21]); | ||
376 | OFFSET(VCPU_R22, kvm_vcpu_arch, gprs[22]); | ||
377 | OFFSET(VCPU_R23, kvm_vcpu_arch, gprs[23]); | ||
378 | OFFSET(VCPU_R24, kvm_vcpu_arch, gprs[24]); | ||
379 | OFFSET(VCPU_R25, kvm_vcpu_arch, gprs[25]); | ||
380 | OFFSET(VCPU_R26, kvm_vcpu_arch, gprs[26]); | ||
381 | OFFSET(VCPU_R27, kvm_vcpu_arch, gprs[27]); | ||
382 | OFFSET(VCPU_R28, kvm_vcpu_arch, gprs[28]); | ||
383 | OFFSET(VCPU_R29, kvm_vcpu_arch, gprs[29]); | ||
384 | OFFSET(VCPU_R30, kvm_vcpu_arch, gprs[30]); | ||
385 | OFFSET(VCPU_R31, kvm_vcpu_arch, gprs[31]); | ||
386 | OFFSET(VCPU_LO, kvm_vcpu_arch, lo); | ||
387 | OFFSET(VCPU_HI, kvm_vcpu_arch, hi); | ||
388 | OFFSET(VCPU_PC, kvm_vcpu_arch, pc); | ||
389 | OFFSET(VCPU_COP0, kvm_vcpu_arch, cop0); | ||
390 | OFFSET(VCPU_GUEST_KERNEL_ASID, kvm_vcpu_arch, guest_kernel_asid); | ||
391 | OFFSET(VCPU_GUEST_USER_ASID, kvm_vcpu_arch, guest_user_asid); | ||
392 | |||
393 | OFFSET(COP0_TLB_HI, mips_coproc, reg[MIPS_CP0_TLB_HI][0]); | ||
394 | OFFSET(COP0_STATUS, mips_coproc, reg[MIPS_CP0_STATUS][0]); | ||
395 | BLANK(); | ||
396 | } | ||
diff --git a/arch/mips/kernel/binfmt_elfo32.c b/arch/mips/kernel/binfmt_elfo32.c index 556a4357d7fc..97c5a1668e53 100644 --- a/arch/mips/kernel/binfmt_elfo32.c +++ b/arch/mips/kernel/binfmt_elfo32.c | |||
@@ -48,7 +48,11 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; | |||
48 | __res; \ | 48 | __res; \ |
49 | }) | 49 | }) |
50 | 50 | ||
51 | #ifdef CONFIG_KVM_GUEST | ||
52 | #define TASK32_SIZE 0x3fff8000UL | ||
53 | #else | ||
51 | #define TASK32_SIZE 0x7fff8000UL | 54 | #define TASK32_SIZE 0x7fff8000UL |
55 | #endif | ||
52 | #undef ELF_ET_DYN_BASE | 56 | #undef ELF_ET_DYN_BASE |
53 | #define ELF_ET_DYN_BASE (TASK32_SIZE / 3 * 2) | 57 | #define ELF_ET_DYN_BASE (TASK32_SIZE / 3 * 2) |
54 | 58 | ||
diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c index 0613f468f1ad..02033eaf8825 100644 --- a/arch/mips/kernel/cevt-r4k.c +++ b/arch/mips/kernel/cevt-r4k.c | |||
@@ -119,6 +119,10 @@ int c0_compare_int_usable(void) | |||
119 | unsigned int delta; | 119 | unsigned int delta; |
120 | unsigned int cnt; | 120 | unsigned int cnt; |
121 | 121 | ||
122 | #ifdef CONFIG_KVM_GUEST | ||
123 | return 1; | ||
124 | #endif | ||
125 | |||
122 | /* | 126 | /* |
123 | * IP7 already pending? Try to clear it by acking the timer. | 127 | * IP7 already pending? Try to clear it by acking the timer. |
124 | */ | 128 | */ |
diff --git a/arch/mips/kernel/mips_machine.c b/arch/mips/kernel/mips_machine.c index 411a058d2c53..876097529697 100644 --- a/arch/mips/kernel/mips_machine.c +++ b/arch/mips/kernel/mips_machine.c | |||
@@ -11,9 +11,9 @@ | |||
11 | #include <linux/slab.h> | 11 | #include <linux/slab.h> |
12 | 12 | ||
13 | #include <asm/mips_machine.h> | 13 | #include <asm/mips_machine.h> |
14 | #include <asm/prom.h> | ||
14 | 15 | ||
15 | static struct mips_machine *mips_machine __initdata; | 16 | static struct mips_machine *mips_machine __initdata; |
16 | static char *mips_machine_name = "Unknown"; | ||
17 | 17 | ||
18 | #define for_each_machine(mach) \ | 18 | #define for_each_machine(mach) \ |
19 | for ((mach) = (struct mips_machine *)&__mips_machines_start; \ | 19 | for ((mach) = (struct mips_machine *)&__mips_machines_start; \ |
@@ -21,25 +21,6 @@ static char *mips_machine_name = "Unknown"; | |||
21 | (unsigned long)(mach) < (unsigned long)&__mips_machines_end; \ | 21 | (unsigned long)(mach) < (unsigned long)&__mips_machines_end; \ |
22 | (mach)++) | 22 | (mach)++) |
23 | 23 | ||
24 | __init void mips_set_machine_name(const char *name) | ||
25 | { | ||
26 | char *p; | ||
27 | |||
28 | if (name == NULL) | ||
29 | return; | ||
30 | |||
31 | p = kstrdup(name, GFP_KERNEL); | ||
32 | if (!p) | ||
33 | pr_err("MIPS: no memory for machine_name\n"); | ||
34 | |||
35 | mips_machine_name = p; | ||
36 | } | ||
37 | |||
38 | char *mips_get_machine_name(void) | ||
39 | { | ||
40 | return mips_machine_name; | ||
41 | } | ||
42 | |||
43 | __init int mips_machtype_setup(char *id) | 24 | __init int mips_machtype_setup(char *id) |
44 | { | 25 | { |
45 | struct mips_machine *mach; | 26 | struct mips_machine *mach; |
@@ -79,7 +60,6 @@ __init void mips_machine_setup(void) | |||
79 | return; | 60 | return; |
80 | 61 | ||
81 | mips_set_machine_name(mips_machine->mach_name); | 62 | mips_set_machine_name(mips_machine->mach_name); |
82 | pr_info("MIPS: machine is %s\n", mips_machine_name); | ||
83 | 63 | ||
84 | if (mips_machine->mach_setup) | 64 | if (mips_machine->mach_setup) |
85 | mips_machine->mach_setup(); | 65 | mips_machine->mach_setup(); |
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c index 26b19daa1792..a3e461408b7e 100644 --- a/arch/mips/kernel/proc.c +++ b/arch/mips/kernel/proc.c | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <asm/cpu-features.h> | 12 | #include <asm/cpu-features.h> |
13 | #include <asm/mipsregs.h> | 13 | #include <asm/mipsregs.h> |
14 | #include <asm/processor.h> | 14 | #include <asm/processor.h> |
15 | #include <asm/mips_machine.h> | 15 | #include <asm/prom.h> |
16 | 16 | ||
17 | unsigned int vced_count, vcei_count; | 17 | unsigned int vced_count, vcei_count; |
18 | 18 | ||
diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c index 028f6f837ef9..5712bb532245 100644 --- a/arch/mips/kernel/prom.c +++ b/arch/mips/kernel/prom.c | |||
@@ -23,6 +23,23 @@ | |||
23 | #include <asm/page.h> | 23 | #include <asm/page.h> |
24 | #include <asm/prom.h> | 24 | #include <asm/prom.h> |
25 | 25 | ||
26 | static char mips_machine_name[64] = "Unknown"; | ||
27 | |||
28 | __init void mips_set_machine_name(const char *name) | ||
29 | { | ||
30 | if (name == NULL) | ||
31 | return; | ||
32 | |||
33 | strncpy(mips_machine_name, name, sizeof(mips_machine_name)); | ||
34 | pr_info("MIPS: machine is %s\n", mips_get_machine_name()); | ||
35 | } | ||
36 | |||
37 | char *mips_get_machine_name(void) | ||
38 | { | ||
39 | return mips_machine_name; | ||
40 | } | ||
41 | |||
42 | #ifdef CONFIG_OF | ||
26 | int __init early_init_dt_scan_memory_arch(unsigned long node, | 43 | int __init early_init_dt_scan_memory_arch(unsigned long node, |
27 | const char *uname, int depth, | 44 | const char *uname, int depth, |
28 | void *data) | 45 | void *data) |
@@ -50,6 +67,18 @@ void __init early_init_dt_setup_initrd_arch(unsigned long start, | |||
50 | } | 67 | } |
51 | #endif | 68 | #endif |
52 | 69 | ||
70 | int __init early_init_dt_scan_model(unsigned long node, const char *uname, | ||
71 | int depth, void *data) | ||
72 | { | ||
73 | if (!depth) { | ||
74 | char *model = of_get_flat_dt_prop(node, "model", NULL); | ||
75 | |||
76 | if (model) | ||
77 | mips_set_machine_name(model); | ||
78 | } | ||
79 | return 0; | ||
80 | } | ||
81 | |||
53 | void __init early_init_devtree(void *params) | 82 | void __init early_init_devtree(void *params) |
54 | { | 83 | { |
55 | /* Setup flat device-tree pointer */ | 84 | /* Setup flat device-tree pointer */ |
@@ -65,6 +94,9 @@ void __init early_init_devtree(void *params) | |||
65 | /* Scan memory nodes */ | 94 | /* Scan memory nodes */ |
66 | of_scan_flat_dt(early_init_dt_scan_root, NULL); | 95 | of_scan_flat_dt(early_init_dt_scan_root, NULL); |
67 | of_scan_flat_dt(early_init_dt_scan_memory_arch, NULL); | 96 | of_scan_flat_dt(early_init_dt_scan_memory_arch, NULL); |
97 | |||
98 | /* try to load the mips machine name */ | ||
99 | of_scan_flat_dt(early_init_dt_scan_model, NULL); | ||
68 | } | 100 | } |
69 | 101 | ||
70 | void __init __dt_setup_arch(struct boot_param_header *bph) | 102 | void __init __dt_setup_arch(struct boot_param_header *bph) |
@@ -79,3 +111,4 @@ void __init __dt_setup_arch(struct boot_param_header *bph) | |||
79 | 111 | ||
80 | early_init_devtree(initial_boot_params); | 112 | early_init_devtree(initial_boot_params); |
81 | } | 113 | } |
114 | #endif | ||
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index 4c774d5d5087..c7f90519e58c 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/pfn.h> | 23 | #include <linux/pfn.h> |
24 | #include <linux/debugfs.h> | 24 | #include <linux/debugfs.h> |
25 | #include <linux/kexec.h> | 25 | #include <linux/kexec.h> |
26 | #include <linux/sizes.h> | ||
26 | 27 | ||
27 | #include <asm/addrspace.h> | 28 | #include <asm/addrspace.h> |
28 | #include <asm/bootinfo.h> | 29 | #include <asm/bootinfo.h> |
@@ -77,6 +78,8 @@ EXPORT_SYMBOL(mips_io_port_base); | |||
77 | static struct resource code_resource = { .name = "Kernel code", }; | 78 | static struct resource code_resource = { .name = "Kernel code", }; |
78 | static struct resource data_resource = { .name = "Kernel data", }; | 79 | static struct resource data_resource = { .name = "Kernel data", }; |
79 | 80 | ||
81 | static void *detect_magic __initdata = detect_memory_region; | ||
82 | |||
80 | void __init add_memory_region(phys_t start, phys_t size, long type) | 83 | void __init add_memory_region(phys_t start, phys_t size, long type) |
81 | { | 84 | { |
82 | int x = boot_mem_map.nr_map; | 85 | int x = boot_mem_map.nr_map; |
@@ -122,6 +125,25 @@ void __init add_memory_region(phys_t start, phys_t size, long type) | |||
122 | boot_mem_map.nr_map++; | 125 | boot_mem_map.nr_map++; |
123 | } | 126 | } |
124 | 127 | ||
128 | void __init detect_memory_region(phys_t start, phys_t sz_min, phys_t sz_max) | ||
129 | { | ||
130 | void *dm = &detect_magic; | ||
131 | phys_t size; | ||
132 | |||
133 | for (size = sz_min; size < sz_max; size <<= 1) { | ||
134 | if (!memcmp(dm, dm + size, sizeof(detect_magic))) | ||
135 | break; | ||
136 | } | ||
137 | |||
138 | pr_debug("Memory: %lluMB of RAM detected at 0x%llx (min: %lluMB, max: %lluMB)\n", | ||
139 | ((unsigned long long) size) / SZ_1M, | ||
140 | (unsigned long long) start, | ||
141 | ((unsigned long long) sz_min) / SZ_1M, | ||
142 | ((unsigned long long) sz_max) / SZ_1M); | ||
143 | |||
144 | add_memory_region(start, size, BOOT_MEM_RAM); | ||
145 | } | ||
146 | |||
125 | static void __init print_memory_map(void) | 147 | static void __init print_memory_map(void) |
126 | { | 148 | { |
127 | int i; | 149 | int i; |
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index 66bf4e22d9b9..596620dd7ee2 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c | |||
@@ -83,6 +83,7 @@ static inline void set_cpu_sibling_map(int cpu) | |||
83 | } | 83 | } |
84 | 84 | ||
85 | struct plat_smp_ops *mp_ops; | 85 | struct plat_smp_ops *mp_ops; |
86 | EXPORT_SYMBOL(mp_ops); | ||
86 | 87 | ||
87 | __cpuinit void register_smp_ops(struct plat_smp_ops *ops) | 88 | __cpuinit void register_smp_ops(struct plat_smp_ops *ops) |
88 | { | 89 | { |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 571a69c57d82..3c906e723fd4 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -60,9 +60,9 @@ extern void check_wait(void); | |||
60 | extern asmlinkage void r4k_wait(void); | 60 | extern asmlinkage void r4k_wait(void); |
61 | extern asmlinkage void rollback_handle_int(void); | 61 | extern asmlinkage void rollback_handle_int(void); |
62 | extern asmlinkage void handle_int(void); | 62 | extern asmlinkage void handle_int(void); |
63 | extern asmlinkage void handle_tlbm(void); | 63 | extern u32 handle_tlbl[]; |
64 | extern asmlinkage void handle_tlbl(void); | 64 | extern u32 handle_tlbs[]; |
65 | extern asmlinkage void handle_tlbs(void); | 65 | extern u32 handle_tlbm[]; |
66 | extern asmlinkage void handle_adel(void); | 66 | extern asmlinkage void handle_adel(void); |
67 | extern asmlinkage void handle_ades(void); | 67 | extern asmlinkage void handle_ades(void); |
68 | extern asmlinkage void handle_ibe(void); | 68 | extern asmlinkage void handle_ibe(void); |
@@ -1473,7 +1473,7 @@ unsigned long vi_handlers[64]; | |||
1473 | void __init *set_except_vector(int n, void *addr) | 1473 | void __init *set_except_vector(int n, void *addr) |
1474 | { | 1474 | { |
1475 | unsigned long handler = (unsigned long) addr; | 1475 | unsigned long handler = (unsigned long) addr; |
1476 | unsigned long old_handler = exception_handlers[n]; | 1476 | unsigned long old_handler; |
1477 | 1477 | ||
1478 | #ifdef CONFIG_CPU_MICROMIPS | 1478 | #ifdef CONFIG_CPU_MICROMIPS |
1479 | /* | 1479 | /* |
@@ -1486,7 +1486,8 @@ void __init *set_except_vector(int n, void *addr) | |||
1486 | if (!(handler & 0x1)) | 1486 | if (!(handler & 0x1)) |
1487 | handler |= 1; | 1487 | handler |= 1; |
1488 | #endif | 1488 | #endif |
1489 | exception_handlers[n] = handler; | 1489 | old_handler = xchg(&exception_handlers[n], handler); |
1490 | |||
1490 | if (n == 0 && cpu_has_divec) { | 1491 | if (n == 0 && cpu_has_divec) { |
1491 | #ifdef CONFIG_CPU_MICROMIPS | 1492 | #ifdef CONFIG_CPU_MICROMIPS |
1492 | unsigned long jump_mask = ~((1 << 27) - 1); | 1493 | unsigned long jump_mask = ~((1 << 27) - 1); |
@@ -1508,7 +1509,7 @@ void __init *set_except_vector(int n, void *addr) | |||
1508 | return (void *)old_handler; | 1509 | return (void *)old_handler; |
1509 | } | 1510 | } |
1510 | 1511 | ||
1511 | static asmlinkage void do_default_vi(void) | 1512 | static void do_default_vi(void) |
1512 | { | 1513 | { |
1513 | show_regs(get_irq_regs()); | 1514 | show_regs(get_irq_regs()); |
1514 | panic("Caught unexpected vectored interrupt."); | 1515 | panic("Caught unexpected vectored interrupt."); |
@@ -1841,7 +1842,12 @@ void __init trap_init(void) | |||
1841 | ebase = (unsigned long) | 1842 | ebase = (unsigned long) |
1842 | __alloc_bootmem(size, 1 << fls(size), 0); | 1843 | __alloc_bootmem(size, 1 << fls(size), 0); |
1843 | } else { | 1844 | } else { |
1844 | ebase = CKSEG0; | 1845 | #ifdef CONFIG_KVM_GUEST |
1846 | #define KVM_GUEST_KSEG0 0x40000000 | ||
1847 | ebase = KVM_GUEST_KSEG0; | ||
1848 | #else | ||
1849 | ebase = CKSEG0; | ||
1850 | #endif | ||
1845 | if (cpu_has_mips_r2) | 1851 | if (cpu_has_mips_r2) |
1846 | ebase += (read_c0_ebase() & 0x3ffff000); | 1852 | ebase += (read_c0_ebase() & 0x3ffff000); |
1847 | } | 1853 | } |