Commit Graph

10135 Commits

Author SHA1 Message Date
thorpej 1853c81a61 Clean up the <sys/ucontext.h> <-> <machine/mcontext.h> interface up
a little:
- Define _UC_MD_BIT* constants for the available machine-dependent bits,
  and use those constants to define the machine-dependent bits as well
  as the machine-independent bits that have machine-dependent values.
- Explicitly generate an error if _UC_TLSBASE, _UC_SETSTACK, or
  _UC_CLRSTACK are not defined by <machine/mcontext.h>.
2024-05-18 00:37:40 +00:00
nia ac38847e11 also exclude DRM_LEGACY from the ISA kernel 2024-05-13 21:50:47 +00:00
andvar 9125039b09 Make eisa_machdep build without NIOAPIC > 0 by extracting irq definition. 2024-05-01 16:28:33 +00:00
andvar 4412324be5 viac7temp(4): rewrite temperature sensor to read value from MSR instead of using
documented cpuid instruction and eax register.

This approach is adapted from linux via-cputemp.c, no official documentation is
currently available. However, msr value seems to work on all tested CPUs while
documented cpuid instruction typically reports 0, even for my C7-D CPU.
msr value seems to have temperature in Celsius in lower 24-bits without fraction
(thus "msr & 0xffffff;" is used).

Tested on my personal systems based on CPUs below (i386 and amd64):
C7-D 1.6GHz (i386 only), Nano X2 L4350E, Nano X2 U4300, U2300 Nano, KX-U6580.
Also got one response via email which was based on Nano X2 L4050 (VE-900).
Nano reports independent values for each core.
KX-U6580 seems to show the same value for all cores but more testing is needed.

Since it works on amd64 capable CPUs, adding driver to GENERIC kernel config.
Also moving viac7temp man page to x86 instead of i386 (with updates).
In theory the change should add support for all VIA Nano CPUs and Zhaoxin CPUs
 at least up to KX-6000(G) series.

In the future I may need to introduce amd64 kernel module as well.

Plan to pullup to at least netbsd-10.

Patch mainly reviewed by riastradh.
2024-04-30 19:35:28 +00:00
nia cb3e75584d i386: disable DRMKMS drivers in LEGACY kernel (this is for ISA) 2024-04-28 08:12:44 +00:00
andvar fabab64239 Add (defined(MPBIOS) || NACPICA > 0) check around mp_pci_childdetached().
Fixes the build without MPBIOS or ACPI. Modified patch from Paolo Pisati in
current-users@.

While here:
Remove obsolete <arch/x86/pci/msipic.h> include with its guard.
Add comments for multiple endifs for better readability.
2024-04-22 22:47:00 +00:00
riastradh 63b08c9be7 apei(4), acpihed(4): Enable in x86 GENERIC.
Let's just see how this works out in practice.  Might need to reduce
the overhead of each GHES on machines with thousands of them, but
we'll see.

PR kern/58046
2024-04-21 14:11:12 +00:00
charlotte 8a309ac31c Mention DKWEDGE_METHOD_TOS in several kernel config files 2024-04-02 22:56:50 +00:00
charlotte 53b28be123 dk(4): Add support for discovering Atari TOS partitions as wedges
Any partitioning scheme which conforms to the Atari AHDI 3.00 spec should be
recognized by the new DKWEDGE_METHOD_TOS.
2024-04-02 22:30:03 +00:00
riastradh 40cfbdd6f3 acpihed(4): New driver for PNP0C33 to notify apei(4).
PNP0C33 denotes the ACPI Hardware Error Device, which exists only to
be a vector for event notifications.

PR kern/58046
2024-03-21 02:36:01 +00:00
riastradh 4b159fe528 apei(4): New driver for ACPI Platform Error Interfaces.
For now it is wired up only in x86 ALL kernels, and built as a module
for x86 and Arm.  Once it gets a little more testing on machines with
APEI, I would like to flip it on by default.

PR kern/58046
2024-03-20 17:11:42 +00:00
thorpej f36002f244 Move the at-shutdown call to resettodr() from cpu_reboot() to kern_reboot().
It's a small step, but it's a step.
2024-03-05 14:15:28 +00:00
andvar df634e507d s/optionms/options/ in copy-pasted comment. 2024-02-23 22:10:39 +00:00
andvar c865d5f423 s/attachement/attachment/ and s/detachement/detachment/. 2024-02-02 22:14:04 +00:00
christos c78676accc PR/57889: Ricardo Branco: ext2fs does not have user immutable and append
file flags, only system ones. Restrict those to the superuser. Before
the behavior was controlled by EXT2FS_SYSTEM_FLAGS. Make that behavior the
default.
2024-01-29 18:27:09 +00:00
mlelstv ee8fcedc92 In efiboot
- create bootinfo information only once.
- add fake biosgeom entries so that the kernel can distinguish between
  hard drives (with geom) and CD-ROM (without).
