opnsense-src/sys/arm64/include
Alan Cox 50e3ab6bcf Utilize ASIDs to reduce both the direct and indirect costs of context
switching.  The indirect costs being unnecessary TLB misses that are
incurred when ASIDs are not used.  In fact, currently, when we perform a
context switch on one processor, we issue a broadcast TLB invalidation that
flushes the TLB contents on every processor.

Mark all user-space ("ttbr0") page table entries with the non-global flag so
that they are cached in the TLB under their ASID.

Correct an error in pmap_pinit0().  The pointer to the root of the page
table was being initialized to the root of the kernel-space page table
rather than a user-space page table.  However, the root of the page table
that was being cached in process 0's md_l0addr field correctly pointed to a
user-space page table.  As long as ASIDs weren't being used, this was
harmless, except that it led to some unnecessary page table switches in
pmap_switch().  Specifically, other kernel processes besides process 0 would
have their md_l0addr field set to the root of the kernel-space page table,
and so pmap_switch() would actually change page tables when switching
between process 0 and other kernel processes.

Implement a workaround for Cavium erratum 27456 affecting ThunderX machines.
(I would like to thank andrew@ for providing the code to detect the affected
machines.)

Address integer overflow in the definition of TCR_ASID_16.

Setup TCR according to the PARange and ASIDBits fields from
ID_AA64MMFR0_EL1.  Previously, TCR_ASID_16 was unconditionally set.

Modify build_l1_block_pagetable so that lower attributes, such as ATTR_nG,
can be specified as a parameter.

Eliminate some unused code.

Earlier versions were tested to varying degrees by: andrew, emaste, markj

MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D21922
2019-11-03 17:45:30 +00:00
..
_align.h
_bus.h Bring in the start of the arm64 kernel. 2015-04-13 14:43:10 +00:00
_inttypes.h
_limits.h
_stdint.h
_types.h Do not include float interfaces when using libsa. 2018-02-23 04:04:25 +00:00
acpica_machdep.h Add support to find the arm64 serial using the ACPI tables. This uses the 2016-11-21 19:26:58 +00:00
armreg.h Utilize ASIDs to reduce both the direct and indirect costs of context 2019-11-03 17:45:30 +00:00
asm.h In ARMv8.1 ARM has added a process state bit to disable access to userspace 2017-04-13 13:46:01 +00:00
atomic.h arm64: fix atomic_fcmpset_16 2018-05-28 21:05:00 +00:00
bus.h Bring in the start of the arm64 kernel. 2015-04-13 14:43:10 +00:00
bus_dma.h Allow loading the same DMA address multiple times without any prior 2019-05-16 17:41:16 +00:00
bus_dma_impl.h Allow loading the same DMA address multiple times without any prior 2019-05-16 17:41:16 +00:00
clock.h Bring in the start of the arm64 kernel. 2015-04-13 14:43:10 +00:00
counter.h Centralize __pcpu definitions. 2019-08-29 07:25:27 +00:00
cpu.h Identify eMAG CPU used in Ampere Computing systems. 2019-08-26 16:12:14 +00:00
cpufunc.h Utilize ASIDs to reduce both the direct and indirect costs of context 2019-11-03 17:45:30 +00:00
db_machdep.h Fix printing of negative offsets (typically from frame pointers) again. 2017-03-26 18:46:35 +00:00
debug_monitor.h Update the debug monitor handling to work after userspace has started 2019-10-30 10:51:24 +00:00
disassem.h Framework for ARM64 instruction disassembler 2016-01-29 13:06:30 +00:00
dump.h Bring in the start of the arm64 kernel. 2015-04-13 14:43:10 +00:00
efi.h Catch exceptions during EFI RT calls on amd64. 2018-09-02 21:37:05 +00:00
elf.h gcore: Add aarch64 32-bit core support 2019-10-11 14:15:50 +00:00
endian.h Add parentheses missed in r320388 2017-06-27 16:30:01 +00:00
exec.h
float.h Rationalize BSD license on sys/*/include/float.h 2015-08-05 17:05:35 +00:00
floatingpoint.h add floatingpoint.h for arm64 2015-06-24 14:51:53 +00:00
fpu.h Add machine/fpu.h on arm64 for compatibility with amd64. 2017-10-10 13:02:58 +00:00
frame.h Impleent COMPAT_FREEBSD32 for arm64. 2019-01-13 19:49:46 +00:00
hypervisor.h Add the ARMv8.3 HCR_EL2 register fields. 2018-11-01 17:05:10 +00:00
ieeefp.h Fix the floating-point exception values to line up with the hardware 2015-06-24 12:19:49 +00:00
ifunc.h Remove resolver_qual from DEFINE_IFUNC/DEFINE_UIFUNC macros. 2019-05-16 22:20:54 +00:00
in_cksum.h Rationalize BSD license on sys/*/include/in_cksum.h 2015-08-05 19:05:12 +00:00
intr.h Create macros for the ACPI interrupt cross references. This is considered a 2018-03-07 13:16:03 +00:00
iodev.h Add basic support for ACPI. It splits out the nexus driver to two new 2015-06-11 15:45:33 +00:00
kdb.h Implement kdb_cpu_sync_icache on arm64. 2016-02-05 15:38:28 +00:00
machdep.h Remove physmap from the arm64 machdep.h. This was missed in r334162. 2018-05-24 16:07:47 +00:00
md_var.h Implement userspace gettimeofday(2) with HPET timecounter. 2016-08-17 09:52:09 +00:00
memdev.h Add memmmap on arm64 so we can mmap /dev/mem and /dev/kmem. 2016-07-13 23:03:34 +00:00
metadata.h loader.efi: Make framebuffer commands available for arm64 2017-10-25 18:55:04 +00:00
minidump.h Add the arm64 minidump header. This was missed from r286953. 2015-08-20 11:26:26 +00:00
ofw_machdep.h Make using the #address-cells property on the interrupt parent in device 2016-01-02 19:28:35 +00:00
param.h Add support for pmap_enter(psind = 1) to the arm64 pmap. 2018-07-20 16:37:04 +00:00
pcb.h Add support for setting hardware breakpoints from ptrace on arm64. 2019-11-03 15:42:08 +00:00
pci_cfgreg.h Implement stubs for ACPI PCI routines 2015-07-12 17:28:31 +00:00
pcpu.h Utilize ASIDs to reduce both the direct and indirect costs of context 2019-11-03 17:45:30 +00:00
pcpu_aux.h Centralize __pcpu definitions. 2019-08-29 07:25:27 +00:00
pmap.h Utilize ASIDs to reduce both the direct and indirect costs of context 2019-11-03 17:45:30 +00:00
pmc_mdep.h Add Performance Monitoring Counters support for AArch64. 2015-05-19 15:25:47 +00:00
proc.h Utilize ASIDs to reduce both the direct and indirect costs of context 2019-11-03 17:45:30 +00:00
procctl.h amd64 KPTI: add control from procctl(2). 2019-03-16 11:44:33 +00:00
profile.h SPDX: Consider code from Carnegie-Mellon University. 2017-11-30 15:48:35 +00:00
psl.h Add support for arm64 to loader.efi and boot1.efi 2015-04-14 13:55:01 +00:00
pte.h Ordinarily, during a superpage promotion or demotion within a pmap, the 2019-08-08 06:26:34 +00:00
ptrace.h Add more arm64 machine dependent headers. With this we now have the minimum 2015-03-26 21:10:42 +00:00
reg.h Add support for setting hardware breakpoints from ptrace on arm64. 2019-11-03 15:42:08 +00:00
reloc.h
resource.h Define PCI_RES_BUS for NEW_PCIB 2016-05-19 14:00:18 +00:00
runq.h
setjmp.h Move the stored signal mask later in the jump buf. It was being clobbered 2016-12-06 13:46:12 +00:00
sf_buf.h Bring in the start of the arm64 kernel. 2015-04-13 14:43:10 +00:00
sigframe.h Follow arm[32] and sparc64 KAPI and provide the FreeBSD standard spelling 2019-01-29 20:10:27 +00:00
signal.h
smp.h Rename COUNT_IPI to INTR_IPI_COUNT to reduce the diff with intrng. 2016-03-18 16:29:58 +00:00
stack.h Split out db_unwind_frame() so it can be used by DTrace. 2015-06-11 12:47:13 +00:00
stdarg.h Introduce an architecture-agnostic <sys/_stdarg.h> to reduce 2017-12-25 20:54:00 +00:00
sysarch.h Add more arm64 machine dependent headers. With this we now have the minimum 2015-03-26 21:10:42 +00:00
trap.h Bring in the start of the arm64 kernel. 2015-04-13 14:43:10 +00:00
ucontext.h Impleent COMPAT_FREEBSD32 for arm64. 2019-01-13 19:49:46 +00:00
undefined.h Allow the userspace ID register fields to be read from the kernel 2019-10-30 13:45:40 +00:00
vdso.h Add rudimentary support for building FreeBSD/arm64 with COMPAT_FREEBSD32. 2017-11-24 13:50:53 +00:00
vfp.h Impleent COMPAT_FREEBSD32 for arm64. 2019-01-13 19:49:46 +00:00
vm.h Add the VM_MEMATTR_WRITE_THROUGH memory type to arm64 and use it to support 2017-05-13 13:01:15 +00:00
vmparam.h Eliminate an unused declaration. The variable in question is only defined 2019-10-07 04:22:03 +00:00