aboutsummaryrefslogtreecommitdiff
path: root/sys/powerpc/include
Commit message (Collapse)AuthorAgeFilesLines
...
* powerpc: Drop old workaround for old gccWarner Losh2023-02-141-12/+0
| | | | | | | | | | | | | | | | | | | Very old versions of gcc defined _BIG_ENDIAN and _LITTLE_ENDIAN. So to work around that, we undefined them here. However, that causes problems for programs that do: (and many other variations on that theme). Since this often is the result of weirdly nested includes in the ports world that are hard to unwind, drop this workaround to help more ports build out of the box. If there's still an issue here (and my testing hasn't shown it), we'll fix the issue in a brand-new way once I have a reproducer. This fixes the mesa-devel build, and others Sponsored by: Netflix Tested by: pkubaj MFC After: 3 days Differential Revision: https://reviews.freebsd.org/D38564
* kstack_contains(): account for struct pcb on stackKonstantin Belousov2023-02-011-1/+2
| | | | | | | | | for arm64, arm, powerpc, and riscv Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38320
* Move kstack_contains() and GET_STACK_USAGE() to MD machine/stack.hKonstantin Belousov2023-02-012-12/+19
| | | | | | | Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D38320
* vm: centralize VM_BATCHQUEUE_SIZE definitionAndrew Gallatin2023-01-211-8/+0
| | | | | | | | | | | Remove the platform-specific definitions of VM_BATCHQUEUE_SIZE for amd64 and powerpc64, and instead treat all 64-bit platforms identically. This has the effect of increasing the arm64 and riscv VM_BATCHQUEUE_SIZE to match that of other platforms. Reviewed by: jhb, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D37707
* vm: reduce lock contention when processing vm batchqueuesAndrew Gallatin2022-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | | Rather than waiting until the batchqueue is full to acquire the lock & process the queue, we now start trying to acquire the lock using trylocks when the batchqueue is 1/2 full. This removes almost all contention on the vm pagequeue mutex for for our busy sendfile() based web workload. It also greadly reduces the amount of time a network driver ithread remains blocked on a mutex, and eliminates some packet drops under heavy load. So that the system does not loose the benefit of processing large batchqueues, I've doubled the size of the batchqueues. This way, when there is no contention, we process the same batch size as before. This has been run for several months on a busy Netflix server, as well as on my personal desktop. Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D37305
* pmap_unmapdev/bios: Accept a pointer instead of a vm_offset_t.John Baldwin2022-09-222-2/+2
| | | | | | | | This matches the return type of pmap_mapdev/bios. Reviewed by: kib, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D36548
* Define _NPCM and the last PC_FREEn constant in terms of _NPCPV.John Baldwin2022-08-231-1/+2
| | | | | | | | | | This applies one of the changes from 5567d6b4419b02a2099527228b1a51cc55a5b47d to other architectures besides arm64. Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D36263
* Remove unused openpic_devclass.John Baldwin2022-05-101-2/+0
|
* Remove dead code.Dmitry Chagin2022-04-261-1/+0
| | | | | | | | is_physical_memory() dead since 235a54de. Reviewed by: markj Differential revision: https://reviews.freebsd.org/D35056 MFC after: 2 weeks
* machine/in_cksum.h: don't include sys/cdefs.hBrooks Davis2022-04-181-2/+0
| | | | | | | | All consumers already do it and it was required on amd64 and i386 until recently (1c1bf5bd7c1e479a7889839b941f53e689aa2569). Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D34932
* Remove checks for <sys/cdefs.h> being included.John Baldwin2022-04-121-4/+0
| | | | | | | | | These files no longer depend on the macros required when these checks were added. PR: 263102 (exp-run) Reviewed by: brooks, imp, emaste Differential Revision: https://reviews.freebsd.org/D34804
* Remove checks for __CC_SUPPORTS_WARNING assuming it is always true.John Baldwin2022-04-121-4/+0
| | | | | | | | | All supported compilers (modern versions of GCC and clang) support this. PR: 263102 (exp-run) Reviewed by: brooks, imp Differential Revision: https://reviews.freebsd.org/D34803
* powerpc/atomic: Fix atomic_testand_*_long on powerpc64Justin Hibbits2022-02-031-8/+8
| | | | | | | | | | | | After b5d227b0 FreeBSD was panicking on boot with "Duplicate free" in UMA. Analyzing the asm, the '1' mask was treated as an integer, rather than a long, causing 'slw' (shift left word) to be used for the shifting instruction, not 'sld' (shift left double). This means the upper bits of the bitfield were not getting used, resulting in corruption of the bitfield. While fixing this, the 'and' check of the mask does not need to be recorded, so don't record (drop the '.').
* powerpc: Fix syntax atomic.hLi-Wen Hsu2022-01-141-2/+2
| | | | Fixes: b5d227b0b27 powerpc: Add atomic_testand_{set,clear}_{int,long}
* powerpc: Add atomic_testand_{set,clear}_{int,long}Justin Hibbits2022-01-141-0/+111
| | | | | | | | | | | | Add machine-optimized implementations for the following: * atomic_testandset_int * atomic_testandclear_int * atomic_testandset_long * atomic_testandclear_long This fixes the build with ISA_206_ATOMICS enabled. Add the associated atomic_testandset_32, atomic_testandclear_32, so that ice(4) can potentially build.
* Simplify swi for bus_dma.John Baldwin2021-12-282-3/+0
| | | | | | | | | | | | | | | | | | | | | | | When a DMA request using bounce pages completes, a swi is triggered to schedule pending DMA requests using the just-freed bounce pages. For a long time this bus_dma swi has been tied to a "virtual memory" swi (swi_vm). However, all of the swi_vm implementations are the same and consist of checking a flag (busdma_swi_pending) which is always true and if set calling busdma_swi. I suspect this dates back to the pre-SMPng days and that the intention was for swi_vm to serve as a mux. However, in the current scheme there's no need for the mux. Instead, remove swi_vm and vm_ih. Each bus_dma implementation that uses bounce pages is responsible for creating its own swi (busdma_ih) which it now schedules directly. This swi invokes busdma_swi directly removing the need for busdma_swi_pending. One consequence is that the swi now works on RISC-V which had previously failed to invoke busdma_swi from swi_vm. Reviewed by: imp, kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D33447
* Add <machine/tls.h> header to hold MD constants and helpers for TLS.John Baldwin2021-12-091-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The header exports the following: - Definition of struct tcb. - Helpers to get/set the tcb for the current thread. - TLS_TCB_SIZE (size of TCB) - TLS_TCB_ALIGN (alignment of TCB) - TLS_VARIANT_I or TLS_VARIANT_II - TLS_DTV_OFFSET (bias of pointers in dtv[]) - TLS_TP_OFFSET (bias of "thread pointer" relative to TCB) Note that TLS_TP_OFFSET does not account for if the unbiased thread pointer points to the start of the TCB (arm and x86) or the end of the TCB (MIPS, PowerPC, and RISC-V). Note also that for amd64, the struct tcb does not include the unused tcb_spare field included in the current structure in libthr. libthr does not use this field, and the existing calls in libc and rtld that allocate a TCB for amd64 assume it is the size of 3 Elf_Addr's (and thus do not allocate room for tcb_spare). A <sys/_tls_variant_i.h> header is used by architectures using Variant I TLS which uses a common struct tcb. Reviewed by: kib (older version of x86/tls.h), jrtc27 Sponsored by: The University of Cambridge, Google Inc. Differential Revision: https://reviews.freebsd.org/D33351
* Make struct syscall_args machine independentBrooks Davis2021-12-081-8/+0
| | | | | | | | | | | | | | | | | | After a round of cleanups in late 2020, all definitions are functionally identical. This removes a rotted __aligned(8) on arm. It was added in b7112ead32bc50ef9744099bdbb1cfbd6e906b2a and was intended to align the args member so that 64-bit types (off_t, etc) could be safely read on armeb compiled with clang. With the removal of armev, this is no longer needed (armv7 requires that 32-bit aligned reads of 64-bit values be supported and we enable such support on armv6). As further evidence this is unnecessary, cleanups to struct syscall_args have resulted in args being 32-bit aligned on 32-bit systems. The sole effect is to bloat the struct by 4 bytes. Reviewed by: kib, jhb, imp Differential Revision: https://reviews.freebsd.org/D33308
* arm64, powerpc: fix calculation of 'used' in GET_STACK_USAGEMitchell Horne2021-11-301-3/+1
| | | | | | | | | We do not consider the space reserved for the pcb to be part of the total kstack size, so it should not be included in the calculation of the used stack size. MFC after: 1 week Sponsored by: The FreeBSD Foundation
* netinet: Remove in_cksum_update()Mark Johnston2021-11-241-29/+0
| | | | | | | | | | It was never implemented on powerpc or riscv and appears to have been unused since it was added in 1998. No functional change intended. Reviewed by: kp, glebius, cy MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33093
* powerpc: Make machine/reg.h self-containedWarner Losh2021-11-241-16/+18
| | | | | | | Make powerpc*'s machine/reg.h self-contained so that sys/reg.h can be self-contained. Sponsored by: Netflix
* minidump: Use the provided dump bitsetMitchell Horne2021-11-192-2/+2
| | | | | | | | | | | | | | | | | When constructing the set of dumpable pages, use the bitset provided by the state argument, rather than assuming vm_page_dump invariably. For normal kernel minidumps this will be a pointer to vm_page_dump, but when dumping the live system it will not. To do this, the functions in vm_dumpset.h are extended to accept the desired bitset as an argument. Note that this provided bitset is assumed to be derived from vm_page_dump, and therefore has the same size. Reviewed by: kib, markj, jhb MFC after: 2 weeks Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D31992
* minidump: Parameterize minidumpsys()Mitchell Horne2021-11-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The minidump code is written assuming that certain global state will not change, and rightly so, since it executes from a kernel debugger context. In order to support taking minidumps of a live system, we should allow copies of relevant global state that is likely to change to be passed as parameters to the minidumpsys() function. This patch does the work of parameterizing this function, by adding a struct minidumpstate argument. For now, this struct allows for copies of the kernel message buffer, and the bitset that tracks which pages should be dumped (vm_page_dump). Follow-up changes will actually make use of these arguments. Notably, dump_avail[] does not need a snapshot, since it is not expected to change after system initialization. The existing minidumpsys() definitions are renamed, and a thin MI wrapper is added to kern_dump.c, which handles the construction of the state struct. Thus, calling minidumpsys() remains as simple as before. Reviewed by: kib, markj, jhb Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D31989
* powerpc64: fix OFWFB with Radix MMULeandro Lupori2021-10-141-0/+3
| | | | | | | | | | | | | | | | | | Current implementation of Radix MMU doesn't support mapping arbitrary virtual addresses, such as the ones generated by "direct mapping" I/O addresses. This caused the system to hang, when early I/O addresses, such as those used by OpenFirmware Frame Buffer, were remapped after the MMU was up. To avoid having to modify mmu_radix_kenter_attr just to support this use case, this change makes early I/O map use virtual addresses from KVA area instead (similar to what mmu_radix_mapdev_attr does), as these can be safely remapped later. Reviewed by: alfredo (earlier version), jhibbits (in irc) MFC after: 2 weeks Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D31232
* minidump: De-duplicate the progress barMitchell Horne2021-09-291-0/+3
| | | | | | | | | | | | | The implementation of the progress bar is simple, but duplicated for most minidump implementations. Extract the common bits to kern_dump.c. Ensure that the bar is reset with each subsequent dump; this was only done on some platforms previously. Reviewed by: markj MFC after: 2 weeks Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D31885
* minidump: De-duplicate is_dumpable()Mitchell Horne2021-09-291-1/+0
| | | | | | | | | | | | The function is identical in each minidump implementation, so move it to vm_phys.c. The only slight exception is powerpc where the function was public, for use in moea64_scan_pmap(). Reviewed by: kib, markj, imp (earlier version) MFC after: 2 weeks Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D31884
* [PowerPC] Fix outdated FP regs on fork(2) and friendsBrandon Bergren2021-09-041-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Failure to update the FP / vector state was causing daemon(3) to violate C ABI by failing to preserve nonvolatile registers. This was causing a weird issue where moused was not working on PowerBook G4s when daemonizing, but was working fine when running it foreground. Force saving off the same state that cpu_switch() does in cases where we are about to copy a thread. MFC after: 1 week Sponsored by: Tag1 Consulting, Inc. Test Plan: ``` /* * Test for ABI violation due to side effects of daemon(3). * * NOTE: Compile with -O2 to see the effect. */ /* Allow compiling for Linux too. */ static double test = 1234.56f; /* * This contrivance coerces clang to not bounce the double * off of memory again in main. */ void __attribute__((noinline)) print_double(int j1, int j2, double d) { printf("%f\n", d); } int main(int argc, char *argv[]) { print_double(0, 0, test); if (daemon(0, 1)) { } /* Compiler assumes nonvolatile regs are intact... */ print_double(0, 0, test); return(0); } ``` Working output: ``` 1234.560059 1234.560059 ``` Output in broken case: ``` 1234.560059 0.0 ``` Reviewers: #powerpc Subscribers: jhibbits, luporl, alfredo Tags: #powerpc Differential Revision: https://reviews.freebsd.org/D29851
* Add pmap_vm_page_alloc_check()Konstantin Belousov2021-07-311-0/+2
| | | | | | | | | | | | which is the place to put MD asserts about allocated pages. On amd64, verify that allocated page does not belong to the kernel (text, data) or early allocated pages. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31121
* powerpc: change mfpvr return type to uint32_tLeandro Lupori2021-07-281-2/+2
| | | | | | | | | | | As the Processor Version Register (PVR) is a 32-bit PowerPC register, change mfpvr() return type to match it and avoid type casts on its callers. Suggested by: jhibbits Reviewed by: jhibbits, imp Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D31332
* powerpc64: add Power8 and Power9 PMCsLeandro Lupori2021-07-261-0/+1
| | | | | | | | | Add support to allocate Power8 and 9 PMCs. Submitted by: Leonardo Bianconi <leonardo.bianconi@eldorado.org.br> Reviewed by: mhorne Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D31109
* Pass the syscall number to capsicum permission-denied signalsDavid Chisnall2021-07-161-0/+1
| | | | | | | | | | | | | | | | | | The syscall number is stored in the same register as the syscall return on amd64 (and possibly other architectures) and so it is impossible to recover in the signal handler after the call has returned. This small tweak delivers it in the `si_value` field of the signal, which is sufficient to catch capability violations and emulate them with a call to a more-privileged process in the signal handler. This reapplies 3a522ba1bc852c3d4660a4fa32e4a94999d09a47 with a fix for the static assertion failure on i386. Approved by: markj (mentor) Reviewed by: kib, bcr (manpages) Differential Revision: https://reviews.freebsd.org/D29185
* Revert "Pass the syscall number to capsicum permission-denied signals"David Chisnall2021-07-101-1/+0
| | | | | | This broke the i386 build. This reverts commit 3a522ba1bc852c3d4660a4fa32e4a94999d09a47.
* Pass the syscall number to capsicum permission-denied signalsDavid Chisnall2021-07-101-0/+1
| | | | | | | | | | | | | | | The syscall number is stored in the same register as the syscall return on amd64 (and possibly other architectures) and so it is impossible to recover in the signal handler after the call has returned. This small tweak delivers it in the `si_value` field of the signal, which is sufficient to catch capability violations and emulate them with a call to a more-privileged process in the signal handler. Approved by: markj (mentor) Reviewed by: kib, bcr (manpages) Differential Revision: https://reviews.freebsd.org/D29185
* Reduce code duplication in machine/_types.hAlex Richardson2021-06-141-58/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Many of these typedefs are the same across all architectures or can be set based on an architecture-independent compiler-provided macro (e.g. __SIZEOF_SIZE_T__). These macros have been available since GCC 4.6 and Clang sometime before 3.0 (godbolt.org does not have any older clang versions installed). I originally considered using the compiler-provided `__FOO_TYPE__` directly. However, in order to do so we have to check that those match the previous typedef exactly (not just that they have the same size) since any change would be an ABI break. For example, changing `long` to `long long` results in different C++ name mangling. Additionally, Clang and GCC disagree on the underlying type for some of (u)int*_fast_t types, so this change only moves the definitions that are identical across all architectures and does not touch those types. This de-deduplication will allow us to have a smaller diff downstream in CheriBSD: we only have to only change the (u)intptr_t definition in sys/_types.h in CheriBSD instead of having to change machine/_types.h for all CHERI-enabled architectures (currently RISC-V, AArch64 and MIPS). Reviewed By: imp, kib Differential Revision: https://reviews.freebsd.org/D29895
* Wrap the default SPE config in its own #defineJustin Hibbits2021-05-301-0/+2
| | | | No functional change. Cleans up the code a little.
* Clean up spr.hJustin Hibbits2021-05-301-72/+9
| | | | | Remove SPRs for CPUs FreeBSD doesn't run on Add debug register SPRs from the Freescale EREF
* Rename struct device to struct _deviceMark Johnston2021-04-121-3/+1
| | | | | | | | | | | | | | | types.h defines device_t as a typedef of struct device *. struct device is defined in subr_bus.c and almost all of the kernel uses device_t. The LinuxKPI also defines a struct device, so type confusion can occur. This causes bugs and ambiguity for debugging tools. Rename the FreeBSD struct device to struct _device. Reviewed by: gbe (man pages) Reviewed by: rpokala, imp, jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D29676
* Create VM_MEMATTR_DEVICE on all architecturesAndrew Turner2021-04-121-0/+2
| | | | | | | | | | | This is intended to be used with memory mapped IO, e.g. from bus_space_map with no flags, or pmap_mapdev. Use this new memory type in the map request configured by resource_init_map_request, and in pciconf. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D29692
* powerpc/powermac: Constrain 'cpu_sleep()' for AIM to mpc745xJustin Hibbits2021-03-311-1/+5
| | | | | | | | Rename cpu_sleep() to mpc745x_sleep() to denote what it's actually intended for. This function is very G4-specific, and will not work on any other CPU. This will afterward eliminate a platform_smp_timebase_sync() call by directly updating the timebase instead.
* [PowerPC] Fix ISA_206 subword atomicsJustin Hibbits2021-03-311-2/+2
| | | | | | | | The POWER7 subword atomics were not using the correct instructions for byte and halfword stores in the atomic_fcmpset code. This only affects builds with custom CFLAGS that have explicitly enabled ISA_206_ATOMICS.
* gdb: report specific stop reason for watchpointsMitchell Horne2021-03-301-0/+6
| | | | | | | | | | | | | | | | The remote protocol allows for implementations to report more specific reasons for the break in execution back to the client [1]. This is entirely optional, so it is only implemented for amd64, arm64, and i386 at the moment. [1] https://sourceware.org/gdb/current/onlinedocs/gdb/Stop-Reply-Packets.html Reviewed by: jhb MFC after: 3 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. NetApp PR: 51 Differential Revision: https://reviews.freebsd.org/D29174
* Introduce kdb-level watchpoint functionsMitchell Horne2021-03-291-0/+14
| | | | | | | | | | | | | | | | | | | This basically mirrors what already exists in ddb, but provides a slightly improved interface. It allows the caller to specify the watchpoint access type, and returns more specific error codes to differentiate failure cases. This will be used to support hardware watchpoints in gdb(4). Stubs are provided for architectures lacking hardware watchpoint logic (mips, powerpc, riscv), while other architectures are added individually in follow-up commits. Reviewed by: jhb, kib, markj MFC after: 3 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D29155
* Consolidate machine/endian.h definitionsMitchell Horne2021-03-261-101/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This change serves two purposes. First, we take advantage of the compiler provided endian definitions to eliminate some long-standing duplication between the different versions of this header. __BYTE_ORDER__ has been defined since GCC 4.6, so there is no need to rely on platform defaults or e.g. __MIPSEB__ to determine endianness. A new common sub-header is added, but there should be no changes to the visibility of these definitions. Second, this eliminates the hand-rolled __bswapNN() routines, again in favor of the compiler builtins. This was done already for x86 in e6ff6154d203. The benefit here is that we no longer have to maintain our own implementations on each arch, and can instead rely on the compiler to emit appropriate instructions or libcalls, as available. This should result in equivalent or better code generation. Notably 32-bit arm will start using the `rev` instruction for these routines, which is available on armv6+. PR: 236920 Reviewed by: arichardson, imp Tested by: bdragon (BE powerpc) MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D29012
* Remove PCPU_INCJason A. Harmening2021-03-211-1/+0
| | | | | | | | | | | | | | | | e4b8deb22227 removed the last in-tree uses of PCPU_INC(). Its potential benefit is also practically nonexistent. Non-x86 platforms already implement it as PCPU_ADD(..., 1), and according to [0] there are no recent x86 processors for which the 'inc' instruction provides a performance benefit over the equivalent memory-operand form of the 'add' instruction. The only remaining benefit of 'inc' is smaller instruction size, which in this case is inconsequential given the limited number of per-CPU data consumers. [0]: https://www.agner.org/optimize/instruction_tables.pdf Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D29308
* [PowerPC] Floating-point exception trap followupBrandon Bergren2020-12-131-4/+4
| | | | | | | | | | | | | | * Fix incorrect operation on 32-bit caused by incorrectly-sized storage for a temporary FPSCR. * Fix several whitespace problems. * Don't try to enable VSX during cleanup_fpscr(). Reviewed by: alfredo, jhibbits (earlier version) Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D27453 Notes: svn path=/head/; revision=368604
* Add CFI start/end proc directives to arm64, i386, and ppcConrad Meyer2020-12-051-4/+12
| | | | | | | | | | | | | | Follow-up to r353959 and r368070: do the same for other architectures. arm32 already seems to use its own .fnstart/.fnend directives, which appear to be ARM-specific variants of the same thing. Likewise, MIPS uses .frame directives. Reviewed by: arichardson Differential Revision: https://reviews.freebsd.org/D27387 Notes: svn path=/head/; revision=368354
* [PowerPC64LE] Fix LE VSX/fpr interopBrandon Bergren2020-12-031-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | In the PCB struct, we need to match the VSX register file layout correctly, as the VSRs shadow the FPRs. In LE, we need to have a dword of padding before the fprs so they end up on the correct side, as the struct may be manipulated by either the FP routines or the VSX routines. Additionally, when saving and restoring fprs, we need to explicitly target the fpr union member so it gets offset correctly on LE. Fixes weirdness with FP registers in VSX-using programs (A FPR that was saved by the FP routines but restored by the VSX routines was becoming 0 due to being loaded to the wrong side of the VSR.) Original patch by jhibbits. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D27431 Notes: svn path=/head/; revision=368290
* [PowerPC] Don't overwrite vm.pmap sysctl nodeLeandro Lupori2020-11-171-0/+1
| | | | | | | | | | | | | | | | | | After r367417, both mmu_oea64 and mmu_radix were defining the vm.pmap sysctl node, resulting in the later definition hiding the properties of the previous one. Avoid this issue by defining vm.pmap in a common source file and declaring it where needed. This change also standardizes the tunable name used to enable superpages and change its default to disabled on radix MMU, because it still has some issues with superpages. Reviewed by: bdragon, jhibbits Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D27156 Notes: svn path=/head/; revision=367758
* Make powerpc use MAXARGS (defined as 8) instead of hardcoding '10'.Edward Tomasz Napierala2020-11-061-1/+2
| | | | | | | | | | | | This brings its 'struct syscall_args' in sync with other architectures. Reviewed by: bdragon, jhibbits MFC after: 2 weeks Sponsored by: EPSRC Differential Revision: https://reviews.freebsd.org/D26605 Notes: svn path=/head/; revision=367430
* Implement superpages for PowerPC64 (HPT)Leandro Lupori2020-11-064-12/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | This change adds support for transparent superpages for PowerPC64 systems using Hashed Page Tables (HPT). All pmap operations are supported. The changes were inspired by RISC-V implementation of superpages, by @markj (r344106), but heavily adapted to fit PPC64 HPT architecture and existing MMU OEA64 code. While these changes are not better tested, superpages support is disabled by default. To enable it, use vm.pmap.superpages_enabled=1. In this initial implementation, when superpages are disabled, system performance stays at the same level as without these changes. When superpages are enabled, buildworld time increases a bit (~2%). However, for workloads that put a heavy pressure on the TLB the performance boost is much bigger (see HPC Challenge and pgbench on D25237). Reviewed by: jhibbits Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D25237 Notes: svn path=/head/; revision=367417