Re: [PATCH, V3] parisc: Rewrite cache flush code for PA8800/PA8900

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2022-05-17 9:06 a.m., Rolf Eike Beer wrote:
@@ -450,10 +452,12 @@ handle_nadtlb_fault(struct pt_regs *regs)
  		fallthrough;
  	case 0x380:
  		/* PDC and FIC instructions */
+#ifdef DEBUG_NATLB
  		if (printk_ratelimit()) {
-			pr_warn("BUG: nullifying cache flush/purge
instruction\n");
+			pr_warn("WARNING: nullifying cache flush/
purge instruction\n");
  			show_regs(regs);
  		}
+#endif
  		if (insn & 0x20) {
  			/* Base modification */
  			breg = (insn >> 21) & 0x1f;
This surely deserves it's own commit as it has nothing to do with the actual
change. I wonder if it is actually intended to go upstream or if this was just
a local debug hack?
I changed "BUG" to "WARNING" and disabled 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 is related to this 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.

Dave

--
John David Anglin  dave.anglin@xxxxxxxx




[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux