Commit graph

596 commits

Author SHA1 Message Date
Andrew Turner
d546313602 arm64: Add CPTR_TRAP_ALL and use it in vmm
Add a new macro that enables all CPTR_EL2 traps. This helps ensure we
trap all extensions we don't support.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46516
2024-09-11 10:25:09 +00:00
Andrew Turner
9f3d15fda2 arm64: Add CPTR_E2H_TTA
The TTA field moves depending on the HCR_EL2.E2H field. Add a macro to
hold the E2H == 1 case.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46515
2024-09-11 10:25:09 +00:00
Andrew Turner
16e661921a arm64: Add E2H to CPTR_EL2 register values
Rename register fields that are only valid when HCR_EL2.E2H == 1. Some
fields move around depending on the value of the E2H field.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46514
2024-09-11 10:25:09 +00:00
Andrew Turner
7a488d83b3 arm64: Adjust the indentation of CPTR_EL2 values
Reviewed by:	emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46513
2024-09-11 10:25:08 +00:00
Zachary Leaf
610348a904 arm64: add additional MDCR_EL2 fields
Monitor Debug Configuration Register provides EL2 configuration options
for self-hosted debug and the Performance Monitors Extension.

Reviewed by:	andrew
Sponsored by:   Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46191
2024-09-09 15:56:53 +00:00
Andrew Turner
d52c319042 arm64: Make shareability attributes dynamic
When LPA2 is enabled the shareability attribute in the page table are
replaces with output address bits. To support a larger physical address
space make this attribute dynamic so we only set it when appropriate.

Reviewed by:	alc, kib
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46394
2024-09-05 13:12:17 +01:00
Andrew Turner
e2990a9ee4 arm64: Remove ATTR_DEFAULT from pte.h
ATTR_SH(ATTR_SH_IS) will soon be dynamic as the field is moved out of
the page tables in FEAT_LPA2. When this happens ATTR_DEFAULT will just
be ATTR_AF.

Rather than keeping ATTR_DEFAULT with one attribute remove it.

Reviewed by:	alc, kib, markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46466
2024-09-05 13:12:17 +01:00
Andrew Turner
3a3aa2cc07 arm64: Remove TCR_CACHE_ATTRS and TCR_SMP_ATTRS
These are only used in one place so expand them there.

While here always set TCR_SH0_IS and TCR_SH1_IS. There is no advantage
to not set them in a UP kernel.

Reviewed by:	alc, kib, markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46393
2024-09-05 13:12:16 +01:00
Andrew Turner
7be11454ed arm64: Add the tcr_el2 ds field
This will be used to support FEAT_LPA2 to allow more than 48 bits of
physical address space.

Reviewed by:	alc, kib, markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46392
2024-09-05 13:12:16 +01:00
Mark Johnston
133a513ddc vmm: Make vmm_dev.h more self-contained
vmm.h is required for VM_MAX_SUFFIXLEN.  vmm_snapshot.h is required for
struct vm_snapshot_meta.

This is a prerequisite for including vmm_dev.h in the headers parsed by
libsysdecode.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D46485
2024-09-01 14:03:15 +00:00
Mark Johnston
780675e1be arm64: Fix the VM_MAX_NAMELEN definition
The maximum VM name length has changed since the arm64 vmm code was
forked.  For now, just sync with the amd64 definitions, since they
permit longer VM names.  As arm64/vmm is implemented only in main, I
won't bother dealing with backward compat.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D46484
2024-09-01 14:03:15 +00:00
Andrew Turner
8b01728431 arm64: Fix the ESR_EL1_op2 value
This leads to an unallocated register. Fix the value to point to
ESR_EL1.

Sponsored by:	Arm Ltd
2024-08-29 10:42:34 +00:00
Mark Johnston
b9ef152bec vmm: Merge vmm_dev.c
This file contains the vmm device file implementation.  Most of this
code is not machine-dependent and so shouldn't be duplicated this way.
Move most of it into a generic dev/vmm/vmm_dev.c.  This will make it
easier to introduce a cdev-based interface for VM creation, which in
turn makes it possible to implement support for running bhyve as an
unprivileged user.

