summaryrefslogtreecommitdiffstats
path: root/sys/arm64
Commit message (Collapse)AuthorAgeFilesLines
* Disable ACPI on arm64 ad it has only had minimal testing and is causingandrew2016-04-261-1/+1
| | | | | | | | boot issues when booting with FDT. It is planned to re-enable this at a later date. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* Move arm's devmap to some generic place, so it can be usedbr2016-04-263-93/+4
| | | | | | | | | by other architectures. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D6091 Sponsored by: DARPA, AFRL Sponsored by: HEIF5
* Use the yield instruction in the arm64 cpu_spinwait. This instruction isandrew2016-04-251-1/+1
| | | | | | a hint to the hardware the software is not performing a task. Sponsored by: ABT Systems Ltd
* sys: use our roundup2/rounddown2() macros when param.h is available.pfg2016-04-211-1/+1
| | | | | | | | | | rounddown2 tends to produce longer lines than the original code and when the code has a high indentation level it was not really advantageous to do the replacement. This tries to strike a balance between readability using the macros and flexibility of having the expressions, so not everything is converted.
* Group the ThunderX PCIe PEM newbus methods to help find them.andrew2016-04-201-3/+6
| | | | | Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* Pull out the MSI/MSI-X handling calls to simplify future intrngandrew2016-04-201-5/+48
| | | | | | | integration. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* arm: for pointers replace 0 with NULL.pfg2016-04-151-1/+1
| | | | | | These are mostly cosmetical, no functional change. Found with devel/coccinelle.
* Fix the types for the start, end, and count arguments toandrew2016-04-141-1/+1
| | | | | | | | | arm_gic_fdt_alloc_resource. These were the old u_long where they should be rman_res_t. Both of these are the same size on arm64 so this is just for correctness, and would not have led to incorrect behaviour. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* Set the upper limit of the DMAP region to the limit of RAM as was found inandrew2016-04-142-10/+19
| | | | | | | | | | | the physmap. This will reduce the likelihood of an issue where we have device memory mapped in the DMAP. This can only happen if it is within the same 1G block of normal memory. Reviewed by: kib Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5938
* arm64: Avoid null dereference in its_init_cpuemaste2016-04-131-1/+1
| | | | | | | its_init_cpu() is called from gic_v3_init_secondary(), and its_sc will be NULL if its did not attach. Sponsored by: The FreeBSD Foundation
* Document the memory ranges within the kernel region to help with debuggingandrew2016-04-131-6/+11
| | | | | | | to track down which region an address is from. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* Increase the arm64 kernel address space to 512GB, and the DMAP region toandrew2016-04-133-25/+43
| | | | | | | | | | | | | | | 2TB. The latter can be increased in 512GB chunks by adjusting the lower address, however more work will be needed to increase the former. There is still some work needed to only create a DMAP region for the RAM address space as on ARM architectures all mappings should have the same memory attributes, and these will be different for device and normal memory. Reviewed by: kib Obtained from: ABT Systems Ltd Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5859
* Cleanup unnecessary semicolons from the kernel.pfg2016-04-101-1/+1
| | | | Found with devel/coccinelle.
* Fix interrupts delivery on ThunderX for VF IDs beyond 8zbb2016-04-071-3/+1
| | | | | | | | | | | | | | SR-IOV devices usually use Alternative Routing ID (ARI). In that case slot/device is always assumed to be 0 and function/identifier is extended to 8 bits. Fix interrupts delivery to VF IDs beyond 8 by using a correct DevID if ARI is enabled. Reviewed by: jhb, wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5855
* Use PHYS_IN_DMAP to check if a physical address is within the DMAP region.andrew2016-04-061-3/+3
| | | | | Approved by: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* Cleanup the early pagetable creation code in preperation for increasingandrew2016-04-061-20/+22
| | | | | | | the size of the arm64 DMAP region. Approved by: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* Allow vmparam.h to be included from assembly files on arm64.andrew2016-04-065-4/+9
| | | | | Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* Make CloudABI's way of doing TLS more friendly to userspace emulators.ed2016-04-061-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're currently seeing how hard it would be to run CloudABI binaries on operating systems cannot be modified easily (Windows, Mac OS X). The idea is that we want to just run them without any sandboxing. Now that CloudABI executables are PIE, this is already a bit easier, but TLS is still problematic: - CloudABI executables want to write to the %fs, which typically requires extra system calls by the emulator every time it needs to switch between CloudABI's and its own TLS. - If CloudABI executables overwrite the %fs base unconditionally, it also becomes harder for the emulator to store a backup of the old value of %fs. To solve this, let's no longer overwrite %fs, but just %fs:0. As CloudABI's C library does not use a TCB, this space can now be used by an emulator to keep track of its internal state. The executable can now safely overwrite %fs:0, as long as it makes sure that the TCB is copied over to the new TLS area. Ensure that there is an initial TLS area set up when the process starts, only containing a bogus TCB. We don't really care about its contents on FreeBSD. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D5836
* Implement dtrace_getupcstack in ARM64wma2016-04-061-0/+5
| | | | | | | | | | | Allow using DTRACE for performance analysis of userspace applications - the function call stack can be captured. This is almost an exact copy of AMD64 solution. Obtained from: Semihalf Sponsored by: Cavium Reviewed by: emaste, gnn, jhibbits Differential Revision: https://reviews.freebsd.org/D5779
* Add a table to map from the FreeBSD CPUID space to the GIC CPUID space. Onandrew2016-04-041-15/+35
| | | | | | | | | many SoCs these two are the same, however there is no requirement for this to be the case, e.g. on the ARM Juno we boot on what the GIC thinks of as CPU 2, but FreeBSD numbers it CPU 0. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* Reduce the diff for when we switch to intrng. The IPI interrupts will beandrew2016-04-041-20/+63
| | | | | | | split out to multiple handlers. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* arm64: pagezero improvementwma2016-04-044-7/+47
| | | | | | | | | | This change has been provided to improve pagezero call performance. Submitted by: Dominik Ermel <der@semihalf.com> Obtained from: Semihalf Sponsored by: Cavium Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D5741
* Add bzero.S to ARM64 machdepwma2016-04-041-0/+206
| | | | Add fille missing from https://svnweb.freebsd.org/changeset/base/297536
* arm64: bzero optimizationwma2016-04-042-11/+20
| | | | | | | | | | | | | This optimization attempts to utylize as wide as possible register store instructions to zero large buffers. The implementation, if possible, will use 'dc zva' to zero buffer by cache lines. Speedup: 60x faster memory zeroing Submitted by: Dominik Ermel <der@semihalf.com> Obtained from: Semihalf Sponsored by: Cavium Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D5726
* Make Position Independent Executables work for CloudABI.ed2016-03-311-0/+1
| | | | | | | - Set BI_CAN_EXEC_DYN, so we can execute ET_DYN ELF files in addition to regular ET_EXECs. - Provide an AT_BASE entry in the auxiliary vector, so the executable knows at which address it got loaded and can apply relocations.
* Add support for 4 level pagetables. The userland address space has beenandrew2016-03-3112-293/+606
| | | | | | | | | | | | | | | | | | | | increased to 256TiB. The kernel address space can also be increased to be the same size, but this will be performed in a later change. To help work with an extra level of page tables two new functions have been added, one to file the lowest level table entry, and one to find the block/page level. Both of these find the entry for a given pmap and virtual address. This has been tested with a combination of buildworld, stress2 tests, and by using sort to consume a large amount of memory by sorting /dev/zero. No new issues are known to be present from this change. Reviewed by: kib Obtained from: ABT Systems Ltd Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5720
* Read the CPU ID for the current CPU from the GIC. The GIC may have aandrew2016-03-291-3/+21
| | | | | | | | | | different ID space than the kernel. Because of this we need to read the ID from the hardware. The hardware will provide this value to the CPU by reading any of the first 8 Interrupt Processor Targets Registers. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5706
* arm64: Fixing user space boudary checking in copyinout.Swma2016-03-241-3/+5
| | | | | | | | | | | | | | Big buffer size could cause integer overflow and as a result attempt to copy beyond VM_USERMAX_ADDRESS. Fixing copyinstr boundary checking where compared value has been overwritten by accident when setting fault handler. Submitted by: Dominik Ermel <der@semihalf.com> Obtained from: Semihalf Sponsored by: Cavium Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D5719
* ARM64 copyinout improvementswma2016-03-231-22/+106
| | | | | | | | | | | | | | | | | | | The first of set of patches. Use wider load/stores when aligned buffer is being copied. In a simple test: dd if=/dev/zero of=/dev/null bs=1M count=1024 the performance jumped from 410MB/s up to 3.6GB/s. TODO: - better handling of unaligned buffers (WiP) - implement similar mechanism to bzero Submitted by: Dominik Ermel <der@semihalf.com> Obtained from: Semihalf Sponsored by: Cavium Reviewed by: kib, andrew, emaste Differential Revision: https://reviews.freebsd.org/D5664
* Use the saved program state register to detect when an exception frame isandrew2016-03-221-2/+2
| | | | | | | | | from userpsace. Previously we could have triggered a panic by trying to jump to a kernel address from userland as the trap handling code thought we received an ast in kernel mode. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* Move the opt_ files to be included first so their definitions can be usedandrew2016-03-181-3/+3
| | | | | | | from within all further included files. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* Rename COUNT_IPI to INTR_IPI_COUNT to reduce the diff with intrng.andrew2016-03-182-4/+4
| | | | | Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* Reduce the diff with intrng by renaming similar functions. This is a noop,andrew2016-03-184-13/+15
| | | | | | | but will help move to use the common interrupt handling code later. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* Remove the invalid L0_BLOCK definition. ARMv8 doesn't support blockandrew2016-03-181-5/+5
| | | | | | | translation in the level 0 descriptor. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation
* pmap arm64: fixing pmap_invalidate_rangewma2016-03-141-4/+2
| | | | | | | | | | | | It seems that if range within one page is given this page will not be invalidated at all. Clean it up. Submitted by: Dominik Ermel <der@semihalf.com> Obtained from: Semihalf Sponsored by: Cavium Reviewed by: wma, zbb Approved by: cognet (mentor) Differential Revision: https://reviews.freebsd.org/D5569
* Fix reporting of the CloudABI ABI in kdump.jhb2016-03-091-1/+1
| | | | | | | | | | | | - Advertise the word size for CloudABI ABIs via the SV_LP64 flag. All of the other ABIs include either SV_ILP32 or SV_LP64. - Fix kdump to not assume a 32-bit ABI if the ABI flags field is non-zero but SV_LP64 isn't set. Instead, only assume a 32-bit ABI if SV_ILP32 is set and fallback to the unknown value of "00" if neither SV_LP64 nor SV_ILP32 is set. Reviewed by: kib, ed Differential Revision: https://reviews.freebsd.org/D5560
* Force re-routing PCI interrupts (this is for legacy INTx not MSI).bz2016-03-021-0/+2
| | | | | | | | | | Need this for gem5, but was not needed on real hadrware (yet) as it was always MSI. Reviewed by: andrew, jhb Discovered by: andrew Sponsored by: DARPA/AFRL Differential Revision: https://reviews.freebsd.org/D5494
* Improve ThunderX PEM driver to work on pass2 revisionwma2016-03-023-44/+200
| | | | | | | | | | | | | | | | Things changed: * do not allocate 4GB of SLI space, because it's the waste of system resources. Allocate only small portions when needed. * provide own implementation of activate_resource which performs address translation between PCI bus and host PA address space. This is temporary solution, should be replaced by bus_map_resource once implemented. Obtained from: Semihalf Sponsored by: Cavium Approved by: cognet (mentor) Reviewed by: jhb Differential revision: https://reviews.freebsd.org/D5294
* Get memory ranges from FDT if no EFI API is available on ARM64wma2016-03-011-1/+31
| | | | | | | | | Obtained from: Semihalf Submitted by: Michal Stanek <mst@semihalf.com> Sponsored by: Annapurna Labs Approved by: cognet (mentor) Reviewed by: andrew, wma Differential revision: https://reviews.freebsd.org/D5408
* Enable SRE_EL2 on ARM64wma2016-03-012-0/+2
| | | | | | | | | | | | | | Enable system register access for EL2. Alpine-V2 is the first device requiring this to be enabled. It is also in-sync with Linux initialization code, and compatible with Alpine-V2 uboot requirements. Obtained from: Semihalf Submitted by: Michal Stanek <mst@semihalf.com> Sponsored by: Annapurna Labs Approved by: cognet (mentor) Reviewed by: wma Differential revision: https://reviews.freebsd.org/D5394
* Add uart 8250 device to GENERIC arm64 configurationwma2016-03-011-0/+1
| | | | | | | | | Obtained from: Semihalf Submitted by: Michal Stanek <mst@semihalf.com> Sponsored by: Annapurna Labs Approved by: cognet (mentor) Reviewed by: zbb, wma Differential revision: https://reviews.freebsd.org/D5406
* Correct the memory rman ranges to be to BUS_SPACE_MAXADDRjhibbits2016-03-011-3/+4
| | | | | | | | | | | | | Summary: As part of the migration of rman_res_t to be typed to uintmax_t, memory ranges must be clamped appropriately for the bus, to prevent completely bogus addresses from being used. This is extracted from D4544. Reviewed By: cem Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D5134
* Restore ThunderX Pass1.1 PCI changes removed by r295962wma2016-02-263-1/+67
| | | | | | | | | | | | | If Enhanced Allocation is not used, we can't allocate any random range. All internal devices have hardcoded place where they can be located within PCI address space. Fortunately, we can read this value from BAR. Obtained from: Semihalf Sponsored by: Cavium Approved by: cognet (mentor) Reviewed by: zbb Differential revision: https://reviews.freebsd.org/D5455
* Make pci_host_generic and thunderx_pci commonwma2016-02-247-746/+68
| | | | | | | | | | | | * provided OFW interface for pci_host_generic (for handling devices which are present in DTS under the PCI node) * removed support for internal PCI from arm64/cavium * cleaned up and made most of the code common Obtained from: Semihalf Sponsored by: Cavium Approved by: cognet (mentor) Reviewed by: zbb Differential revision: https://reviews.freebsd.org/D5261
* Add Intel 10Gb support to ARM64 GENERIC kernel configwma2016-02-221-0/+1
| | | | | | | | Obtained from: Semihalf Sponsored by: Cavium Approved by: cognet (mentor) Reviewed by: zbb Differential revision: https://reviews.freebsd.org/D5347
* As <machine/vmparam.h> is included from <vm/vm_param.h>, there is noskra2016-02-222-2/+0
| | | | | | | | need to include it explicitly when <vm/vm_param.h> is already included. Suggested by: alc Reviewed by: alc Differential Revision: https://reviews.freebsd.org/D5379
* As <machine/param.h> is included from <sys/param.h>, there is no needskra2016-02-221-1/+0
| | | | | | | to include it explicitly when <sys/param.h> is already included. Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D5378
* As <machine/pmap.h> is included from <vm/pmap.h>, there is no need toskra2016-02-222-2/+0
| | | | | | | include it explicitly when <vm/pmap.h> is already included. Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D5373
* Introduce a RMAN_IS_DEFAULT_RANGE() macro, and use it.jhibbits2016-02-206-6/+7
| | | | | | | | | | | This simplifies checking for default resource range for bus_alloc_resource(), and improves readability. This is part of, and related to, the migration of rman_res_t from u_long to uintmax_t. Discussed with: jhb Suggested by: marcel
* Introduce bus_get_bus_tag() methodzbb2016-02-181-0/+9
| | | | | | | | | | | | | | | | | | | Provide bus_get_bus_tag() for sparc64, powerpc, arm, arm64 and mips nexus and its children in order to return a platform specific default tag. This is required to ensure generic correctness of the bus_space tag. It is especially needed for arches where child bus tag does not match the parent bus tag. This solves the problem with ppc architecture where the PCI bus tag differs from parent bus tag which is big-endian. This commit is a part of the following patch: https://reviews.freebsd.org/D4879 Submitted by: Marcin Mazurek <mma@semihalf.com> Obtained from: Semihalf Sponsored by: Annapurna Labs Reviewed by: jhibbits, mmel Differential Revision: https://reviews.freebsd.org/D4879
OpenPOWER on IntegriCloud