Author: mhorne Date: Mon Oct 26 19:06:30 2020 New Revision: 367067 URL: https://svnweb.freebsd.org/changeset/base/367067
Log: riscv: remove sbi_clear_ipi() S-mode software has write access to the SIP.SSIP bit, so instead of making a second round-trip through the SBI we can clear it ourselves. The SBI spec has deprecated this function for this exactly this reason. Submitted by: Danjel Q. <danq1...@gmail.com Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D26952 Modified: head/sys/riscv/include/sbi.h head/sys/riscv/riscv/mp_machdep.c head/sys/riscv/riscv/sbi.c Modified: head/sys/riscv/include/sbi.h ============================================================================== --- head/sys/riscv/include/sbi.h Mon Oct 26 18:03:50 2020 (r367066) +++ head/sys/riscv/include/sbi.h Mon Oct 26 19:06:30 2020 (r367067) @@ -197,13 +197,6 @@ sbi_shutdown(void) } static __inline void -sbi_clear_ipi(void) -{ - - (void)SBI_CALL0(SBI_CLEAR_IPI, 0); -} - -static __inline void sbi_send_ipi(const unsigned long *hart_mask) { Modified: head/sys/riscv/riscv/mp_machdep.c ============================================================================== --- head/sys/riscv/riscv/mp_machdep.c Mon Oct 26 18:03:50 2020 (r367066) +++ head/sys/riscv/riscv/mp_machdep.c Mon Oct 26 19:06:30 2020 (r367067) @@ -317,7 +317,7 @@ ipi_handler(void *arg) u_int cpu, ipi; int bit; - sbi_clear_ipi(); + csr_clear(sip, SIP_SSIP); cpu = PCPU_GET(cpuid); Modified: head/sys/riscv/riscv/sbi.c ============================================================================== --- head/sys/riscv/riscv/sbi.c Mon Oct 26 18:03:50 2020 (r367066) +++ head/sys/riscv/riscv/sbi.c Mon Oct 26 19:06:30 2020 (r367067) @@ -183,8 +183,6 @@ sbi_init(void) ("SBI doesn't implement sbi_console_putchar()")); KASSERT(sbi_probe_extension(SBI_CONSOLE_GETCHAR) != 0, ("SBI doesn't implement sbi_console_getchar()")); - KASSERT(sbi_probe_extension(SBI_CLEAR_IPI) != 0, - ("SBI doesn't implement sbi_clear_ipi()")); KASSERT(sbi_probe_extension(SBI_SEND_IPI) != 0, ("SBI doesn't implement sbi_send_ipi()")); KASSERT(sbi_probe_extension(SBI_REMOTE_FENCE_I) != 0, _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"