Commit Graph

164489 Commits

Author SHA1 Message Date
nat 156a34ec6c Return early if PM data is not available.
This avoids random crashes on my Powerbook when using the mouse or keyboard.

The same was needed for the Powerbook 5xx/Duos (compile tested only).

XXX pullup-10, pullup-9, pullup-8.
2024-04-26 00:59:08 +00:00
thorpej a5de3f67cd Add a match quirk to prevent matching any interface on SiPEED FPGA
development boards (e.g. Tang Nano 9K).  The FT2232s on these boards
are wired up only for JTAG.
2024-04-25 01:33:03 +00:00
thorpej 290bc6be6b Remove a superflouous printf(). 2024-04-24 14:41:13 +00:00
macallan 93f802c8d4 allow userland to switch to 16bit colour 2024-04-24 11:49:58 +00:00
thorpej b6d00713ce b3_2706_map_vme(): Use VM_BESTFIT. 2024-04-24 02:31:26 +00:00
thorpej 727b6a78fb _vme_space_get(): Use VM_BESTFIT. 2024-04-24 02:27:33 +00:00
thorpej 7ed2924faf vmem_init(): Ensure that the quantum is a power of 2, and that if private
tags are being used, they are added to the arena before the first span is
added.
2024-04-24 02:08:03 +00:00
hans 0005ec5393 Sync the statistics DMA memory correctly before it is accessed. 2024-04-23 15:34:07 +00:00
andvar 1f05e87cf6 Surround full mp_cpu_start() method with NLAPIC > 0 guard.
Initialization is based on x86_ipi* functions, which are implemented only
when lapic flag is enabled.
2024-04-22 23:07:47 +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
andvar ac38f996f2 Add opt_pci.h include to fix NO_PCI_MSI_MSIX build.
(Path from Paolo Pisati in current_users@)

While here:
Simplify mp_cpu_start() ifdefs. MULTIPROCESSOR and HYPERV code falls under
NLAPIC > 0, thus just combine all blocks under this guard.
Rearrange opt_acpi.h include alphabetically.
2024-04-22 22:29:28 +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
riastradh 003bb55d1d drm: Allow DRM_IOCTL_GET_UNIQUE on render nodes.
On NetBSD, libdrm uses this to discover what kind of bus the device
is on, without which it refuses to expose the render node at all,
rendering it useless.  With this change, libdrm is able to use render
nodes on NetBSD.

Since this is just reading out information about the bus type and
bus/dev/func numbers, I don't think it's problematic to expose to
render nodes.

This requires tweaking the access path to the master.

PR kern/58180
2024-04-21 03:02:51 +00:00
riastradh 759aa94308 drm(4): Fix st_rdev in stat.
dminor->index already has the 64*type adjustment, as allocated in
drm_minor_alloc.

PR kern/58180
2024-04-21 03:02:39 +00:00
isaki 1dc7b48cb9 Fix typo in comment. 2024-04-20 05:38:40 +00:00
andvar 6b3c6f1ba6 s/Resorce/Resource/ in comment and log message. 2024-04-19 21:24:00 +00:00
ozaki-r a8ea6d9dcd frag6: fix calculation of fragment length
Because of the miscalculation, 32 bytes fragmented IPv6 packets
have been wrongly dropped.

See https://mail-index.netbsd.org/tech-net/2024/04/14/msg008741.html
for more details.

Patch from Yasuyuki KOZAKAI (with minor tweaks)
2024-04-19 05:04:06 +00:00
riastradh f09779b4fc ip6_output: Initialize plen for ip6_hopopts_input.
This funny little block in ip6_process_hopopts assumes it is
initialized as and behaves differently depending on whether it's zero
or not:

https://nxr.netbsd.org/xref/src/sys/netinet6/ip6_input.c?r=1.227#976

In the other call site, it is initialized to ip6->ip6_plen:

https://nxr.netbsd.org/xref/src/sys/netinet6/ip6_input.c?r=1.227#561

Reported-by: syzbot+587e3b707bdfe533283f@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?extid=587e3b707bdfe533283f
2024-04-19 00:55:35 +00:00
riastradh b7772f668d dounmount: Avoid &((struct vnode_impl *)NULL)->vi_vnode.
Member access of a null pointer is undefined, even if the result
should also be null because vi_vnode is at the start of vnode_impl.

Reported-by: syzbot+a4b2d13c0d6d4dac2d07@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?extid=a4b2d13c0d6d4dac2d07
2024-04-19 00:45:41 +00:00
riastradh a346ed41ae radeon_acpi.c: ifdef out unused function on NetBSD.
Should fix syzkaller build.
2024-04-18 23:33:15 +00:00
mlelstv 043f83d920 Renamed border/boundary variables to better describe their use.
Fix edge default values, factor out percentage calculation for more consistent
values. Use device_printf/DPRINTF to show errors instead of aprint variants.
Print raw input for debugging.

Correct capability parsing. Old devices were probed with nonexistent
commands and then used undefined boundary values that made them unusuable.

Fixes PR 57874.
2024-04-18 17:35:53 +00:00
skrll c41df0aeb5 Fix types in pmap_page_clear_attributes so that the top bits of
the u_long mdpg_attrs aren't dropped giving atomic_cas_ulong no
chance of completing if any of the top bits is set.

Update pmap_page_set_attributes for consistency.

An ATF test run completed for me with this fix.

