summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
AgeCommit message (Collapse)Author
2023-07-07amd64/ALL: Turn on heartbeat checks.riastradh
2023-06-24Fix typo in comment.msaitoh
2023-06-05Un-comment the ident linepgoyette
2023-05-14x86/locore.S: Nix trailing whitespace.riastradh
2023-05-05Add a SELFRELOC kernel option for the sake of documentation clarity.manu
Instead of telling that x86/boot(8) reloc command needs a kernel able to self relocate, we can tell it needs a kernel built with the SELFRELOC option. This keeps the reader from wondering what could make a kernel able to self relocate.
2023-04-28Pass local symbols relocations in both passes and provide the kobj_relocskrll
implementation visibility of these relocations. Currently all implementations resolve local symbol relocations in the first pass and simply skip them in the second. The RISC-V implementation will make use of this visiblity.
2023-04-20Add reloc keyworkd to let EFI bootstrap load amd64 kernel at any addressmanu
EFI bootstrap assumes it can copy the amd64 kernel to its ELF load address (that is KERNTEXTOFF - KERNBASE = 0x200000), but it can clash with previous UEFI memory allocation, as described here: http://mail-index.netbsd.org/tech-kern/2023/04/07/msg028833.html This change adds a reloc keyword for controling where the EFI boostrap will copy the kernel image. Possible values are: default - the default and prior behavior, copy at 0x200000. none - do not copy and use the kernel image where it was loaded. address - specify an explicit address where to copy the kernel. This comes with an amd64 kernel patch that makes it self-relocatable. It first discover where it was loaded in memory, and if this is different than the expected 0x200000, hhe the kernel relocates itself and start over at the right address.
2023-04-12ichsmb(4), tco(4): Add support for TCO on newer Intel chipsets.riastradh
TCO (`Total Cost of Ownership', Intel's bizarre name for a watchdog timer) used to hang off the Intel I/O platform controller hub's (ICH) low-pin-count interface bridge (LPC IB), or ichlpcib(4). On newer devices, it hangs off the ICH SMBus instead. Tested on INTEL 100SERIES_SMB (works) and INTEL 100SERIES_LP_SMB (doesn't work, still not sure why). XXX kernel revbump: This breaks the module ABI -- tco(4) modules older than the change to make ta_has_rcba into ta_version will incorrectly attach at buses they do not understand. (However, the tco(4) driver is statically built into GENERIC, so maybe it's safe for pullup since the module wouldn't have worked anyway.)
2023-04-09amd64: Make curlwp and curcpu() flushable.riastradh
The only effect of the `volatile' qualifier on an asm block with outputs is to force the instructions to appear in the generated code, even if the outputs end up being unused. Since these instructions have no (architectural) side effects -- provided %gs is set correctly, which must be the case here -- there's no need for the volatile qualifier, so nix it.
2023-03-03Revert "x86: Add kthread_fpu_enter/exit support, take two."riastradh
kthread_fpu_enter/exit changes broke some hardware, unclear why, to investigate before fixing and reapplying these changes.
2023-03-01x86: Expand on comments on ordering around stores to ci_curlwp.riastradh
No functional change intended. PR kern/57240
2023-02-27amd64_trap.S: Annotate trap vectors with their mnemonics.riastradh
Derived from Intel and AMD manuals. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 3 (3A, 3B, 3C, & 3D: System Programming Guide, Order Number: 325384-077US, April 2022. https://cdrdv2.intel.com/v1/dl/getContent/671447 AMD64 Technology: AMD64 Architecture Programmers' Manual, Volume 2: System Programming, Publication No. 24953, Revision 3.40, January 2023. https://www.amd.com/system/files/TechDocs/24593.pdf No functional change intended. XXX Should apply the same treatment to i386_trap.S.
2023-02-25x86: Add kthread_fpu_enter/exit support, take two.riastradh
This time, make sure to restore the FPU state when switching to a kthread in the middle of kthread_fpu_enter/exit. This adds a single predicted-taken branch for the case of kthreads that are not in kthread_fpu_enter/exit, so it incurs a penalty only for threads that actually use it. Since it avoids FPU state switching in kthreads that do use the FPU, namely cgd worker threads, this should be a net performance win on systems using it and have negligible impact otherwise. XXX pullup-10
2023-02-09Adjust _all_ cinclude of *.local filesabs
- Ensure always at end - Use tab rather than spaces - Add consistent comment "Pull in optional local configuration - always at end" The only functional change is that a local file which tried to override an existing setting (eg with "no foo") would have failed in some cases before, but now will work
2023-02-09Ensure GENERIC.local is always at the end of GENERICabs
Where a GENERIC config had an existing inclusion of GENERIC.local, ensure it is always at the end of the file, with a consistent comment: # Pull in optional local configuration cinclude "arch/landisk/conf/GENERIC.local" This allows GENERIC.local to correctly override all options (This pass does not affect any GENERIC which did not already have an include of GENERIC.local)
2023-01-06Explicitly set -z noseparate-code because the default is about to changechristos
and the boot blocks might not be able to load binaries with more than two PT_LOAD sections.
2022-12-27Move some definitions. Add comment. No functional change.msaitoh
2022-12-26sysret -> sysretl for new binutilschristos
2022-12-26Reduce diff between i386/i386/genassym.cf and amd64/amd64/genassym.cf. NFCI.msaitoh
2022-12-26Sort lines. Add comment. No functional change.msaitoh
2022-12-26Reduce diff between i386/i386/genassym.cf and amd64/amd64/genassym.cf. NFCI.msaitoh
- Whitespace fix. - Sort lines.
2022-12-24{amd64,i386}/db_machdep.c: Don't bury a function call in an if conditionuwe
db_frame_info has many arguments and requires contorted line wrapping that obscures the condition. The same object code is generated (modulo a local variable moved closer to its only use site).
2022-12-24{amd64,i386}/db_machdep.c: Use DB_SYM_NULLuwe
2022-12-22Add missing virtio devices to x86 ALL kernelsjakllsch
2022-12-22Driver for DaynaPORT SCSI/Link (dse.4).nat
Written by Hiroshi Noguchi, of which an updated version was posted to port-mac68k in 2001. Attachments were added to kernel configs for platforms that already had the Cabletron (se.4) driver added, although other platorms may benefit. Reviewed on tech-net by Izumi Tsutsui.
2022-12-18Typo in commentskrll
2022-10-26ddb/db_active.h: New home for extern db_active.riastradh
This can be included unconditionally, and db_active can then be queried unconditionally; if DDB is not in the kernel, then db_active is a constant zero. Reduces need for #include opt_ddb.h, #ifdef DDB.
2022-10-26sys: Put externs for time_adjtime and time_adjusted in .h files.riastradh
time_adjtime: sys/timex.h (defined in ntp code) time_adjusted: sys/timevar.h (defined in non-ntp code) (Not really sure this is a valuable distinction to maintain; there's non-ntp code that uses time_adjtime too.)
2022-10-26sys/*: Get module_map consistently from sys/module.h.riastradh
2022-09-29swwdog(4): Add to GENERIC kernels.riastradh
Plus a handful of others that I'm familiar with. Lots of special- purpose kernels should probably have this too but I'm not going through all the arm, mips, and ppc evaluation board kernels to see which ones are relevant. Omitted from systems I know to be very small: - sun2/GENERIC - dreamcast/GENERIC Feel free to remove it from others that need to be kept smaller. Compile-tested a few of these just in case: - alpha/GENERIC - amd64/GENERIC - evbmips/OCTEON - i386/GENERIC - riscv/GENERIC PR kern/29702
2022-09-24x86: Support EFI runtime services.riastradh
This creates a special pmap, efi_runtime_pmap, which avoids setting PTE_U but allows mappings to lie in what would normally be user VM -- this way we don't fall afoul of SMAP/SMEP when executing EFI runtime services from CPL 0. SVS does not apply to the EFI runtime pmap. The mechanism is intended to work with either physical addressing or virtual addressing; currently the bootloader does physical addressing but in principle it could be modified to do virtual addressing instead, if it allocated virtual pages, assigned them in the memory map, and issued RT->SetVirtualAddressMap. Not sure pmap_activate_sync and pmap_deactivate_sync are correct, need more review from an x86 wizard. If this causes fallout, it can be disabled temporarily without reverting anything by just making efi_runtime_init return immediately without doing anything, or by removing options EFI_RUNTIME. amd64-only for now pending type fixes and testing on i386.
2022-09-13amd64/asan.h, amd64/msan.h: Add include guards.riastradh
2022-09-13Fix PR kern/57007. I missed applying a part of the original patch.knakahara
2022-09-12Update register name at fault. Pointed out by hgutch@n.o, thanks.knakahara
In vetor.S:r1.78 ==================== IDTVEC(handle_hypervisor_callback) movl CPUVAR(ILEVEL),%edi pushq %rdi /* for Xdoreti */ ==================== So, use %edi as before.
2022-09-07NetBSD/x86: Raise the number of interrupt sources per CPU from 32 to 56.knakahara
There has been no objection for three years. https://mail-index.netbsd.org/port-amd64/2019/09/22/msg003012.html Implemented by nonaka@n.o, updated by me.
2022-09-01Add commented out experimental PVH dom0 options and pseudo-devicebouyer
2022-08-22Sprinkle "#include <machine/pmap_private.h>", kernel ALL/amd64hannken
compiles again.
2022-08-22amd64/msan.h: Fix includes for private pmap.riastradh
2022-08-21Adapt to pmap/bootspace migrations.mlelstv
2022-08-21x86 Move VA_SIGN_POS/NEG to machine/pte.h.riastradh
It's used by pl[1-4]_pi, also defined in machine/pte.h, and used in libkvm without pmap_private.h.
2022-08-20{amd64,i386}/pmap_private.h: Fix minor whitespace issues.riastradh
2022-08-20x86: Move definition of struct pmap to pmap_private.h.riastradh
This makes pmap_resident_count and pmap_wired_count out-of-line functions instead of inline. No functional change intended otherwise.
2022-08-20x86: Split most of pmap.h into pmap_private.h or vmparam.h.riastradh
This way pmap.h only contains the MD definition of the MI pmap(9) API, which loads of things in the kernel rely on, so changing x86 pmap internals no longer requires recompiling the entire kernel every time. Callers needing these internals must now use machine/pmap_private.h. Note: This is not x86/pmap_private.h because it contains three parts: 1. CPU-specific (different for i386/amd64) definitions used by... 2. common definitions, including Xenisms like xpmap_ptetomach, further used by... 3. more CPU-specific inlines for pmap_pte_* operations So {amd64,i386}/pmap_private.h defines 1, includes x86/pmap_private.h for 2, and then defines 3. Maybe we should split that out into a new pmap_pte.h to reduce this trouble. No functional change intended, other than that some .c files must include machine/pmap_private.h when previously uvm/uvm_pmap.h polluted the namespace with pmap internals. Note: This migrates part of i386/pmap.h into i386/vmparam.h -- specifically the parts that are needed for several constants defined in vmparam.h: VM_MAXUSER_ADDRESS VM_MAX_ADDRESS VM_MAX_KERNEL_ADDRESS VM_MIN_KERNEL_ADDRESS Since i386 needs PDP_SIZE in vmparam.h, I added it there on amd64 too, just to keep things parallel.
2022-08-20x86: Forbid using x86/pte.h directly; use machine/pte.h.riastradh
machine/pte.h already used outside sys/arch, so let's make it the primary thing and make sure to use x86/pte.h only as a subroutine.
2022-08-20amd64/pte.h, i386/pte.h: Need sys/stdint.h for uintN_t.riastradh
2022-08-20x86: Move struct vm_page_md to common x86/pmap.h.riastradh
2022-08-20x86: Split bootspace out of x86/pmap.h into new x86/bootspace.h.riastradh
2022-08-07UFS/LFS dirhash:simonb
- Enable UFS_DIRHASH if the architecture or kernel model specific config file can use 128MB of RAM or more. - Remove experimental tag from UFS_DIRHASH; it's been with RUMP kernel and by a number of NetBSD developers for years. - Add LFS_DIRHASH if LFS was enabled. - Be somewhat consistent with FS options order.
2022-07-30x86: Eliminate mfence hotpatch for membar_sync.riastradh
The more-compatible LOCK ADD $0,-N(%rsp) turns out to be cheaper than MFENCE anyway. Let's save some space and maintenance and rip out the hotpatching for it.
2022-07-29x86: Disable new DRM_LEGACY option in INSTALL kernel.riastradh
The INSTALL kernel appears to be intended to have no drm in it at all, but DRM_LEGACY brings it in just for modules.