#
ccbe9a9f |
| 21-Nov-2024 |
Mitchell Horne <mhorne@FreeBSD.org> |
riscv: T-HEAD PBMT support
T-HEAD CPUs provide a spec-violating implementation of page-based memory types, using PTE bits [63:59]. Add basic support for this "errata", referred to in some places as
riscv: T-HEAD PBMT support
T-HEAD CPUs provide a spec-violating implementation of page-based memory types, using PTE bits [63:59]. Add basic support for this "errata", referred to in some places as an "extension".
Note that this change is not enough on its own, but a workaround is needed for the bootstrap (locore) page tables as well.
Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45472
show more ...
|
Revision tags: release/13.4.0 |
|
#
b7312c3d |
| 31-Jul-2024 |
Mitchell Horne <mhorne@FreeBSD.org> |
riscv: Svpbmt extension support
The Svpbmt extension provides specification of "Page-Based Memory Types", or memory attributes (e.g. cacheability constraints).
Extend the pmap code to apply memory
riscv: Svpbmt extension support
The Svpbmt extension provides specification of "Page-Based Memory Types", or memory attributes (e.g. cacheability constraints).
Extend the pmap code to apply memory attributes when creating/updating PTEs. This is done in a way which has no effect on CPUs lacking Svpbmt support, and is non-hostile to alternate encodings of memory attributes -- a future change will enable this for T-HEAD CPUs, which implement this PTE feature in an different (incompatible) way.
Reviewed by: jhb Tested by: br MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45471
show more ...
|
#
de09dceb |
| 20-Jun-2024 |
Mitchell Horne <mhorne@FreeBSD.org> |
riscv: rework page table bootstrap
The overall goal of the change is to reduce the amount of work done in locore assembly, and defer as much as possible until pmap_bootstrap(). Currently, half the s
riscv: rework page table bootstrap
The overall goal of the change is to reduce the amount of work done in locore assembly, and defer as much as possible until pmap_bootstrap(). Currently, half the setup is done in assembly, and then we pass the l1pt address to pmap_bootstrap() where it is amended with other mappings.
Inspiration and understanding has been taken from amd64's create_pagetables() routine, and I try to present the page table construction in the same way: a linear procedure with commentary explaining what we are doing and why. Thus the core of the new implementation is contained in pmap_create_pagetables().
Once pmap_create_pagetables() has finished, we switch to the new pagetable root and leave the bootstrap ones created by locore behind, resulting in a minimal 8kB of wasted space.
Having the whole procedure in one place, in C code, allows it to be more easily understood, while also making it more amenable to future changes which depend on CPU feature/errata detection.
Note that with this change the size of the early devmap is bumped up from one to four L2 pages (8MB).
Reviewed by: markj MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45327
show more ...
|
Revision tags: release/14.1.0, release/13.3.0, release/14.0.0 |
|
#
7703ac2e |
| 02-Nov-2023 |
Mark Johnston <markj@FreeBSD.org> |
riscv: Port improvements from arm64/amd64 pmaps, part 1
- When promoting, do not require that all PTEs all have PTE_A set. Instead, record whether they did and store this information in the PTP'
riscv: Port improvements from arm64/amd64 pmaps, part 1
- When promoting, do not require that all PTEs all have PTE_A set. Instead, record whether they did and store this information in the PTP's valid bits. - Synchronize some comments in pmap_promote_l2(). - Make pmap_promote_l2() scan starting from the end of the 2MB range instead of the beginning. See the commit log for 9d1b7fa31f510 for justification of this, which I believe applies here as well.
Reviewed by: kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D42288
show more ...
|
#
95ee2897 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
Revision tags: release/13.2.0, release/12.4.0, release/13.1.0 |
|
#
59f192c5 |
| 01-Mar-2022 |
Mark Johnston <markj@FreeBSD.org> |
riscv: Add various pmap definitions needed to support SV48 mode
No functional change intended.
Reviewed by: jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https:/
riscv: Add various pmap definitions needed to support SV48 mode
No functional change intended.
Reviewed by: jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34272
show more ...
|
Revision tags: release/12.3.0, release/13.0.0, release/12.2.0 |
|
#
b865714d |
| 01-Jul-2020 |
Kristof Provost <kp@FreeBSD.org> |
riscv pmap: zero reserved pte bits in ppn
The top 10 bits of a pte are reserved by specification[1] and are not part of the PPN.
[1] 'Volume II: RISC-V Privileged Architectures V20190608-Priv-MSU-R
riscv pmap: zero reserved pte bits in ppn
The top 10 bits of a pte are reserved by specification[1] and are not part of the PPN.
[1] 'Volume II: RISC-V Privileged Architectures V20190608-Priv-MSU-Ratified', '4.4.1 Addressing and Memory Protection', page 72: "The PTE format for Sv39 is shown in Figure 4.18. ... Bits 63–54 are reserved for future use and must be zeroed by software for forward compatibility."
Submitted by: Nathaniel Filardo <nwf20@cl.cam.ac.uk> Reviewed by: kp, mhorne Differential Revision: https://reviews.freebsd.org/D25523
show more ...
|
Revision tags: release/11.4.0, release/12.1.0, release/11.3.0 |
|
#
30e009fc |
| 19-Feb-2019 |
Enji Cooper <ngie@FreeBSD.org> |
MFhead@r344270
|
#
c981cbbd |
| 15-Feb-2019 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r343956 through r344177.
|
#
f6893f09 |
| 13-Feb-2019 |
Mark Johnston <markj@FreeBSD.org> |
Implement transparent 2MB superpage promotion for RISC-V.
This includes support for pmap_enter(..., psind=1) as described in the commit log message for r321378.
The changes are largely modelled aft
Implement transparent 2MB superpage promotion for RISC-V.
This includes support for pmap_enter(..., psind=1) as described in the commit log message for r321378.
The changes are largely modelled after amd64. arm64 has more stringent requirements around superpage creation to avoid the possibility of TLB conflict aborts, and these requirements do not apply to RISC-V, which like amd64 permits simultaneous caching of 4KB and 2MB translations for a given page. RISC-V's PTE format includes only two software bits, and as these are already consumed we do not have an analogue for amd64's PG_PROMOTED. Instead, pmap_remove_l2() always invalidates the entire 2MB address range.
pmap_ts_referenced() is modified to clear PTE_A, now that we support both hardware- and software-managed reference and dirty bits. Also fix pmap_fault_fixup() so that it does not set PTE_A or PTE_D on kernel mappings.
Reviewed by: kib (earlier version) Discussed with: jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18863 Differential Revision: https://reviews.freebsd.org/D18864 Differential Revision: https://reviews.freebsd.org/D18865 Differential Revision: https://reviews.freebsd.org/D18866 Differential Revision: https://reviews.freebsd.org/D18867 Differential Revision: https://reviews.freebsd.org/D18868
show more ...
|
Revision tags: release/12.0.0 |
|
#
2a22df74 |
| 04-Nov-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r339813 through r340125.
|
#
d198cb6d |
| 01-Nov-2018 |
John Baldwin <jhb@FreeBSD.org> |
Restrict setting PTE execute permissions on RISC-V.
Previously, RISC-V was enabling execute permissions in PTEs for any readable page. Now, execute permissions are only enabled if they were explici
Restrict setting PTE execute permissions on RISC-V.
Previously, RISC-V was enabling execute permissions in PTEs for any readable page. Now, execute permissions are only enabled if they were explicitly specified (e.g. via PROT_EXEC to mmap). The one exception is that the initial kernel mapping in locore still maps all of the kernel RWX.
While here, change the fault type passed to vm_fault and pmap_fault_fixup to only include a single VM_PROT_* value representing the faulting access to match other architectures rather than passing a bitmask.
Reviewed by: markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D17783
show more ...
|
#
c6879c6c |
| 23-Oct-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r339015 through r339669.
|
#
b977d819 |
| 18-Oct-2018 |
Ruslan Bukin <br@FreeBSD.org> |
Support RISC-V implementations that do not manage the A and D bits (e.g. RocketChip, lowRISC and derivatives).
RISC-V page table entries support A (accessed) and D (dirty) bits. The spec makes hardw
Support RISC-V implementations that do not manage the A and D bits (e.g. RocketChip, lowRISC and derivatives).
RISC-V page table entries support A (accessed) and D (dirty) bits. The spec makes hardware support for these bits optional. Implementations that do not manage these bits in hardware raise page faults for accesses to a valid page without A set and writes to a writable page without D set. Check for these types of faults when handling a page fault and fixup the PTE without calling vm_fault if they occur.
Reviewed by: jhb, markj Approved by: re (gjb) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17424
show more ...
|
#
3c8efd61 |
| 18-Oct-2018 |
Ruslan Bukin <br@FreeBSD.org> |
Revert r339421 due to unintended files included to commit.
Reported by: ian Approved by: re (gjb) Sponsored by: DARPA, AFRL
|
#
53c6ad1d |
| 18-Oct-2018 |
Ruslan Bukin <br@FreeBSD.org> |
Support RISC-V implementations that do not manage the A and D bits (e.g. RocketChip, lowRISC and derivatives).
RISC-V page table entries support A (accessed) and D (dirty) bits. The spec makes hardw
Support RISC-V implementations that do not manage the A and D bits (e.g. RocketChip, lowRISC and derivatives).
RISC-V page table entries support A (accessed) and D (dirty) bits. The spec makes hardware support for these bits optional. Implementations that do not manage these bits in hardware raise page faults for accesses to a valid page without A set and writes to a writable page without D set. Check for these types of faults when handling a page fault and fixup the PTE without calling vm_fault if they occur.
Reviewed by: jhb, markj Approved by: re (gjb) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17424
show more ...
|
Revision tags: release/11.2.0, release/10.4.0, release/11.1.0, release/11.0.1, release/11.0.0 |
|
#
27067774 |
| 16-Aug-2016 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r303250 through r304235.
|
#
98f50c44 |
| 02-Aug-2016 |
Ruslan Bukin <br@FreeBSD.org> |
Update RISC-V port to Privileged Architecture Version 1.9.
Sponsored by: DARPA, AFRL Sponsored by: HEIF5
|
Revision tags: release/10.3.0 |
|
#
82aa34e6 |
| 04-Mar-2016 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r296007 through r296368.
|
#
52259a98 |
| 02-Mar-2016 |
Glen Barber <gjb@FreeBSD.org> |
MFH
Sponsored by: The FreeBSD Foundation
|
#
14232d42 |
| 26-Feb-2016 |
Ruslan Bukin <br@FreeBSD.org> |
o Use uint64_t for page number as it doesn't fit uint32_t. o Implement growkernel bits for L1 level of pagetables.
This allows us to boot with 128GB of physical memory.
Sponsored by: DARPA, AFRL Sp
o Use uint64_t for page number as it doesn't fit uint32_t. o Implement growkernel bits for L1 level of pagetables.
This allows us to boot with 128GB of physical memory.
Sponsored by: DARPA, AFRL Sponsored by: HEIF5
show more ...
|
#
b626f5a7 |
| 04-Jan-2016 |
Glen Barber <gjb@FreeBSD.org> |
MFH r289384-r293170
Sponsored by: The FreeBSD Foundation
|
#
9a7cd2e6 |
| 22-Dec-2015 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
MFH @r292599
This includes the pluggable TCP framework and other chnages to the netstack to track for VNET stability.
Security: The FreeBSD Foundation
|
#
8d7e7a98 |
| 17-Dec-2015 |
Ruslan Bukin <br@FreeBSD.org> |
Import RISC-V machine headers. This is a minimal set required to compile kernel and userland.
Reviewed by: andrew, imp, kib Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https
Import RISC-V machine headers. This is a minimal set required to compile kernel and userland.
Reviewed by: andrew, imp, kib Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D4554
show more ...
|