User Details
- User Since
- Sep 10 2026, 2:37 AM (8 w, 2 d)
Sat, Oct 17
Thu, Oct 15
Mon, Oct 12
Sat, Oct 10
Oct 6 2026
0x100d0014 is the LS7A bridge chip's private ACPI PM1_CNT physical address and should not be hardcoded in generic kernel code.
suggested to use the generic uiomove_step() instead of the inline switch/case,
consistent with architectures such as amd64/arm64/riscv/powerpc, to avoid duplicating the implementation.
Oct 5 2026
base_freq * cfm is computed as uint32_t, so the intermediate result may exceed 2^32-1 and overflow; it should be changed to ((uint64_t)base_freq * cfm) / cfd to perform 64-bit multiplication.
ll/sc only guarantees the atomicity of that read-modify-write, not ordering with surrounding memory accesses; a successful CAS should have at least acquire/release semantics.
ptrace_clear_single_step() only clears a software flag, td->td_md.md_ss_active, but does not write the hardware CSRs (LOONG_CSR_IB0CTRL and LOONGARCH_CSR_FWPS) to actually disable IB0.
pmap_enter() hardcodes PTE_CC and ignores m->md.pv_memattr.
Oct 4 2026
The version register read operation uses unnamed numbers.
ofwbus should only be added when the system has no ACPI RSDP (i.e. FDT boot).
When setting the CPU bitmap all_cpus, cpu_mp_start() incorrectly uses the hardware cpuid boot_cpu, whereas all_cpus should use the logical cpuid (0-based).
FDT and ACPI code for starting an AP does the same thing, so they must send the same IPI. Changing both the original 2 (PREEMPT) and 1 (AST) to IPI_WAKEUP eliminates the inconsistency and avoids sending a preemption signal during early AP startup.
Oct 3 2026
cpu_flush_dcache() is an empty function, which would make callers believe the cache has been flushed.
Change the cpuhead list traversal to CPU_FOREACH_ISSET to iterate directly over the target cpuset, avoiding scanning all online CPUs, consistent with other architecture implementations, and remove the redundant pc_pending_ipis setting.
mvendorid/marchid/mimpid are RISC-V CSR names, and has_sstc/has_sscofpmf are RISC-V extensions. LoongArch does not have these, so they should not exist in LoongArch at all. LoongArch's CPU identity information should be read via CPUCFG-related instructions.
Oct 2 2026
TF_FCSR0/_FCC relies on anonymous union members.
This macro is defined in elf.h, but hardware capability bits are more appropriate in <machine/cpu.h>. Making pmap.h depend on an ELF header is not appropriate.
cpu_desc[MAXCPU] is declared in pmap.h, which is not an appropriate place.
Oct 1 2026
Fix non-standard C99 anonymous unions/structs.
Do not allow GDB to write $zero (r0) into the trapframe.
The full FP / LSX / LASX context is saved on every exception, which is a significant overhead on every exception.
Sep 30 2026
Please pass count through to db_stack_trace_cmd() and use it to bound the loop.
%u is used to print uint64_t fields.
invtlb is not in 3R register format, but rather op, rj, rk (an immediate plus two registers). Using pr_rrr would incorrectly display the op field as a register name.
addi.w skip logic is based on an incorrect premise, It is suggested to remove this code.
JIRL/LL/SC offsets are as *4 instead of *2.
ops[] is not NULL-terminated.
IRQ_NMI / IRQ_AVEC should not appear in the CPUINTC enum.
It only contains a cpu_initclocks() stub that calls cpu_initclocks_bsp() / cpu_initclocks_ap(), with no timecounter, no eventtimer, no timer CSR programming (TCFG/T/TICLR), and no interrupt handler.
Sep 29 2026
bs_rs_s takes 4 arguments, but bus_space_read_stream_8 passes 5; please remove the extra 8 so it reads bs_rs_s(8,(t),(h),(o))
Sep 27 2026
LGTM.
Remove the privileged CSRs, so struct reg becomes smaller and the ptrace ABI is cleaner.
Fix non-standard C99 anonymous unions/structs in <machine/reg.h> and <machine/ucontext.h>.
Sep 26 2026
Sep 25 2026
break 0 is BRK_DEFAULT, not a user-breakpoint code, use break 0x4 (BRK_USERBP)
Sep 24 2026
bus_dma_impl.h uses the old busdma internal API (filter / parent / ref_count) that has already been removed upstream in FreeBSD.
Here $t0 is hardcoded as the temporary register for SC and communicated to the compiler via the "t0" clobber, but I think a better approach would be to use the output register res directly for the SC, without needing an extra temporary register.
Sep 23 2026
According to the LoongArch ELF ABI register convention, $r21 is marked as Reserved (Non-allocatable) and cannot be used as a PCPU pointer; you can use $tp instead: LoongArch ABI thread pointer register is $tp (r2).
C++ conditional guards should not be added here; adding them here would make the behavior inconsistent with other architectures.
There is no functional issue here, but the placement of the bit-width macros is inconsistent with upstream conventions. They could be moved to the front of the file, consistent with the placement in other architectures, to improve code readability.
Please complete the binary format specifier macros PRIb* / PRIB* / SCNb*. Upstream RISC-V/ARM64 _inttypes.h already includes them, and the Loong64 LP64 ABI determines the width selection.
You should not delete _bus_dmamap_addsegs() ; please pull the latest main branch code.
Because sys/kern/link_elf_obj.c is a machine-independent file, LoongArch-specific macros cannot be expanded directly in it.
Please clarify whether this is because the pmap has not yet been initialized, or because DMW0 has already been configured during the early console stage. This does not look like something applicable to all LoongArch platforms, and it seems to be bypassing the normal mapping interface.
Perhaps it would be more appropriate to use the fence() wrapper newly added in machine/atomic.h.
Wrap the assembly fence() in atomic.h, For consistency in code style, use the fence() wrapper newly added in machine/atomic.h. This way, if changes are needed later, only the fence() wrapper has to be modified.
code review
Conduct code review
It is suggested to remove the explicitly defined setcommand_set and set_Xficl_compile_set output sections, and just retain them via objcopy -j.
Redundant includes and extern declaration.
It is suggested to use designated initializers for the struct file_format initialization.
dev_cleanup() must be called before bi_load().
Passing entry itself and kernend to the kernel via registers is a custom ABI. If the kernel needs this information, it should obtain it from the modulep metadata (FreeBSD already has mechanisms such as MODINFOMD_KERNEND and MODINFOMD_MODULEP), rather than breaking cross-architecture consistency.
MP Service Protocol query serves no real purpose, suggested to remove.