2024-01-06 21:26:43 +00:00
thorpej a6ce350454 Remove unnecessary <sys/malloc.h>. 2023-12-20 15:00:07 +00:00
mlelstv 7aa6293004 Align again with libsa (NFS_NOSYMLINK fix). 2023-12-14 08:06:23 +00:00
andvar 40470a808e Removing obsolete TTY_DEBUG option from ALL kernels. 2023-12-13 10:53:15 +00:00
mlelstv dcf3cbf86f Merge with generic libsa NFS code to minimize differences and to learn NFSv3. 2023-12-12 09:16:17 +00:00
tsutsui 81df437087 Replace several magic numbers with macro to describe GPT's hybrid MBR boot. 2023-12-08 16:29:04 +00:00
thorpej 4637e22ee7 Add btvmei + btvmeii and vme to ALL. 2023-12-05 16:32:38 +00:00
simonb eb82852fbe Note some large xstate stack objects what Somebody(tm) should look at
when they find some round tuits.
2023-11-20 03:05:48 +00:00
rin ddb267309a x86/dosboot: Drop no-longer-available -DSLOW for libz
It should be lost during merge from upstream.

We may introduce a similar hack again, if it is *really* required;
inflate_fast() may be dropped by using slow path unconditionally.
2023-11-06 07:09:08 +00:00
rin 4e85348786 x86/dosboot: Do not page-align data segment
4K alignment is too heavy burden for COM executable with 64K limit :)

Fix binary size overflow for clang/amd64.
2023-11-06 07:02:17 +00:00
rin 5893e8509c x86/dosboot: Allow NULL dereference to fetch command line arguments
DOS command line arguments are provided as struct psp at 0x0000;
see doscommain.c.

Recent versions of gcc and clang are clever enough to optimize code
block involving NULL dereference into ud2 insn.

Sprinkle -fno-delete-null-pointer-checks to doscommain.c to
prevent this behavior.

Note that dosboot.com for netbsd-9 and later was broken due to
this ``over optimization''. gcc 5.5.0 and clang 4.0.0 in netbsd-8
generate correct codes without this workaround.

XXX
Are there still use cases for dosboot.com? Does anyone want to
boot NetBSD from real-mode DOS in 2023?
2023-11-06 06:53:52 +00:00
chs feabd72f0c dtrace: add support for SMAP
Add support in dtrace for SMAP, so that actions like copyinstr() work.
It would be better if dtrace could use the SMAP_* hotpatch macros directly,
but the hotpatching code does not currently operate on kernel modules,
so we'll use some tiny functions in the base kernel for now.
2023-11-03 09:07:56 +00:00
msaitoh fa224bde18 eqos(4): Disable eqos(4) by default because it's not stable on x86. 2023-10-23 01:43:55 +00:00
msaitoh 0e91f20631 eqos(4): Add initial support for Intel Elkhart Lake internal Ethernet devices.
- Only tested on PSE SGMII 1G Ethernet MAC with MaxLinear GPY115.
 - I don't know why dmat64 doesn't work. eqos_attach() have a special
   code if EQOS_HW_FEATURE_ADDR64_32BIT(sc) is true, but it seems it doesn't
   work.
 - TODO:
 	Multiqueue support.
	Detach support.
2023-10-20 10:09:43 +00:00
bouyer 5fc163d6b5 Enable genfb in DOM0 kernels 2023-10-17 13:30:56 +00:00
bouyer e43896b392 Xen's start_info_t is larger than 512 bytes these days, so bump the copy
size to a whole PAGE_SIZE, and CTASSERT() that start_info_t is smaller.
Luckily we didn't use yet the parts skipped
2023-10-16 17:29:30 +00:00
ad 68fa584377 Arrange to update cached LWP credentials in userret() rather than during
syscall/trap entry, eliminating a test+branch on every syscall/trap.

