aboutsummaryrefslogtreecommitdiff
path: root/sys/cddl/dev/fbt/riscv
Commit message (Collapse)AuthorAgeFilesLines
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-162-4/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* dtrace: deduplicate some RISC-V functionsChristos Margiolis2023-05-301-52/+4
| | | | | | | | | | match_opcode() is defined in FBT, kinst, and dtrace_subr.c. The function prologue-checking functions are defined in FBT and kinst. Reviewed by: markj Approved by: markj (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40335
* fbt: get rid of redundant definesChristos Margiolis2023-05-011-2/+0
| | | | | | | | | No functional change intended. Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39882
* dtrace: correct the aframes value for fbt providerMitchell Horne2023-01-121-2/+3
| | | | | | | | | | | | | | Set the number of artificial frames to 5: 1. cpu_exception_handler_supervisor() 2. do_trap_supervisor() 3. dtrace_invop_start() 4. dtrace_invop() 5. fbt_invop() Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37663
* dtrace: dtrace_getpcstack() tweaks for riscvMitchell Horne2023-01-121-1/+1
| | | | | | | | | | | | | | | | Backtraces for fbt probes are missing the caller's frame. Despite what the inherited comment claims, we do need to insert this manually on riscv. In fbt_invop(), set cpu_dtrace_caller to be the return address, not addr. We should not increment aframes within this function, since we begin the main loop by unwinding past the current frame. Plus some very small comment/style tweaks. MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D37661
* dtrace: Blacklist riscv exception handlers for fbtKristof Provost2021-01-121-0/+13
| | | | | | | | | We can't safely instrument those exception handlers, so blacklist them. Test case: dtrace -n ::: Reviewed by: markj (previous version) Differential Revision: https://reviews.freebsd.org/D27754
* dtrace: fix fbt return probes on RISC-VKristof Provost2020-09-111-3/+9
| | | | | | | | | | | | | | | | Return values are passed in a0, so read it from there. We also pass a1 through to userspace, as the ABI allows small structs to be returned in registers a0/a1. While here read the register values directly from the trapframe rather than rtval, and remove the now unneeded argument from dtrace_invop(). Set fbtp_roffset so that we get the correct return location in arg0. Reviewed by: markj Sponsored by: Axiado Differential Revision: https://reviews.freebsd.org/D26389 Notes: svn path=/head/; revision=365626
* Various fixes for TLB management on RISC-V.John Baldwin2018-10-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove the arm64-specific cpu_*cache* and cpu_tlb_flush* functions. Instead, add RISC-V specific inline functions in cpufunc.h for the fence.i and sfence.vma instructions. - Catch up to changes in the arm64 pmap and remove all the cpu_dcache_* calls, pmap_is_current, pmap_l3_valid_cacheable, and PTE_NEXT bits from pmap. - Remove references to the unimplemented riscv_setttb(). - Remove unused cpu_nullop. - Add a link to the SBI doc to sbi.h. - Add support for a 4th argument in SBI calls. It's not documented but it seems implied for the asid argument to SBI_REMOVE_SFENCE_VMA_ASID. - Pass the arguments from sbi_remote_sfence*() to the SEE. BBL ignores them so this is just cosmetic. - Flush icaches on other CPUs when they resume from kdb in case the debugger wrote any breakpoints while the CPUs were paused in the IPI_STOP handler. - Add SMP vs UP versions of pmap_invalidate_* similar to amd64. The UP versions just use simple fences. The SMP versions use the sbi_remove_sfence*() functions to perform TLB shootdowns. Since we don't have a valid pm_active field in the riscv pmap, just IPI all CPUs for all invalidations for now. - Remove an extraneous TLB flush from the end of pmap_bootstrap(). - Don't do a TLB flush when writing new mappings in pmap_enter(), only if modifying an existing mapping. Note that for COW faults a TLB flush is only performed after explicitly clearing the old mapping as is done in other pmaps. - Sync the i-cache on all harts before updating the PTE for executable mappings in pmap_enter and pmap_enter_quick. Previously the i-cache was only sync'd after updating the PTE in pmap_enter. - Use sbi_remote_fence() instead of smp_rendezvous in pmap_sync_icache(). Reviewed by: markj Approved by: re (gjb, kib) Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17414 Notes: svn path=/head/; revision=339367
* Add support for 'C'-compressed ISA extension to DTrace FBT provider.Ruslan Bukin2018-09-031-10/+92
| | | | | | | | Approved by: re (kib) Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=338444
* Allow multiple FBT probes to share a tracepoint.Mark Johnston2018-08-281-1/+1
| | | | | | | | | | | | | | | | | With GNU ifuncs, multiple FBT probes may correspond to the same instruction. fbt_invop() assumed that this could not happen and would return after the first probe found in the global FBT hash table, which might not be the one that's enabled. Fix the problem on x86 by linking probes that share a tracepoint and having each linked probe fire when the tracepoint is hit. PR: 230846 Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D16921 Notes: svn path=/head/; revision=338359
* Remove unused variables.Ruslan Bukin2016-07-291-2/+0
| | | | Notes: svn path=/head/; revision=303479
* Add initial DTrace support for RISC-V.Ruslan Bukin2016-05-242-0/+195
Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Notes: svn path=/head/; revision=300618