FreeBSD/src 21c534b — sys/riscv/include frame.h, sys/riscv/riscv vm_machdep.c exception.S
riscv: Fix and generalise saving TP (PCPU pointer) whilst in userspace
In cpu_fork, we allocate sizeof(struct pcb) + sizeof(struct trapframe)
space on the stack, then round it for stack alignment. This not only
fails to include the space needed for TP but also doesn't round up the
trapframe allocation to be stack-aligned, yet TF_SIZE does, as is the
expectation of fork_trampoline and cpu_exception_handler. Given that
sizeof(struct pcb) + sizeof(struct trapframe) is a multiple of 16, this
causes the saved TP to be stored in the PCB's pcb_sp (the intended
trapframe padding aliasing pcb_ra), which is probably harmless in
practice as the PCB isn't expected to be current, but definitely not
intended.
In cpu_thread_alloc, we do include the 8 bytes for TP and then stack
align that. This again fails to include the padding for trapframe as
present in TF_SIZE, but sizeof(struct pcb) + sizeof(struct trapframe)
happens to be a multiple of 16, as above, so adding 8 then rounding to
stack alignment (16) includes an extra 8 bytes of padding, giving the
right result for the wrong reason (and could be broken by future struct
[11 lines not shown]
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
Similar commit in current:
(cherry picked from commit 685dc743dc3b)
FreeBSD/src 685dc74 — sys/arm64/qoriq qoriq_dw_pci.c, sys/cam/ctl ctl_scsi_all.h ctl_scsi_all.c
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
riscv: remove unused string from swtch.S
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
(cherry picked from commit f5d39047b094d5164b85ae7e2a6a9a8342269815)
riscv: retire the FPE kernel option
We always build the kernel floating point support. Now that the
riscv64sf userspace variant has been removed the option is required for
correct operation.
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39851
riscv: remove unused string from swtch.S
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
FreeBSD/src 75dfc66 (r358401) — lib/libc/sparc64/fpu fpu_implode.c, libexec/rtld-elf/sparc64 reloc.c
Merge ^/head r358269 through r358399.
Only compile clear_fpu state code when we're building with options FPE.
Soft float kernels build without floating point, and will fail to build if we
try to include floating point code.
Obtained from: kp@
MFC 348835-348836:
Fix global pointer relaxations in the RISC-V kernel
The gp register is intended to used by the linker as another means of
performing relaxations, and should point to the small data section (.sdata).
Currently gp is being used as the pcpu pointer within the kernel, but the more
appropriate choice for this is the tp register, which is unused.
Swap existing usage of gp with tp within the kernel, and set up gp properly
at boot with the value of __global_pointer$ for all harts.
Approved by: markj (mentor, implicit)
FreeBSD/src e532a99 (r349236) — contrib/libarchive/libarchive/test test_read_format_rar5_different_window_size.rar.uu, sys/dev/sdio sdiob.c
MFHead @349234
Sponsored by: The FreeBSD Foundation
Fix global pointer relaxations in the RISC-V kernel
The gp register is intended to used by the linker as another means of
performing relaxations, and should point to the small data section (.sdata).
Currently gp is being used as the pcpu pointer within the kernel, but the more
appropriate choice for this is the tp register, which is unused.
Swap existing usage of gp with tp within the kernel, and set up gp properly
at boot with the value of __global_pointer$ for all harts.
Additionally, remove some cases of accessing tp from the PCB, as it is not
part of the per-thread state. The user's tp and gp should be tracked only
through the trapframe.
Reviewed by: markj, jhb
Approved by: markj (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19893
FreeBSD/src 952d17d (r348646) — sys/riscv/include pmap.h, sys/riscv/riscv pmap.c swtch.S
MFC r344108:
Implement per-CPU pmap activation tracking for RISC-V.
FreeBSD/src 30e009f (r344271) — lib/libc/i386/gen getcontextx.c, lib/libc/x86/gen getcontextx.c
MFhead at r344270
FreeBSD/src c981cbb (r344178) — contrib/libarchive/libarchive archive_ppmd8.c archive_read_support_format_zip.c, contrib/libarchive/libarchive/test test_read_format_zip.c
Merge ^/head r343956 through r344177.
FreeBSD/src 35c91b0 (r344108) — sys/riscv/include pmap.h, sys/riscv/riscv pmap.c swtch.S
Implement per-CPU pmap activation tracking for RISC-V.
This reduces the overhead of TLB invalidations by ensuring that we
only interrupt CPUs which are using the given pmap. Tracking is
performed in pmap_activate(), which gets called during context switches:
from cpu_throw(), if a thread is exiting or an AP is starting, or
cpu_switch() for a regular context switch.
For now, pmap_sync_icache() still must interrupt all CPUs.
Reviewed by: kib (earlier version), jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18874
FreeBSD/src c9fa6ca (r342090) — sys/riscv/include cpufunc.h, sys/riscv/riscv locore.S swtch.S
MFC r341693:
Rename sptbr to satp per v1.10 of the privileged architecture spec.
FreeBSD/src 67350cb (r341764) — contrib/wpa/src/ap wpa_auth_ft.c, contrib/wpa/src/common dpp.c qca-vendor.h
Merge ^/head r340918 through r341763.
Delta | File |
---|
+5,918 | -3,449 | sys/dev/sfxge/common/efx_regs_mcdi.h |
+7,691 | -0 | contrib/wpa/src/common/dpp.c |
+4,709 | -52 | contrib/wpa/src/common/qca-vendor.h |
+3,108 | -467 | contrib/wpa/src/ap/wpa_auth_ft.c |
+2,934 | -0 | sys/dev/sfxge/common/efx_regs_mcdi_aoe.h |
+2,613 | -0 | contrib/wpa/wpa_supplicant/dpp_supplicant.c |
+26,973 | -3,968 | 1,093 files not shown |
+109,524 | -32,894 | 1,099 files |
FreeBSD/src 1f5e341 (r341693) — sys/riscv/include cpufunc.h, sys/riscv/riscv locore.S swtch.S
Rename sptbr to satp per v1.10 of the privileged architecture spec.
Add a subroutine for updating satp, for use when updating the
active pmap. No functional change intended.
Reviewed by: jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18462
FreeBSD/src 01d4e21 (r339201) — contrib/mandoc roff.c mdoc.7, contrib/mdocml roff.c mdoc.7
MFH r338661 through r339200.
Sponsored by: The FreeBSD Foundation
Delta | File |
---|
+3,838 | -0 | contrib/mandoc/roff.c |
+0 | -3,748 | contrib/mdocml/roff.c |
+3,244 | -0 | contrib/mandoc/mdoc.7 |
+0 | -3,231 | contrib/mdocml/mdoc.7 |
+2,968 | -0 | contrib/mandoc/mdoc_validate.c |
+0 | -2,906 | contrib/mdocml/mdoc_validate.c |
+10,050 | -9,885 | 761 files not shown |
+76,028 | -72,546 | 767 files |
FreeBSD/src ce44d80 (r338988) — contrib/mandoc roff.c mdoc.7, contrib/mdocml roff.c mdoc.7
Merge ^/head r338731 through r338987.
Delta | File |
---|
+3,838 | -0 | contrib/mandoc/roff.c |
+0 | -3,748 | contrib/mdocml/roff.c |
+3,244 | -0 | contrib/mandoc/mdoc.7 |
+0 | -3,231 | contrib/mdocml/mdoc.7 |
+2,968 | -0 | contrib/mandoc/mdoc_validate.c |
+0 | -2,906 | contrib/mdocml/mdoc_validate.c |
+10,050 | -9,885 | 642 files not shown |
+73,523 | -71,109 | 648 files |
FreeBSD/src 232d0b8 (r338814) — sys/riscv/include fpe.h, sys/riscv/riscv swtch.S machdep.c
Various fixes for floating point on RISC-V.
- Explicitly load an empty initial state into FP registers when taking
the fault on the first FP instruction in a thread. Setting
SSTATE.FS to INITIAL is just a marker to let context switch restore
code know that it can load FP registers with zeroes instead of
memory loads. It does not imply that the hardware will reset all
registers to zero on first access. In addition, set the state to
CLEAN instead of INITIAL after the first FP instruction.
cpu_switch() doesn't do anything for INITIAL and only restores from
the pcb if the state is CLEAN. We could perhaps change cpu_switch
to call fpe_state_clear if the state was INITIAL and leave SSTATE.FS
set to INITIAL instead of CLEAN after the first FP instruction.
However, adding this complexity to cpu_switch() doesn't seem worth
the supposed gain.
- Only save the current FPU registers in fill_fpregs() if the request
is made to save the current thread's registers. Previously if a
debugger requested FP registers via ptrace() it was getting a copy
of the debugger's FP registers rather than the debugee's.
[14 lines not shown]
FreeBSD/src 14b841d (r337608) — sys/dev/qlnx/qlnxe ecore_init_values.h reg_addr.h, sys/dev/usb/controller at91dci.c
MFH @ r337607, in preparation for boarding
Delta | File |
---|
+51,685 | -49,575 | sys/dev/qlnx/qlnxe/ecore_init_values.h |
+10,407 | -5,984 | sys/dev/qlnx/qlnxe/reg_addr.h |
+2,891 | -2,449 | sys/dev/qlnx/qlnxe/ecore_dbg_values.h |
+4,961 | -0 | sys/dev/qlnx/qlnxe/ecore_sriov.c |
+2,041 | -945 | sys/dev/qlnx/qlnxe/ecore_dev.c |
+0 | -2,382 | sys/dev/usb/controller/at91dci.c |
+71,985 | -61,335 | 1,587 files not shown |
+127,140 | -133,228 | 1,593 files |
FreeBSD/src bbd7a92 (r337286) — sys/amd64/amd64 support.S, sys/cddl/contrib/opensolaris/uts/common/fs/zfs space_map.c vdev_initialize.c
Merge ^/head r336870 through r337285, and resolve conflicts.
o Don't overwrite tp in fork_trampoline().
o Save and restore tp in cpu_switch().
o Restore tp in cpu_throw().
o Save tp in savectx().
This makes libthr tests happy. In particular fork_test:fork.
Sponsored by: DARPA, AFRL
Remove unused string.
Reported by: markj@
Sponsored by: DARPA, AFRL
FreeBSD/src fc2a877 (r331254) — sys/arm/arm locore-v6.S, sys/conf kmod.mk kern.post.mk
Rename assym.s to assym.inc
assym is only to be included by other .s files, and should never
actually be assembled by itself.
Reviewed by: imp, bdrewery (earlier)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D14180
FreeBSD/src 083c8de (r322452) — contrib/sqlite3 sqlite3.c shell.c, crypto/openssh ChangeLog
MFhead at r322451
Delta | File |
---|
+15,396 | -8,833 | contrib/sqlite3/sqlite3.c |
+4,433 | -0 | sys/dev/cxgbe/cudbg/cudbg_lib.c |
+3,292 | -495 | contrib/sqlite3/shell.c |
+1,171 | -2,043 | crypto/openssh/ChangeLog |
+1,310 | -0 | sys/dev/cxgbe/cudbg/cudbg_wtp.c |
+759 | -407 | contrib/sqlite3/sqlite3.h |
+26,361 | -11,778 | 656 files not shown |
+39,747 | -16,486 | 662 files |
FreeBSD/src 0275f9d (r322398) — contrib/sqlite3 sqlite3.c shell.c, crypto/openssh ChangeLog
Merge ^/head r321383 through r322397.
Delta | File |
---|
+15,396 | -8,833 | contrib/sqlite3/sqlite3.c |
+4,433 | -0 | sys/dev/cxgbe/cudbg/cudbg_lib.c |
+3,292 | -495 | contrib/sqlite3/shell.c |
+1,171 | -2,043 | crypto/openssh/ChangeLog |
+1,310 | -0 | sys/dev/cxgbe/cudbg/cudbg_wtp.c |
+141 | -1,061 | sys/contrib/dev/acpica/compiler/asltree.c |
+25,743 | -12,432 | 1,276 files not shown |
+56,010 | -27,311 | 1,282 files |
FreeBSD/src af19cc5 (r322361) — sys/boot/fdt/dts/riscv spike.dts lowrisc.dts, sys/riscv/include sbi.h
Support for v1.10 (latest) of RISC-V privilege specification.
New version is not compatible on supervisor mode with v1.9.1
(previous version).
Highlights:
o BBL (Berkeley Boot Loader) provides no initial page tables
anymore allowing us to choose VM, to build page tables manually
and enable MMU in S-mode.
o SBI interface changed.
o GENERIC kernel.
FDT is now chosen standard for RISC-V hardware description.
DTB is now provided by Spike (golden model simulator). This
allows us to introduce GENERIC kernel. However, description
for console and timer devices is not provided in DTB, so move
these devices temporary to nexus bus.
o Supervisor can't access userspace by default. Solution is to
set SUM (permit Supervisor User Memory access) bit in sstatus
register.
[8 lines not shown]
FreeBSD/src 67bc8c8 (r308842) — contrib/amd/doc texinfo.tex, contrib/amd/fsinfo null_lex.c
Merge ^/head r308491 through r308841.
Delta | File |
---|
+17,576 | -0 | sys/dev/bnxt/hsi_struct_def.h |
+4,326 | -1,261 | contrib/amd/doc/texinfo.tex |
+2,360 | -0 | sys/dev/bnxt/if_bnxt.c |
+2,021 | -43 | contrib/amd/libamu/xdr_func.c |
+1,791 | -0 | sys/dev/hyperv/pcib/vmbus_pcib.c |
+1,716 | -0 | contrib/amd/fsinfo/null_lex.c |
+29,790 | -1,304 | 737 files not shown |
+59,355 | -8,447 | 743 files |