Skip to content

Commit 67c35a3

Browse files
danglin44hdeller
authored andcommitted
parisc: Disable debug code regarding cache flushes in handle_nadtlb_fault()
Change the "BUG" to "WARNING" and disable the message because it triggers occasionally in spite of the check in flush_cache_page_if_present. The pte value extracted for the "from" page in copy_user_highpage is racy and occasionally the pte is cleared before the flush is complete. I assume that the page is simultaneously flushed by flush_cache_mm before the pte is cleared as nullifying the fdc doesn't seem to cause problems. I investigated various locking scenarios but I wasn't able to find a way to sequence the flushes. This code is called for every COW break and locks impact performance. This patch is related to the bigger cache flush patch because we need the pte on PA8800/PA8900 to flush using the vma context. I have also seen this from copy_to_user_page and copy_from_user_page. The messages appear infrequently when enabled. Signed-off-by: John David Anglin <dave.anglin@bell.net> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 42226c9 commit 67c35a3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

arch/parisc/mm/fault.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
#include <asm/traps.h>
2424

25+
#define DEBUG_NATLB 0
26+
2527
/* Various important other fields */
2628
#define bit22set(x) (x & 0x00000200)
2729
#define bits23_25set(x) (x & 0x000001c0)
@@ -450,8 +452,8 @@ handle_nadtlb_fault(struct pt_regs *regs)
450452
fallthrough;
451453
case 0x380:
452454
/* PDC and FIC instructions */
453-
if (printk_ratelimit()) {
454-
pr_warn("BUG: nullifying cache flush/purge instruction\n");
455+
if (DEBUG_NATLB && printk_ratelimit()) {
456+
pr_warn("WARNING: nullifying cache flush/purge instruction\n");
455457
show_regs(regs);
456458
}
457459
if (insn & 0x20) {

0 commit comments

Comments
 (0)