port-riscv/58006: ATF tests no longer complete on riscv-riscv64
2024-04-18 12:16:23 +00:00
andvar 9626b6b63f s/resoure/resource/ in comments. 2024-04-18 10:32:03 +00:00
macallan de3a34d3b3 allow mapping of blitter registers 2024-04-18 04:52:43 +00:00
riastradh 4b9c628dc5 tap(4): Just use mutex_enter.
PR kern/58167
2024-04-17 18:52:54 +00:00
riastradh cf439d6998 tap(4): Use DETACH_FORCE with config_detach.
It doesn't make a difference here, because tap_detach never fails,
but let's make it more obvious at the call site that failure is
forbidden here.

No functional change intended.

PR kern/58166
2024-04-17 18:52:39 +00:00
riastradh 22440558de tap(4): Prune dead branches around tap_dev_destroyer.
No functional change intended.

PR kern/58166
2024-04-17 18:52:25 +00:00
riastradh a1472611d7 tap(4): Prune dead branches around tap_dev_close.
No functional change intended.

PR kern/58166
2024-04-17 18:32:13 +00:00
riastradh 212c9b3b52 modules/examples/fopsmapper: KNF, sprinkle comments
Missing: MP-safety; this is a kind of broken example.
2024-04-17 18:10:27 +00:00
riastradh 01905a679e sys/conf.h: Need sys/types.h for dev_t, devmajor_t. 2024-04-17 18:01:29 +00:00
andvar 9833779ad2 Regen. 2024-04-17 11:43:59 +00:00
andvar 62176de36c Add VIA VX900 HDMI. 2024-04-17 11:42:47 +00:00
macallan 7e941987be turn LEDs off when shutting down 2024-04-17 07:47:48 +00:00
skrll 8b50ae5697 Re-enable HEARTBEAT 2024-04-17 06:11:56 +00:00
maya c58b87a41e Add support for a range of USB serial adapters
From Cameron Williams in PR kern/58127
2024-04-17 02:34:45 +00:00
maya adfd544e25 Regen after usbdevs change 2024-04-17 02:33:04 +00:00
maya 78157b5b06 Add some USB serial adapters
From Cameron Williams in PR kern/58127
2024-04-17 02:32:08 +00:00
riastradh 770c9d5352 drm: Set CONFIG_ACPI in linux/acpi.h and make it build.
Leave a little ACPI-related functionality disabled for now, like
getting EDID out of ACPI -- needs a bit more work to make this work,
and I don't have hardware to work on that.

Should help with failures of the forms:

- unable to locate a BIOS ROM
- bios: unable to locate usable image

on various machines.
2024-04-16 14:34:01 +00:00
riastradh cb8d2cb71d nouveau: Rework nouveau2netbsd hack to get ACPI stuff. 2024-04-16 14:26:53 +00:00
kalvisd 6534916c0f vax/unimpl_emul.S: Initialise locations storing floating-point values with
a constant of the appropriate format
2024-04-16 00:03:30 +00:00
skrll 127563b6bc Fix alignment of ddb 'ps/[lw]' output. LID matches PID and has more digits. 2024-04-15 06:48:06 +00:00
andvar cec4798ac1 s/force_comile_error/force_compile_error/ 2024-04-14 18:02:55 +00:00
skrll 58b60df6e8 kern/58149: aarch64: Cannot return from a signal handler if SP was misaligned when the signal arrived
Apply the kernel diff from the PR

1. sendsig_siginfo() previously assumed that user SP was always aligned to
   16 bytes and could call signal handlers with SP misaligned. This is a
   wrong assumption because aarch64 demands that SP is aligned *only while*
   it's being used to access memory. Now it properly aligns it before
   pusing anything on the stack.

2. cpu_mcontext_validate() used to check if _REG_SP was aligned and
   considered the ucontext invalid otherwise. This meant if a signal was
   sent to a process whose SP was misaligned, the signal handler would fail
   to return because the ucontext passed from the kernel was an invalid
   one. Now setcontext(2) doesn't complain about misaligned SP.
2024-04-14 12:51:16 +00:00
skrll 08e3108a2e Trailing whitespace. 2024-04-14 07:56:13 +00:00
skrll 479be87edc port-arm/58135: reproducible pmap KASSERT failure for armv7 with NFS root
Don't unconditionally set XN in pmap_clearbit - only set it if a mapping
exists VM_PROT_EXEC is being cleared.

I've simplified the #ifdefs in the patch from the PR.
2024-04-13 12:28:01 +00:00
skrll e28131a8c8 Restore a space I accidentally removed from a copyright with
$NetBSD: pmap.c,v 1.396 2020/03/13 16:14:18 skrll Exp $
2024-04-13 10:36:01 +00:00
andvar 75ed7a9075 viac7temp(4): define module metadata using MODULE() macro and implement
viac7temp_modcmd() to handle module load/unload events.

Fixes PR kern/58148. Look OK by mrg@.

XXX pullup-10, -9, -8
2024-04-13 09:12:09 +00:00
jakllsch 151a4210f9 include opt_ntp.h for PPS_SYNC 2024-04-12 16:54:37 +00:00
pgoyette c1fde47216 Repair handling of ccd sysctls to not use newp as an index.
This is a work-around for kern/58051.  It is not a complete fix.
2024-04-12 05:04:02 +00:00
riastradh 7602e31d2a sys_futex.c: Fix illustration of futex(2).
In this illustration, we need to _set_ bit 1 to claim ownership, not
_clear_ bit 1 to claim ownership.

No functional change intended -- comment only.
2024-04-11 13:51:36 +00:00