This wasn't possible in the 3.99.x timeframe when l->l_cred came about
because there wasn't a reliable/timely way to force an ONPROC LWP running on
a remote CPU into the kernel (which is just about the only new thing in
this scheme).
2023-10-05 19:41:03 +00:00
ad a355028fa4 Eliminate l->l_ncsw and l->l_nivcsw. From memory think they were added
before we had per-LWP struct rusage; the same is now tracked there.
2023-10-04 20:28:05 +00:00
manu 87b995aca9 Fix build with -DNO_GPT 2023-10-02 00:02:33 +00:00
manu 2004a707cf Align the behavior of different boot methods in RAIDframe
We enforce the documented and paritally implemented behavior when
looking for the kernel in RAID 1 sets without a partition name given.
We search for:
- A GPT partition with bootme attribute set
- A FFS or LFS patititon
- The first partition
2023-09-28 15:46:55 +00:00
ad 06d6b10d9d Remove unused L_KPRIORITY. 2023-09-23 14:41:15 +00:00
rin 3029494a69 efiboot/x86: eficons.c: Explicitly include params.h for howmany()
NFC for -current and netbsd-10, but necessary for netbsd-[89] to
pull up raw IO serial port support (PR port-amd64/57523).
2023-09-14 03:05:15 +00:00
mrg 95613c87be x86: avoid annoying GCC 12 bounds check in curcpu() and curlwp().
these functions read %gs and return an pointer at an offset from this
value (the current cpu, or lwp pointers), and GCC is complaining that
they're accessing a array cpu_info[0] (ie, zero length, no storage.)

several attempts to workaround it have failed, and because of the
asm volatile nature of this, it seems very unlikely a compiler would
take this and do something wrong with it.
2023-09-04 20:58:52 +00:00
andvar 7707091822 newsmips/sn(4): rename SONIC_DEBUG to SNDEBUG for consistency.
nix this option from i386/amd64 ALL configs, it isn't used anywhere anymore.
2023-09-02 07:15:30 +00:00
christos a9d97cfcc6 Override these two booters with -Oz for clang since it produces smaller code
here.
2023-08-30 18:46:51 +00:00
christos 151e733117 Merge the OPT_SIZE flags. -Oz is not always producing smaller code that -Os,
so default to -Os for both, and we'll override where needed.
2023-08-30 18:45:46 +00:00
christos bab76bf4e5 Explicitly pass COPTS 2023-08-30 18:44:48 +00:00
riastradh 45475f6488 xen/x86: Enable heartbeat checks. 2023-08-05 14:38:43 +00:00
rin 6cf5ca46b9 x86/multiboot2: Fix short read for 64-bit ELF headers
XXX document this
At the moment, this cannot affect NetBSD/amd64, as we have not
supported multiboot for kernel side.

Found by GCC12.
2023-08-04 07:21:57 +00:00
andvar 87305e5a45 fix various typos in comments. 2023-08-01 21:26:27 +00:00
rin 2f98cf5924 MI and x86 efiboot: Fix device path type for PXE boot device.
It should be Messaging, not Media Device Path. Taken from OpenBSD, for
which this code was originally written:

https://cvsweb.openbsd.org/src/sys/arch/amd64/stand/efiboot/efipxe.c#rev1.6

> Network-based device paths use Messaging and not Media types.  Thus
> in reality the depth was always -1 which made the compare function
> a No-Op.  Properly check the device path depth value and look for
> the Messaging type instead to find the correct NIC.  This check
> never worked before and was uncovered by the last change.
>
> Regression noticed by bluhm@
2023-07-24 08:30:42 +00:00
rin b5b6f09cdf efiboot/x86: Add serial console support via raw I/O port access
Unfortunately, some (most?) UEFI implementations do not support
com ports by ``Serial I/O Protocol''.

``PNP0501-0'' and friends are not recognized also.

In this case, if user explicitly requires to switch to serial
console by ``consdev'' command, try to use raw I/O port access.

Ugly, but what FreeBSD does, at least.

Proposed as PR port-amd64/57523
2023-07-24 01:56:59 +00:00
riastradh 7fcf7bdd69 i386/XEN3PAE_DOMU: Pass -g to build debug data like GENERIC.
Needed for CTF data by dtrace when MKDEBUG=no MKDEBUGKERNEL=no.

XXX pullup-10
2023-07-22 15:19:17 +00:00
riastradh 49b0908ebe i386/XEN3PAE_DOM0: Pass -g to build debug data like GENERIC.
Needed for CTF data by dtrace when MKDEBUG=no MKDEBUGKERNEL=no.

XXX pullup-10
2023-07-22 15:19:03 +00:00
riastradh 67dc2b7d6f i386/XEN3PAE_DOMU: Enable KDTRACE_HOOKS.
XXX pullup-10
2023-07-21 02:10:37 +00:00