hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/mips/sgi-ip22/ip28-berr.c
....@@ -8,6 +8,7 @@
88
99 #include <linux/init.h>
1010 #include <linux/kernel.h>
11
+#include <linux/mm.h>
1112 #include <linux/sched.h>
1213 #include <linux/sched/debug.h>
1314 #include <linux/sched/signal.h>
....@@ -300,23 +301,6 @@
300301 field, regs->cp0_epc, field, regs->regs[31]);
301302 }
302303
303
-/*
304
- * Check, whether MC's (virtual) DMA address caused the bus error.
305
- * See "Virtual DMA Specification", Draft 1.5, Feb 13 1992, SGI
306
- */
307
-
308
-static int addr_is_ram(unsigned long addr, unsigned sz)
309
-{
310
- int i;
311
-
312
- for (i = 0; i < boot_mem_map.nr_map; i++) {
313
- unsigned long a = boot_mem_map.map[i].addr;
314
- if (a <= addr && addr+sz <= a+boot_mem_map.map[i].size)
315
- return 1;
316
- }
317
- return 0;
318
-}
319
-
320304 static int check_microtlb(u32 hi, u32 lo, unsigned long vaddr)
321305 {
322306 /* This is likely rather similar to correct code ;-) */
....@@ -331,7 +315,7 @@
331315 /* PTEIndex is VPN-low (bits [22:14]/[20:12] ?) */
332316 unsigned long pte = (lo >> 6) << 12; /* PTEBase */
333317 pte += 8*((vaddr >> pgsz) & 0x1ff);
334
- if (addr_is_ram(pte, 8)) {
318
+ if (page_is_ram(PFN_DOWN(pte))) {
335319 /*
336320 * Note: Since DMA hardware does look up
337321 * translation on its own, this PTE *must*
....@@ -462,9 +446,9 @@
462446 if (ip28_be_interrupt(regs) != MIPS_BE_DISCARD) {
463447 /* Assume it would be too dangerous to continue ... */
464448 die_if_kernel("Oops", regs);
465
- force_sig(SIGBUS, current);
449
+ force_sig(SIGBUS);
466450 } else if (debug_be_interrupt)
467
- show_regs((struct pt_regs *)regs);
451
+ show_regs(regs);
468452 }
469453
470454 static int ip28_be_handler(struct pt_regs *regs, int is_fixup)