Machine-dependent ioctls continue to be handled in machine-dependent
code.  To make the split a bit easier to handle, introduce a pair of
tables which define MI and MD ioctls.  Each table entry can set flags
which determine which locks need to be held in order to execute the
handler.  vmmdev_ioctl() now looks up the ioctl in one of the tables,
acquires locks and either handles the ioctl directly or calls
vmmdev_machdep_ioctl() to handle it.

No functional change intended.  There is a lot of churn in this change
but the underlying logic in the ioctl handlers is the same.  For now,
vmm_dev.h is still mostly separate, even though some parts could be
merged in principle.  This would involve changing include paths for
userspace, though.

Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D46431
2024-08-26 18:41:39 +00:00
Andrew Turner
db6e3260a8 arm64: Remove the E2H check from has_hyp
This was added to not use the physical timer when E2H was set. As we
now use the correct timer in this case we can remove this extra check.

Tested by:	kevans
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46086
2024-08-21 08:46:59 +00:00
Andrew Turner
a745cdc19b arm64/vmm: Teach the vtimer about VHE
Teach the virtual timer about the cnthctl_el2 field layout under VHE.
As with non-VHE we need to trap the physical timer and not trap the
virtual timer.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46074
2024-08-20 08:49:15 +00:00
Andrew Turner
4db15ab2c6 arm64: Add counter timer registers to armreg.h
Reviewed by:	imp
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46071
2024-08-20 08:49:15 +00:00
Andrew Turner
7a345763f9 arm64: Expand the use of Armv8.1-A atomics
When targeting Armv8.1 we can assume FEAT_LSE is available and can use
the atomic instructions this provides without needing to check for
support first.

Reviewed by:	imp, markj, emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46159
2024-08-19 10:53:12 +00:00
Bjoern A. Zeeb
d1bdc2821f Deprecate contigfree(9) in favour of free(9)
As of 9e6544dd6e contigfree(9) is no longer
needed and should not be used anymore.  We leave a wrapper for 3rd party
code in at least 15.x but remove (almost) all other cases from the tree.

This leaves one use of contigfree(9) untouched; that was the original
trigger for 9e6544dd6e and is handled in D45813 (to be committed
seperately later).

Sponsored by:	The FreeBSD Foundation
Reviewed by:	markj, kib
Tested by:	pho (10h stress test run)
Differential Revision: https://reviews.freebsd.org/D46099
2024-07-26 10:45:01 +00:00
Andrew Turner
034c83fd7d arm64: Ensure sctlr and pstate are in known states
Before entering the kernel exception level ensure sctlr_el2 and
sctlr_el1 are in a known state. The EOS flag needs to be set to ensure
an eret instruction is a context synchronization event.

Set spcr_el1 when entering the kernel from EL1 and use an eret
instruction to return to the caller. This ensures the CPU pstate is
consistent with the value in spcr_el1 as it is the only way to set it
directly.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45528
2024-07-23 09:25:05 +00:00
Andrew Turner
997511dffe arm64: Support counter access with E2H
When entering the kernel with the E2H field set the layout of the
cnthctl_el2 register changes. Use the correct field locations to enable
access to the counter and timer registers from EL1.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45529
2024-07-23 09:25:05 +00:00
Andrew Turner
47361851bc arm64: Add EL1 and EL12 register alt names
When adding VHE support we may need to access these registers using
the _EL12 or _EL1 name depending on if VHE is enabled or not.

