aboutsummaryrefslogtreecommitdiff
path: root/sys/arm64
Commit message (Collapse)AuthorAgeFilesLines
* arm64: Include NUMA locality info in the CPU topologyMark Johnston2021-02-181-1/+28
| | | | | | | | | | | | | The scheduler uses this topology to try and preserve locality when migrating threads between CPUs and when performing work stealing. Ensure that on NUMA systems it will at least take the NUMA topology into account. Reviewed by: mmel Submitted by: Klara, Inc. Sponsored by: Ampere Computing MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28579
* Add a VA_IS_CLEANMAP() macro.John Baldwin2021-02-181-1/+1
| | | | | | | | | | | | | | This macro returns true if a provided virtual address is contained in the kernel's clean submap. In CHERI kernels, the buffer cache and transient I/O map are allocated as separate regions. Abstracting this check reduces the diff relative to FreeBSD. It is perhaps slightly more readable as well. Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D28710
* gicv3_its: Don't restrict target CPUs based on SRATD Scott Phillips2021-02-171-17/+34
| | | | | | | | | | | | | | | | | | | | | | ACPI Sec 5.2.16.5 (SRAT, GIC Interrupt Translation Service (ITS) Affinity Structure) says: > The GIC ITS Affinity Structure provides the association between > a GIC ITS and a proximity domain. This enables the OSPM to > discover the memory that is closest to the ITS, and use that in > allocating its management tables and command queue. Previously the ITS driver was using the proximity domain to restrict which CPUs can be targeted by an LPI. We keep that logic just for the original dual socket ThunderX which cannot forward LPIs between sockets. We also use the SRAT entry for its intended purpose of attempting to allocate ITS table structures near the ITS. Reviewed by: andrew Sponsored by: Ampere Computing LLC Differential Revision: https://reviews.freebsd.org/D28340
* gicv3_its: Leave LPI interrupts enabled during handlingD Scott Phillips2021-02-171-2/+0
| | | | | | | | | | | | This follows the behavior on x86 where edge triggered interrupts are not disabled when executing the handler. Because the ITS is a shared resource, contention for the command queue lock can be substantial. Suggested by: gallatin Reviewed by: andrew Tested by: gallatin Sponsored by: Ampere Computing LLC Differential Revision: https://reviews.freebsd.org/D28709
* arm64: use macros to access special register valuesMitchell Horne2021-02-171-2/+4
|
* arm64: extend struct db_reg to include watchpoint registersMitchell Horne2021-02-174-16/+92
| | | | | | | | | | | | | | | | | | | The motivation is to provide access to these registers from userspace via ptrace(2) requests PT_GETDBREGS and PT_SETDBREGS. This change breaks the ABI of these particular requests, but is justified by the fact that the intended consumers (debuggers) have not been taught to use them yet. Making this change now enables active upstream work on lldb to begin using this interface, and take advantage of the hardware debugging registers available on the platform. PR: 252860 Reported by: Michał Górny (mgorny@gentoo.org) Reviewed by: andrew, markj (earlier version) Tested by: Michał Górny (mgorny@gentoo.org) MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28415
* arm64: handle watchpoint exceptions from EL0Mitchell Horne2021-02-172-0/+7
| | | | | | | | | | | | | | | | | This is a prerequisite to allowing the use of hardware watchpoints for userspace debuggers. This is also a slight departure from the x86 behaviour, since `si_addr` returns the data address that triggered the watchpoint, not the address of the instruction that was executed. Otherwise, there is no straightforward way for the application to determine which watchpoint was triggered. Make a note of this in the siginfo(3) man page. Reviewed by: jhb, markj (earlier version) Tested by: Michał Górny (mgorny@gentoo.org) MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28561
* arm64: validate breakpoint registersMitchell Horne2021-02-172-4/+50
| | | | | | | | | | | In particular, we want to disallow setting breakpoints on kernel addresses from userspace. The control register fields are validated or ignored as appropriate. Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28560
* linux: Unmap the VDSO page when unloadingMark Johnston2021-02-161-1/+2
| | | | | | | | | | | linux_shared_page_init() creates an object and grabs and maps a single page to back the VDSO. When destroying the VDSO object, we failed to destroy the mapping and free KVA. Fix this. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28696
* arm64: Add a SOC_BRCM_NS2 optionEmmanuel Vadot2021-02-101-0/+1
| | | | | | | | Only compile files needed for this platform if the option is enabled in the kernel config file. Add the option to GENERIC. MFC after: 3 days
* arm64: optimize set_syscall_retval()Edward Tomasz Napierala2021-02-081-3/+5
| | | | | | | | | Microoptimize set_syscall_retval() for arm64 by predicting the return value to be zero. This is similar to what has been done for other architectures Reviewed By: emaste, mhorne Differential Revision: https://reviews.freebsd.org/D26991
* Add support for arm64 nGnRE device memoryAndrew Turner2021-02-053-3/+8
| | | | | | | | | | | | | | | | | | On arm64 we can select how strongly we order device memory. Currently we use the strongest type of non-Gathering, non-Reordering, no Early write acknowledgement. This is equivalent to VM_MEMATTR_SO in the 32-bit arm code. Create a new memory type to remove the no Early write acknowledgement option to create a memory attribute that is equivalent to the arm VM_MEMATTR_DEVICE. Keep the the old nGnRnE memory as what we provide for VM_MEMATTR_DEVICE until we can test nGnRE on more hardware. A method for dynamically switching back may be needed as at least one vendor is known to have broken nGnRE memory. Sponsored by: Innovate UK
* Enable pvscsi and vmx in arm64 GENERICEd Maste2021-02-051-0/+2
| | | | | | | | | | FreeBSD pvscsi and vmx work with VMware ESXi Arm "Fling"; provide these in GENERIC for a convenient out-of-the-box experience. PR: 253202 Reported by: Vincent Milum Jr MFC after: 3 days Sponsored by: The FreeBSD Foundation
* arm64: Initialize VFP control register.Michal Meloun2021-02-034-0/+32
| | | | | | The RW fields in this register reset to architecturally unknown values, so initialize these to the proper rounding and denormal mode. MFC after: 1 week
* arm64: Improve DDB backtrace supportJessica Clarke2021-02-016-31/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | The existing implementation relies on each trap handler saving a normal stack frame record, which is a waste of time and space when we're already saving a trapframe to the stack. It's also wrong as it currently saves LR not ELR. Instead of patching it up, rewrite it based on the RISC-V implementation with inspiration from the amd64 implementation for how to handle vectored traps to provide an improved implementation. This includes compressing the information down to one line like other architectures rather than the highly-verbose old form that repeats itself by printing LR and FP in one frame only to print them as PC and SP in the next. It also includes printing out actually useful information about the traps that occurred, though FAR is not saved in the trapframe so we cannot print it (in general it can be clobbered between when the trap happened and now), only ESR. The AAPCS also allows the stack frame record to be located anywhere in the frame, not just the top, so the caller's SP is not at a fixed offset from the callee's FP like on almost all other architectures in existence. This means there is no way to derive the caller's SP in the unwinder, and so we have to drop that bit of (unused) state everywhere. Reviewed by: jhb, markj Differential Revision: https://reviews.freebsd.org/D28026
* Enable KERN_TLS by default in ARM64 GENERICAllan Jude2021-01-281-0/+1
| | | | | Sponsored-by: Ampere Computing Submitted-by: Klara, Inc.
* gic_v3: add message based interrupts supportCyprien Laplace2021-01-253-3/+226
| | | | Pull Request: https://github.com/freebsd/freebsd-src/pull/451
* gic_v3: Use 64-bit writes to GICD_IROUTERnCyprien Laplace2021-01-251-3/+3
| | | | | | | While 32-bit accesses to GICD_IROUTERn are allowed, this is a 64-bit register. Pull Request: https://github.com/freebsd/freebsd-src/pull/451
* arm64: fix typo in file name in GENERIC-MMCCAM-NODEBUGMateusz Guzik2021-01-221-1/+1
|
* Handle arm64 undefied instructions on msr exceptionsAndrew Turner2021-01-201-2/+8
| | | | | | | | | | | | When userspace tries to access a special register that it doesn't have access to the kernel receives an exception. On most cores this exception has been observed to be the undefined instruction exception, however on the Apple M1 under a QEMU based hypervisor it can be the MSR exception. Handle this second case by also running the undefined exception handler on these exceptions. Sponsored by: Innovate UK
* arm64, riscv: Set VM_KMEM_SIZE_SCALE to 1Mark Johnston2021-01-201-8/+1
| | | | | | | | | | | | | | | | This setting limits the amount of memory that can be allocated to UMA. On systems with a direct map and ample KVA, however, there is no reason for VM_KMEM_SIZE_SCALE to be larger than 1. This appears to have been inherited from the 32-bit ARM platform definitions. Also remove VM_KMEM_SIZE_MIN, which is not needed when VM_KMEM_SIZE_SCALE is defined to be 1.[*] Reviewed by: alc, kp, kib Reported by: alc [*] Submitted by: Klara, Inc. Sponsored by: Ampere Computing Differential Revision: https://reviews.freebsd.org/D28225
* arm64: Stop setting VM_BCACHE_SIZE_MAXMark Johnston2021-01-201-9/+0
| | | | | | | | | | | This setting places a (small) limit on the size of the buffer cache, constraining UFS performance on large servers. The setting comes from the initial arm64 implementation and appears to be vestigal. Remove it. Reviewed by: kib Submitted by: Klara, Inc. Sponsored by: Ampere Computing Differential Revision: https://reviews.freebsd.org/D28162
* Add a new FreeBSD/arm64 kernel configuration, GENERIC-MMCCAM-NODEBUG,Robert Watson2021-01-191-0/+13
| | | | | | | which is the same as GENERIC-MMCCAM but using a nodebug baseline. Reviewed by: andrew, br (earlier version), jrtc27 (earlier version) Differential revision: https://reviews.freebsd.org/D28091
* arm64: Clear FPU flags in the pcb in cpu_copy_thread().John Baldwin2021-01-191-0/+1
| | | | | | | | New threads start off with clean FPU state instead of inheriting state from the parent thread. PR: 247945 Sponsored by: Netflix
* arm64: Trim duplicate code from cpu_fork_kthread_handler().John Baldwin2021-01-191-4/+0
| | | | | | | | cpu_fork_kthread_handler() is always called after either cpu_fork() or cpu_copy_thread(). The arm64 version was duplicating some of the work already done by both of those functions. Sponsored by: Netflix
* arm64 busdma: Fix loading of small bounced buffers.Michal Meloun2021-01-191-17/+16
| | | | | | | | | | - Don't oversize the buffer fragment. PAGE_SIZE - (curaddr & PAGE_MASK) may be greater than the total length of the buffer. - Don't use roundup2(len, alignment) to calculate the buffer fragment size. The length of current bounced fragment is not subject to alignment restriction, and next fragment should start at the page boundary. Tested by: bz, s199p.wa1k9r@gmail.com
* make maximum interrupt number tunable on ARM, ARM64, MIPS, and RISC-VOleksandr Tymoshenko2021-01-191-1/+2
| | | | | | | | | | | | Use a machdep.nirq tunable intead of compile-time constant NIRQ as a value for maximum number of interrupts. It allows keep a system footprint small by default with an option to increase the limit for large systems like server-grade ARM64 Reviewd by: mhorne Differential Revision: https://reviews.freebsd.org/D27844 Submitted by: Klara, Inc. Sponsored by: Ampere Computing
* Extract the logic from pmap_kextractAndrew Turner2021-01-153-13/+62
| | | | | | | | | | This allows us to use it when we only need to check if the virtual address is valid. For example when checking if an address in the DMAP region is mapped. Reviewed by: kib, markj Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D27621
* arm64: Directly use #include <dt-binding/...>Emmanuel Vadot2021-01-158-9/+9
| | | | | We have it in the includes path and this will help the transition to the new device-tree import in sys/contrib
* Split out the NODEBUG options to a common fileAndrew Turner2021-01-141-11/+1
| | | | | | | | This is the superset of the nooptions found in the -DEBUG kernels. Reviewed by: emaste, manu Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D28152
* Enable accelerated AES-XTS software crypto in GENERIC.John Baldwin2021-01-131-0/+1
| | | | | | | | | | | | | | | In particular, using GELI on a root filesystem will only use accelerated software crypto drivers if they are available before the root filesystem is mounted. While these modules can be loaded from the loader, including them in GENERIC provides a better out-of-the-box experience for users. Both aesni(4) and armv8crypto(4) provide accelerated implementations of the default cipher used by GELI (AES-XTS) in addition to other ciphers. Reviewed by: mhorne, allanjude, markj Differential Revision: https://reviews.freebsd.org/D28100
* Switch the arm64 pcpu to a global register variableAndrew Turner2021-01-131-11/+6
| | | | | | | | | This removes an unneeded instruction to move the pointer from x18 to a temporary register. Reviewed by: emaste Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D26971
* arm64: Add armv8crpyto and ossl to NOTES.John Baldwin2021-01-111-0/+4
| | | | | Reviewed by: mhorne Differential Revision: https://reviews.freebsd.org/D28099
* arm64: Don't disable options GDB in LINT.John Baldwin2021-01-111-2/+0
| | | | | Reviewed by: mhorne Differential Revision: https://reviews.freebsd.org/D28098
* cgem: add 64-bit supportThomas Skibo2021-01-101-0/+1
| | | | | | | | Add 64-bit address support to Cadence CGEM Ethernet driver for use in other SoCs such as the Zynq UltraScale+ and SiFive HighFive Unleashed. Reviewed by: philip, 0mp (manpages) Differential Revision: https://reviews.freebsd.org/D24304
* hid: Add recently imported drivers to NOTESVladimir Kondratyev2021-01-101-0/+7
| | | | | Reviewed by: hselasky Differential revision: https://reviews.freebsd.org/D28060
* arm64: gdb(4) machine-dependent bitsmhorne2021-01-083-1/+194
| | | | | | | | | | | | | | Everything required for remote kernel debugging over a serial connection. For FDT-based systems, a debug port can be specified by setting hw.fdt.dbgport to the desired device tree node in loader.conf. For example, hw.fdt.dbgport="uart1", or hw.fdt.dbgport="serial@ff1a0000". Looks good: emaste Tested by: rwatson MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27727
* arm64: remove pcb_pcmhorne2021-01-089-17/+18
| | | | | | | | | | | | | | | | | | | | | | | The program counter field in the PCB is written in exactly one place, makectx(), upon entry to the debugger. For threads other than curthread, its value will be empty, or bogus. Rather than writing to this field in more places, it can be removed in favor of using the value in the link register. To make this clearer, pcb->pcb_x[30] is renamed to pcb->pcb_lr, similar to what already exists in struct trapframe. Also, prefer lr to x30 in assembly, as it better conveys intention. This improves PC_REGS() for kdb_thread != curthread. It is required for a functional gdb(4) stub, fixing the output of `info threads`, in particular. The space occupied by pcb_pc is retained, for compatibility with kgdb. Reviewed by: markj, jhb MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27720
* arm64: don't pass user trapframe to kdb_trap()mhorne2021-01-081-20/+2
| | | | | | | | | | | | | | | This effectively undoes the changes made in r321571. While useful, it is inconsistent with how other architectures pass trapframes to kdb. This change is also required to get a working gdb(4) stub on arm64, as otherwise the backtrace will begin too early. As of 088a7eef95b1, this information can still be obtained via "show registers/u". Reviewed by: jhb (slightly earlier version) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Pull Request: https://reviews.freebsd.org/D27719
* hid: Import functions and constants required by new subsystemVladimir Kondratyev2021-01-072-0/+2
| | | | | | | | | | | | | | | | | | | | This does an import of quirk stubs, debugging macros from USB code and numerous usage constants used by dependent drivers. Besides, this change renames some functions to get a better matching with userland library and NetBSD/OpenBSD HID code. Namely: - Old hid_report_size() renamed to hid_report_size_max() - New hid_report_size() calculates size of given report rather than maximum size of all reports. - hid_get_data_unsigned() renamed to hid_get_udata() - hid_put_data_unsigned() renamed to hid_put_udata() Compat shim functions are provided in usbhid.h to make possible compile of legacy code unmodified after this change. Reviewed by: manu, hselasky Differential revision: https://reviews.freebsd.org/D27887
* Factor-out hardware-independent part of USB HID support to new moduleVladimir Kondratyev2021-01-071-0/+3
| | | | | | | | It will be used by the upcoming HID-over-i2C implementation. Should be no-op, except hid.ko module dependency is to be added to affected drivers. Reviewed by: hselasky, manu Differential revision: https://reviews.freebsd.org/D27867
* arm64 GENERIC: sort to match amd64, to ease comparisonEd Maste2021-01-071-99/+102
| | | | | | | | | | No functional change - only moved lines, changed whitespace, and updated comments. Reviewed by: allanjude MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28001
* arm64: QorIQ: gpio: return BUS_PROBE_DEFAULTMarcin Wojtas2021-01-061-1/+1
| | | | | | | | | | There is no reason this driver can't return default probe value. Submitted by: Artur Rojek <ar@semihalf.com> Reviewed by: emaste, mmel Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D26869
* arm64: QorIQ: gpio: Cleanup qoriq_gpio_* helpersMarcin Wojtas2021-01-061-79/+12
| | | | | | | | | | | Replace various hw reg bit set/clear helpers with a universal `qoriq_gpio_set` function. Submitted by: Artur Rojek <ar@semihalf.com> Reviewed by: mmel Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D26868
* arm64: QorIQ: gpio: Style cleanupsMarcin Wojtas2021-01-061-71/+51
| | | | | | | | | | | | | Make the code more conformant to style(9) and improve the general readability. This patch does not alter the driver logic. Submitted by: Artur Rojek <ar@semihalf.com> Reviewed by: mmel Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D26867
* arm64: genet: Add bcm2711-genet-v5 compatibleEmmanuel Vadot2021-01-051-0/+1
| | | | | | Later dtb from the RPI Foundation removed the brcm,genet-v5 compatible for some unknown reason, add brcm,bcm2711-genet-v5 to the list of compatible device for if_genet
* arm64: rockchip: rk_clk_mux: Tell the clk framework if we didn't change the ↵Emmanuel Vadot2021-01-041-1/+3
| | | | | | | | | clock Otherwise the clk framework will not pass the freq change request to the clock parents. Fix d03fd8ede2c4 Reported by: br
* rockchip: add audio-related clocks to the CRU driverOleksandr Tymoshenko2021-01-046-3/+379
| | | | | | | | | - Add I2S and CODEC clocks to CRU driver - Add support for gate selection to frac clock - Add setfreq support to mux clock Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D27831
* arm64: fix mask in atomic_testand{set,clear}_64Ryan Libby2021-01-021-2/+2
| | | | | | | | | | | | | These macros generate both the 32- and 64-bit ops, but the mask was hard coded for 32-bit ops, causing the 64-bit ops always to affect only the low 32 bits. PR: 252324 Reported by: gbe, mmel Reviewed by: markj, mmel Tested by: mmel, rwatson Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D27886
* arm64: Use new arm_kernel_boothdr script for generating booti images.Michal Meloun2020-12-301-31/+0
|