summaryrefslogtreecommitdiff
path: root/sys/arch/arm64
AgeCommit message (Collapse)Author
2017-02-10Unbreak 'config -p'.Martin Pieuchot
ok tb@, jca@
2017-02-08Pass the physical address to the end of symbols to the kernel. FromPatrick Wildt
armv7 we inherited the mechanism to manually modify the kernel symbol table to change the value of esym. We don't use this, but instead use the virtual address that is passed to the kernel. This change makes us only work on and hand out physical addresses. Bump the efiboot version to make this ABI change more visible.
2017-02-08Retry BS->ExitBootServices() if it fails, like on amd64. Also we needPatrick Wildt
to make sure to pass the current mapkey to prove EFI that we know the current memory map and its constraints. Otherwise EFI can choose to only partially exit until we pass the correct key. As we already use the memory map to allocate memory for the kernel, split the previous function into one simply retrieving the table and another one who uses the map to allocate memory. At some point it would be nice to actually pass the table to the kernel since its data is more reliable than the FDT only. While there, sync a bit of style with the amd64 version.
2017-02-08In exec_elf.c: expand ELFNAME(), ELFNAME2(), and ELFNAMEEND() exceptPhilip Guenther
leaving out the size, so that ELFNAME2(exec,makecmds) becomes exec_elf_makecmds instead of exec_elf{32,64}_makecmds and then delete the ELFNAME2() and ELFNAMEEND() macros. Move the prototypes for functions local to exec_elf.c to there from exec_elf.h. Simplify the SMALL_KERNEL conditionals around the ELF coredump code. Change exec_conf.c to use the size-generic names and macros Remove exec_elf{32,64}.c and just build exec_elf.c; delete the _KERN_DO_ELF and _KERN_DO_ELF64 #defines. ok jca@, encouragement from deraadt@ and tom@
2017-02-07Since the instruction cache does not in any way snoop the data cachePatrick Wildt
we need to make sure to clean the data and invalidate the instruction cache upon entering a page with pmap_enter(). Since it is possible that pmap_enter() does not directly enter the page, we need to do the same dance in the pmap fault fixup code. Every new writeable mapping or write removes a page's flag to mark it unflushed. The next time pmap_enter() is called or a fault happens on that VA, it has to be flushed and invalidated again. This was heavily discussed with Dale Rahn. On the Pine64 and Raspberry Pi 3 we have been very lucky to not run into any cache issues, especially with the instruction cache. The AMD Seattle seems to be a different kind of beast where we actually have to care about these things. This finally brings the machine into userland.
2017-02-07For consistency sake, apply the inner shareable attribute to the bootstrapPatrick Wildt
pagetables as well. Also replace the number for write-back with a proper define.
2017-02-07The default frequency we chose for the generic timer does not always ringPatrick Wildt
true. Instead, unless overwritten by the device tree, we should ask the generic timer for its frequency. This fixes time on my AMD Seattle and should improve time management on QEMU as well.
2017-02-07There are 1023 possible values for the interrupts, but our masks limitPatrick Wildt
these currently to 255. Thus making it impossible to use higher IRQs than that. The AMD Seattle SoC though seems to provide 448 IRQs, which is kind of out of bounds, so raise them to the proper values. This makes interrupts work on that machine.
2017-02-06Move cache and tlb flush functions, which were mostly inline assembly,Patrick Wildt
into separate functions. This makes them reusable from other parts in the kernel. Assembly and header are taken from FreeBSD, but modified to fit our requirements and with some unnecessary stuff removed. While there remove micro optimization for uniprocessor kernels.
2017-02-06Change the pmap_pmap_pool ipl from IPL_VM to IPL_NONE. Matches theJonathan Gray
other archs. ok patrick@
2017-02-06patrick@ tells me this is mostly mine tooDavid Gwynne
2017-02-05_dmamem_alloc_range() stores physical addresses in the segments, soPatrick Wildt
upon free don't try to convert it from virtual to physical again.
2017-02-05Ask for a generic armv8-a encoding rather than one based on and tunedJonathan Gray
for cortex-a57. ok patrick@
2017-02-05Add implementation for intr_barrier(9).Patrick Wildt
2017-02-05Add the necessary PCI header to be able to compile PCI drivers. BasedPatrick Wildt
on the octeon one.
2017-02-05Since turning of the MMU in the beginning of the kernel removesPatrick Wildt
the caches' contents, we lose data about the freshly copied and created kernel. This leads to bootup failures. Make sure to clean the caches to make sure that the data is in memory before we turn off the MMU.
2017-02-05Implement another pagetable level for bootstrapping machines that havePatrick Wildt
their memory mapped above 39 bits of address space. Since our pmap is configured to use a 3 level pagetable userland we need to reconfigure the size back to 39 bits as soon are in virtual address space and have finished using the FDT via the 1:1 map.
2017-02-05As far as we understood the architecture reference manual it shouldPatrick Wildt
only need a data cache write-back to PoU (Point of Unification) to make changes to the pagetables visible. Interestingly enough, this does not seem to work on the AMD hardware. Instead we need to flush to PoC (Point of Coherence), which essentially means flush to memory. Surprisingly even FreeBSD flushes their pagetable changes to PoC, and they have done that since the code was first imported. Until we find out whether this is a software bug or just completely expected, switch us to flushing to PoC as well. This makes my AMD machine behave.
2017-02-05Add option PCIVERBOSE.Patrick Wildt
Prompted by jsg@
2017-02-04In reality our kernel does not need to be aligned at a 256M boundary,Patrick Wildt
but simply at 2M boundary. This might have been a requirement from armv7, but it's not true for arm64. This also helps reduce memory holes below the kernel.
2017-02-04Read the data cache size instead of hardcoding some value. We mightPatrick Wildt
want to start caching that value somewhere though.
2017-02-04A bit of code and comment cleanup.Patrick Wildt
2017-02-04Remove gdb waitcount debug code and dummy print.Patrick Wildt
2017-02-04Implement atomic_{set,clear}bits_int and membars for arm64.Jonathan Gray
With feedback from Dale Rahn, ok patrick@.
2017-02-03Implement a helper that creates an L0 pagetable entry pointing toPatrick Wildt
a L1 pagetable. Needed for machines that need 4 level pagetables on bootup. From FreeBSD
2017-02-03whitespace fixesPatrick Wildt
2017-02-03Set the context id and counter offset to a known value. Enable accessPatrick Wildt
to the physical timers at EL1. From FreeBSD
2017-02-03Use PAGE_SHIFT instead of encoding the number.Patrick Wildt
From FreeBSD
2017-02-03Cleanup pagetable creation code in preparation for adding another levelPatrick Wildt
of pagetables to bootstrap machines with physical memory mapped outside of a 39 bits address space. From FreeBSD
2017-02-03ARM64 has an 48-bit physical address space, so bump PTE_RPGN to reflectPatrick Wildt
it. Otherwise we might truncate physical addresses.
2017-02-03Don't use PTE_RPGN to mask away the lower page bits from a virtualPatrick Wildt
address. PTE_RPGN only returns the physical bits that can be used, thus truncating virtual addresses, specifically in kernel address space.
2017-02-03Explicitly ask EFI to allocate the page we picked out to lay ourPatrick Wildt
kernel in, and not just use some memory address that we found in the table.
2017-01-26The only difference between armv7 and arm64 fdt virtio attachments is anJonathan Gray
uneeded include. Remove the include and move to MI fdt directory.
2017-01-25Build amd64 kernels with -ffreestanding. Synchronize the arm64 and armv7Mark Kettenis
kernel makefiles, that are using -ffreestanding already, with the amd64 one. Other architectures will follow later. ok jca@, visa@
2017-01-25Setjmp and longjmp save/restore 13 registers in a label_t struct,Patrick Wildt
not only 11 registers.
2017-01-25Setjmp should return zero, while longjmp should return nonzero inPatrick Wildt
kernel. Since those are only used by ddb, guard them with DDB.
2017-01-25enable plrtc(4) and psci(4)Jonathan Gray
ok patrick@
2017-01-25Add assembly helpers for calling the hypervisor and secure monitor.Patrick Wildt
ok jsg@
2017-01-25Silence warnings caused by LLVM upgrade.Patrick Wildt
2017-01-24Remove the [fs]u{byte,word,swintr} fetch(9) functions that havePatrick Wildt
been removed years ago. From miod
2017-01-23Enable bcmdog on RAMDISK as well so it can reboot.Jonathan Gray
ok kettenis@ patrick@
2017-01-23Add bcmdog(4), a watchdog timer for the Raspberry Pi.Mark Kettenis
Based on code written by patrick@
2017-01-23Remove duplicate $OpenBSD$ tag.Mark Kettenis
2017-01-23Enter UKC when built with BOOT_CONFIG and -c is specified.Jonathan Gray
ok kettenis@ patrick@
2017-01-23Enable USBVERBOSE on both the GENERIC and RAMDISK kernel.Patrick Wildt
2017-01-23Make the RAMDISK kernel actually try to boot the ramdisk.Patrick Wildt
2017-01-23Create a mapping for the FDT if it happens to be on a different 1 GiBPatrick Wildt
mapping than the kernel.
2017-01-23Initialize DDB if compiled with option DDB.Patrick Wildt
ok kettenis@
2017-01-23In comparison to _start, where we only need the address of thePatrick Wildt
function, we need another indirection for esym. The address of esym is simply the address of the variable. But in the case of esym we want to read and modify its value. ok kettenis@
2017-01-23_end should be on a 64-bit boundary, so make sure to alignPatrick Wildt
the end of BSS by 64-bit and not 32-bit. With and ok kettenis@