Add the registers we will likely need to access from VHE so these can
be updated in the guest switcher code.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45525
2024-07-23 09:25:05 +00:00
Jessica Clarke
8415a654d0 Retire non-NEW_PCIB code and remove config option
All architectures enable NEW_PCIB in DEFAULTS (arm being the most recent
to do so in 121be55599 (arm: Set NEW_PCIB in DEFAULTS rather than a
subset of kernel configs")), so it's time we removed the legacy code
that no longer sees much testing and has a significant maintenance
burden.

Reviewed by:	jhb, andrew, emaste
Differential Revision:	https://reviews.freebsd.org/D32954
2024-07-18 18:55:12 +01:00
Alan Cox
3e00c11a4f arm64: Support the L3 ATTR_CONTIGUOUS page size in pagesizes[]
Update pagesizes[] to include the L3 ATTR_CONTIGUOUS (L3C) page size,
which is 64KB when the base page size is 4KB and 2MB when the base page
size is 16KB.

Add support for L3C pages to shm_create_largepage().

Add support for creating L3C page mappings to pmap_enter(psind=1).

Add support for reporting L3C page mappings to mincore(2) and
procstat(8).

Update vm_fault_soft_fast() and vm_fault_populate() to handle multiple
superpage sizes.

Declare arm64 as supporting two superpage reservation sizes, and
simulate two superpage reservation sizes, updating the vm_page's psind
field to reflect the correct page size from pagesizes[].  (The next
patch in this series will replace this simulation.  This patch is
already big enough.)

Co-authored-by:	Eliot Solomon <ehs3@rice.edu>
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D45766
2024-07-13 12:43:42 -05:00
Mark Johnston
ddf0ed09bd sdt: Implement SDT probes using hot-patching
The idea here is to avoid a memory access and conditional branch per
probe site.  Instead, the probe is represented by an "unreachable"
unconditional function call.  asm goto is used to store the address of
the probe site (represented by a no-op sled) and the address of the
function call into a tracepoint record.  Each SDT probe carries a list
of tracepoints.

When the probe is enabled, the no-op sled corresponding to each
tracepoint is overwritten with a jmp to the corresponding label.  The
implementation uses smp_rendezvous() to park all other CPUs while the
instruction is being overwritten, as this can't be done atomically in
general.  The compiler moves argument marshalling code and the
sdt_probe() function call out-of-line, i.e., to the end of the function.

Per gallatin@ in D43504, this approach has less overhead when probes are
disabled.  To make the implementation a bit simpler, I removed support
for probes with 7 arguments; nothing makes use of this except a
regression test case.  It could be re-added later if need be.

The approach taken in this patch enables some more improvements:
1. We can now automatically fill out the "function" field of SDT probe
   names.  The SDT macros let the programmer specify the function and
   module names, but this is really a bug and shouldn't have been
   allowed.  The intent was to be able to have the same probe in
   multiple functions and to let the user restrict which probes actually
   get enabled by specifying a function name or glob.
2. We can avoid branching on SDT_PROBES_ENABLED() by adding the ability
   to include blocks of code in the out-of-line path.  For example:

	if (SDT_PROBES_ENABLED()) {
		int reason = CLD_EXITED;

		if (WCOREDUMP(signo))
			reason = CLD_DUMPED;
		else if (WIFSIGNALED(signo))
			reason = CLD_KILLED;
		SDT_PROBE1(proc, , , exit, reason);
	}

could be written

	SDT_PROBE1_EXT(proc, , , exit, reason,
		int reason;

		reason = CLD_EXITED;
		if (WCOREDUMP(signo))
			reason = CLD_DUMPED;
		else if (WIFSIGNALED(signo))
			reason = CLD_KILLED;
	);

In the future I would like to use this mechanism more generally, e.g.,
to remove branches and marshalling code used by hwpmc, and generally to
make it easier to add new tracepoint consumers without having to add
more conditional branches to hot code paths.

Reviewed by:	Domagoj Stolfa, avg
MFC after:	2 months
Differential Revision:	https://reviews.freebsd.org/D44483
2024-06-19 16:57:41 -04:00
Mark Johnston
4441dd4094 vm_phys: Fix a typo
Fixes:	b16b4c22d2 ("vm_page: Implement lazy page initialization")
Reported by:	Steffen Nurpmeso <steffen@sdaoden.eu>
2024-06-16 13:33:00 -04:00
Mark Johnston
d730cdea2a arm64/vmm: Avoid unnecessary indirection in vmmops_modinit()
Most of vmm.h is machine-independent.  Simplify merging amd64 and arm64
vmm code by removing this machine-dependent routine from arm64's vmm.h.
No functional change intended.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D45557
2024-06-13 21:19:00 -04:00
Mark Johnston
a03354b002 arm64/vmm: Implement vm_disable_vcpu_creation()
No functional change intended.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D45556
2024-06-13 21:19:00 -04:00
Mark Johnston
b16b4c22d2 vm_page: Implement lazy page initialization
FreeBSD's boot times have decreased to the point where vm_page array
initialization represents a significant fraction of the total boot time.
For example, when booting FreeBSD in Firecracker (a VMM designed to
support lightweight VMs) with 128MB and 1GB of RAM, vm_page
initialization consumes 9% (3ms) and 37% (21.5ms) of the kernel boot
time, respectively.  This is generally relevant in cloud environments,
where one wants to be able to spin up VMs as quickly as possible.

This patch implements lazy initialization of (most) page structures,
following a suggestion from cperciva@.  The idea is to introduce a new
free pool, VM_FREEPOOL_LAZYINIT, into which all vm_page structures are
initially placed.  For this to work, we need only initialize the first
free page of each chunk placed into the buddy allocator.  Then, early
page allocations draw from the lazy init pool and initialize vm_page
chunks (up to 16MB, 4096 pages) on demand.  Once APs are started, an
idle-priority thread drains the lazy init pool in the background to
avoid introducing extra latency in the allocator.  With this scheme,
almost all of the initialization work is moved out of the critical path.

A couple of vm_phys operations require the pool to be drained before
they can run: vm_phys_find_range() and vm_phys_unfree_page().  However,
these are rare operations.  I believe that
vm_phys_find_freelist_contig() does not require any special treatment,
as it only ever accesses the first page in a power-of-2-sized free page
chunk, which is always initialized.

For now the new pool is only used on amd64 and arm64, since that's where
I can easily test and those platforms would get the most benefit.

Reviewed by:	alc, kib
Differential Revision:	https://reviews.freebsd.org/D40403
2024-06-13 21:19:00 -04:00
Andrew Turner
a30149b2a9 arm64: Create a version of vfp_save_state for cpu_switch
This will be used when we add SVE support to reduce the registers
needed to be saved on context switch.

Reviewed by:	imp
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D43305
2024-06-12 14:09:14 +01:00
Andrew Turner
86bafddd61 arm64: Fix indentation to be consistent
Adjust the mair_el1 macro indentation to be consistent with the
surrounding macros.

Reviewed by:	emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45524
2024-06-10 15:16:10 +00:00
Mark Johnston
75cb949228 arm64/vmm: Add breakpoint and single-stepping support
This will be used to implement parts of bhyve's gdb stub.

Three VM capabilities are added, similar to amd64 without monitor mode.
Two cause breakpoint and single-step exceptions to be raised to EL2 and
then down to bhyve.  One lets the gdb stub mask hardware interrupts
while single-stepping, since otherwise the guest will handle a timer
interrupt before executing the target instruction and thus fail
to make progress.

Reviewed by:	bnovkov, andrew
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D44739
2024-06-04 14:58:08 -04:00
Bojan Novković
0a44b8a56d vm: Simplify startup page dumping conditional
This commit introduces the MINIDUMP_STARTUP_PAGE_TRACKING symbol and
uses it to simplify several instances of a complex preprocessor conditional
for adding pages allocated when bootstraping the kernel to minidumps.

Reviewed by:	markj, mhorne
Approved by:	markj (mentor)
Differential Revision: https://reviews.freebsd.org/D45085
2024-05-25 19:24:55 +02:00
Bojan Novković
da76d349b6 uma: Deduplicate uma_small_alloc
This commit refactors the UMA small alloc code and
removes most UMA machine-dependent code.
The existing machine-dependent uma_small_alloc code is almost identical
across all architectures, except for powerpc where using the direct
map addresses involved extra steps in some cases.

The MI/MD split was replaced by a default uma_small_alloc
implementation that can be overridden by architecture-specific code by
defining the UMA_MD_SMALL_ALLOC symbol. Furthermore, UMA_USE_DMAP was
introduced to replace most UMA_MD_SMALL_ALLOC uses.

Reviewed by: markj, kib
Approved by: markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D45084
2024-05-25 19:24:46 +02:00
Mitchell Horne
1d3c23676d arm64, riscv: remove unused declaration
It is inherited from arm, where the global exists and is used. No
functional change.

Reviewed by:	markj
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45323
2024-05-24 10:55:24 -03:00
Mitchell Horne
b5e17840de arm64, riscv: removed unused struct pv_addr
No functional change.

Reviewed by:	markj
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45322
2024-05-24 10:55:24 -03:00
Alan Cox
9fc5e3fb39 arm64: set ATTR_CONTIGUOUS on the DMAP's L2 blocks
On systems configured with 16KB pages, this change creates 1GB page
mappings in the direct map where possible.  Previously, the largest page
size that was used to implement the direct map was 32MB.  Similarly, on
systems configured with 4KB pages, this change creates 32MB page
mappings, instead of 2MB, in the direct map where 1GB is too large.

Implement demotion on L2C (32MB/1GB) page mappings within the DMAP.

Update sysctl vm.pmap.kernel_maps to report on L2C page mappings.

Reviewed by:	markj
Tested by:	gallatin, Eliot Solomon <ehs3@rice.edu>
Differential Revision:	https://reviews.freebsd.org/D45224
2024-05-22 22:09:43 -05:00
Andrew Turner
57d714a23f arm64: Add the pointer auth registers to armreg.h
Add the pointer authentication registers to armreg.h. These will be
used to support pointer authentication in a kernel built with GCC.

Reviewed by:	jhb
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45262
2024-05-22 08:18:54 +00:00
Andrew Turner
29c1cf9860 arm64: Use the UL macro in TCR_EL1 defines
While clang can handle numbers with a UL suffix in assembly files
gcc/gas is unable to. Switch to use the UL macro for TCR_EL1 defines as
some are used in locore.S

Reviewed by:	brooks, jhb
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45261
2024-05-22 08:18:39 +00:00
Zachary Leaf
4f8ba1c9dd arm64: add CONTEXTIDR_EL1 reg
CONTEXTIDR_EL1 is used in debug and trace features to identify the
current process or context.

Reviewed by:	andrew
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45173
2024-05-17 15:46:27 +01:00
Zachary Leaf
10b3eac88d arm64: add PMBSR_MSS_{BSC,FSC} status code field
Bits [5:0] of PMBSR_MSS encodes either Buffer Status Code (BSC) or Fault
Status Code (FSC) depending on PMBSR_EC value.

Add PMBSR_MSS_{BSC,FSC} to cover this field.

Reviewed by:	andrew
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45172
2024-05-17 15:46:00 +01:00
Zachary Leaf
f7bdaa103e arm64: make SPE regs use ALT_NAME macro
When the register is not defined in Armv8.0 i.e. added in a later
extension, like SPE added in v8.2, the alternative name format of:
    S<op0>_<op1>_C<crn>_C<crm>_<op2>
should be used; otherwise, calls to {READ,WRITE}_SPECIALREG() will
fail.

Use the MRS_REG_ALT_NAME() macro for SPE changing hex to decimal as
required by the macro.

Reviewed by:	andrew
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45171
2024-05-17 15:45:44 +01:00
Andrew Turner
d6d860c7ff arm64: Add MRS_REG_ALT_NAME ID register macros
These can be used even when the compiler is too old for the register
to be included.

Reviewed by:	Zachary Leaf <zachary.leaf@arm.com>
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45176
2024-05-17 09:38:17 +00:00
Andrew Turner
e353ac0cfd am64: Allow cpu.h to be included from assembly
Reviewed by:	jhibbits, kevans
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45081
2024-05-10 09:29:24 +00:00
Andrew Turner
9d40492efa arm64: Check DMAP address is valid in PHYS_IN_DMAP
When checking if a physical address is in the DMAP region we assume
all physical addresses between DMAP_MIN_PHYSADDR and DMAP_MAX_PHYSADDR
are able to be accesses through the DMAP. It may be the case that
there is device memory in this range that shouldn't be accessed through
the DMAP mappings.

Add a check to PHYS_IN_DMAP that the translated virtual address is a
valid kernel address. To support code that already checks the address
is valid add PHYS_IN_DMAP_RANGE.

PR:		278233
Reviewed by:	alc, markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D44677
2024-04-24 18:17:19 +00:00
Andrew Turner
f242c47ee2 arm64: Support hardware breakpoints
As with watchpoints allow the kernel debugger to set hardware
breakpoints on arm64.

These have been tested to work in both the ddb and gdb backends.

Reviewed by:	jhb (earlier version)
Sponsored by:	Arm Ltd
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D44355
2024-04-12 09:32:56 +00:00
Stephen J. Kiernan
3bbe8ed1a7 arm64: Add a CPU reset hook instead of expecting PSCI
Some SoCs do not include a PSCI for power management and defer it to
something else instead. Add a CPU reset hook to account for this, and
use it in the psci driver.

Reviewed by:	andrew
Obtained from:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D44535
2024-04-05 17:37:15 -04:00
Lexi Winter
da2b732288 arm64: add CPU part identifiers for Apple M1 and M2
Part numbers are sourced from Linux (arch/arm64/include/asm/cputype.h).

MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1144
2024-04-05 14:18:32 -04:00
Eliot Solomon
fd6cb031f5 arm64 pmap: Add ATTR_CONTIGUOUS support [Part 1]
The ATTR_CONTIGUOUS bit within an L3 page table entry designates that
L3 page as being part of an aligned, physically contiguous collection
of L3 pages.  For example, 16 aligned, physically contiguous 4 KB pages
can form a 64 KB superpage, occupying a single TLB entry.  While this
change only creates ATTR_CONTIGUOUS mappings in a few places,
specifically, the direct map and pmap_kenter{,_device}(), it adds all
of the necessary code for handling them once they exist, including
demotion, protection, and removal.  Consequently, new ATTR_CONTIGUOUS
usage can be added (and tested) incrementally.

Modify the implementation of sysctl vm.pmap.kernel_maps so that it
correctly reports the number of ATTR_CONTIGUOUS mappings on machines
configured to use a 16 KB base page size, where an ATTR_CONTIGUOUS
mapping consists of 128 base pages.

Additionally, this change adds support for creating L2 superpage
mappings to pmap_kenter{,_device}().

Reviewed by:	markj
Tested by:	gallatin
Differential Revision:	https://reviews.freebsd.org/D42737
2024-03-30 13:37:17 -05:00
Jessica Clarke
d5aead83df arm64: Delete stale comment
Fixes:	078a69abcb ("Use a uint64_t to store the arm64 mpidr")
2024-03-27 15:43:38 -04:00
Eliot Solomon
9fabf97682 arm64: fix free queue and reservation configuration for 16KB pages
Correctly configure the free page queues and the reservation size when
the base page size is 16KB.  In particular, the reservation size was
less than the L2 Block size, making L2 promotions and mappings all but
impossible.

Reviewed by:	markj
Tested by:	gallatin
Differential Revision:	https://reviews.freebsd.org/D42737
2024-03-24 12:22:20 -05:00