Commit Graph

271309 Commits

Author SHA1 Message Date
martin 7f9ab2d078 Pull up following revision(s) (requested by tsutsui in ticket #1585):
sys/arch/vax/vsa/smg.c: revision 1.62

Make sure to call wsfont_init(9) as other framebuffer drivers.

Otherwise wsfont_find(9) always fails and wsdisplay(4) is not attached.
2023-02-06 16:51:00 +00:00
martin 3ad630b7a2 Ticket #1584 2023-02-04 16:21:31 +00:00
martin 15ad984ba1 Pull up following revision(s) (requested by uwe in ticket #1584):
lib/libc/thread-stub/thread-stub.c: revision 1.31

change libc sched_yield() stub to actually still call the syscall
instead of doing nothing when app is not linked with pthread; this matches
other systems

suggested by Mateusz Guzik in:
http://mail-index.netbsd.org/tech-kern/2020/07/19/msg026620.html
2023-02-04 16:19:20 +00:00
martin 05f89282f6 Ticket #1583 2023-02-04 14:42:43 +00:00
martin f5170af09b Pull up following revision(s) (requested by uwe in ticket #1583):
lib/libc/thread-stub/thread-stub.c: revision 1.30

Adjust the error return value of pthread_sigmask for !libpthread usage

Instead of returning -1, return errno on error.
Catch up after the fix in libpthread by Andrew Doran in 2008
in lib/libpthread/pthread_misc.c r.1.9.

It's an open question whether this function shall be used without linked
in the POSIX thread library.

Detected by Bruno Haible (GNU) and documented in gnulib in commit
"pthread_sigmask: Avoid test failure on NetBSD 8.0. " r. 4d16a83b0c1fcb6c.
2023-02-04 14:41:39 +00:00
martin e85caa14f0 Tickets #1581 and #1582 2023-02-01 19:01:48 +00:00
martin 22a14c54d2 Pull up following revision(s) (requested by tsutsui in ticket #1582):
sys/arch/vax/boot/Makefile.inc: revision 1.19

Make a vax bootloader work on 8MB VAXen.

64KB (0x800000 - 0x7f0000) is not enough for the bootloader itself
and more spaces are required for heap on loading a kernel.

https://mail-index.netbsd.org/port-vax/2023/01/24/msg004149.html

"Go ahead" from ragge@.  Should be pulled up to netbsd-10 and netbsd-9.
2023-02-01 19:00:53 +00:00
martin d86e0ea9bf Pull up following revision(s) (requested by tsutsui in ticket #1581):
sys/arch/next68k/next68k/machdep.c: revision 1.117
	sys/arch/next68k/dev/esp.c: revision 1.65
	sys/arch/next68k/include/cpu.h: revision 1.51
	sys/arch/next68k/include/bus_space.h: revision 1.20
	sys/arch/next68k/next68k/clock.c: revision 1.13

next68k: Fix delay_divisor value for proper delay(9) on 68040.

next68k: Specify proper constraints for bus_space_read region and multi ops.

These functions write the read data into memory at a specified pointer,
but without the "memory" constraint gcc could optimize out these ops
if the memory is allocated on local stack.

With this fix nextkbd(4) works again.
Should be pulled up to netbsd-10 and netbsd-9.

next68k: Fix silent stall of next68k esp(4) SCSI.

next68k esp(4) driver requires nextdma(4) interrupts at ipl 6
during ncr53c9x_intr() for esp(4) at ipl 3.  It worked on netbsd-5
and prior, but on netbsd-5 splbio() was changed from ipl 3 to 6
for SMP support and on netbsd-6 ncr53c9x driver was changed to
use mutex(9) instead of simple_lock(9), so nextdma interrupts
were no longer raised during ncr53c9x interrupt handler.

For now, just call mutex_exit(9) and mutex_enter(9) during
waiting nextdma(4) interrupts in MD esp_dma_intr() handler.

This could be wrong and the interrupt handler for nextdma should
be reorganized, but it just works.

Should be pulled up to netbsd-10 and netbsd-9.
2023-02-01 18:56:44 +00:00
martin 1702e0af0b Ticket #1580 2023-01-30 11:42:11 +00:00
martin c5837dfc62 Pull up following revision(s) (requested by thorpej in ticket #1580):
share/man/man4/puc.4: revision 1.44
	sys/dev/pci/pucdata.c: revision 1.114

Add and entry for the EXAR XR17V354 4-port UART.
From Hakan Engvall.
PR kern/57202
2023-01-30 11:35:15 +00:00
martin 323f2c2de7 Regen for ticket #1580 2023-01-30 11:33:45 +00:00
martin 734c2cef18 Pull up following revision(s) (requested by thorpej in ticket #1580):
sys/dev/pci/pcidevs: revision 1.1477

Add ID for the EXAR XR17V354 PCIe UART.
PR kern/57202
2023-01-30 11:32:22 +00:00
martin 32dbe59649 Tickets #1570 - #1579 2023-01-23 14:12:08 +00:00
martin 78fe554871 Pull up the following revisions, requested by msaitoh in ticket #1579:
sys/dev/pci/files.pci				1.442
	sys/dev/pci/ixgbe/ix_txrx.c			1.99-1.100
	sys/dev/pci/ixgbe/ixgbe.c			1.320-1.324 via patch
	sys/dev/pci/ixgbe/ixgbe_82598.c 		1.19
	sys/dev/pci/ixgbe/ixgbe_api.c			1.28
	sys/dev/pci/ixgbe/ixgbe_common.c		1.43
	sys/dev/pci/ixgbe/ixgbe_netbsd.h		1.17
	sys/dev/pci/ixgbe/ixv.c 			1.183

- Add an option for Tx to use deferred softint regardless of whether
  can get txq lock or not. It's off by default.
- Call txeof first, then rxeof for the consistency.
- Make three "Unsupported SFP+ module..." messages the same.
- KNF. Modify comment. Fix typo.
2023-01-23 14:04:41 +00:00
martin c38cc83b06 Pull up the following revisions, requested by msaitoh in ticket #1578:
sys/dev/pci/if_wm.c				1.764-1.767 via patch
	sys/dev/pci/if_wmreg.h				1.128

- Workaround for some hypervisor environments. The environments
  cannot stop e1000 interrupt immediately.
- Rename nq_txdesc' member "nqrx_ctx" to "nqtx_ctx". No functional
  change.
- Add comment. Modify comment.
- KNF.
2023-01-23 13:59:04 +00:00
martin 0dcd27c0b2 Apply patch, requested by mrg in ticket #1577:
Adjust for upstream patches for the followign CVEs:

   CVE-2022-46285, CVE-2022-44617, CVE-2022-4883, CVE-2020-14363,
   CVE-2022-46340, CVE-2022-46341, CVE-2022-46342 CVE-2022-46343,
   CVE-2022-46344, CVE-2022-46283, CVE-2021-4008, CVE-2021-4009,
   CVE-2021-4010, CVE-2021-4011
2023-01-23 13:43:07 +00:00
martin d1178fca4d Pull up following revision(s) (requested by uwe in ticket #1576):
usr.bin/locate/locate/updatedb.sh: revision 1.18

locate.updatedb: Add -- to the invocation of locate.code

A bigram can start with a dash/minus, don't let getopt misinterpret it
as an option.

From Hakan Engvall in PR misc/57191
2023-01-23 13:17:27 +00:00
martin d79d3862f2 Pull up the following revisions, requested by msaitoh in ticket #1575:
usr.sbin/cpuctl/arch/i386.c			1.129-1.135 (via patch)

- Print cpuid 7 sub-leaf 1 %ebx, %edx and sub-leaf 2 %edx.
- Add Raptor Lake and Sapphire Rapids.
- Modify messages a little.
2023-01-23 13:04:11 +00:00
martin f9416b3da8 Pull up the following revisions, requested by msaitoh in ticket #1574:
sys/arch/x86/include/specialreg.h		1.193-1.198

- Add CPUID Fn0000_0006 %eax bit 24 IA32_THERM_INTERRUPT MSR bit 25
  Hardware Feedback Notification support.
- Add CPUID Fn0000_0007 %ecx bit 29 ENQCMD.
- Add CPUID Fn0000_0007 %edx bit 1 SGX-KEYS.
- Add CPUID Fn0000_0007 %edx bit 5 UINTR(User INTeRrupts).
- Add CPUID Fn0000_0007 %edx bit 11 RTM_ALWAYS_ABORT.
- Add CPUID Fn0000_0007 %edx bit 22 AMX_BF16.
- Add CPUID Fn0000_0007 %edx bit 23 AVX512_FP16.
- Add CPUID Fn0000_0007 %edx bit 24 AMX_TILE.
- Add CPUID Fn0000_0007 %edx bit 25 AMX_INT8.
- Add CPUID Fn0000_0007 sub-leaf 1 %edx bit 18 CET_SSS.
- Add CPUID Fn0000_0007 sub-leaf 2 %edx definitions.
- Add CPUID Fn0000_000d sub-leaf 1 %eax bit 4 XFD.
- Add CPUID Fn0000_001d Tile Information.
- Add CPUID Fn0000_001e TMUL Information.
- Add CPUID Fn8000_0007 %eax RAS capabilities.
- Add CPUID Fn8000_0008 %ebx BTC_NO,
- Add cpuid Fn8000_000a x2AVIC, VNMI, IBSVIRT and ROGPT.
- Add CPUID Fn8000_001b Instruction-Based Sampling.
- Add CPUID Fn8000_001e Processor Topology Information.
- Add CPUID Fn8000_001f %eax RPMQUERY, VmplSSS, TscAuxVirt,
  VmgexitParam, VirtualTomMsr, IbsVirtGuest, SmtProtection,
  vsmCommPageMSR and NestedVirtSnpMsr.
- Add CPUID Fn8000_0021 AMD Extended Features Identification 2.
- Add CPUID Fn8000_0022 AMD Extended Performance Monitoring and Debug.
- Rename HW_FEEDBACK to HWI (Hardware Feedback Interface).
- Rename TSX_FORCE_ABORT to RTM_FORCE_ABORT.
- Modify comment. Both Intel and AMD support CPUID Fn0000000b.
- Modify comment. Hybrid Information -> Native Model ID Information.
- Use __BIT(). Add comment. Whitespace fix.
2023-01-23 13:00:53 +00:00
martin f0c1422782 Pull up the following revisions, requested by msaitoh in ticket #1573:
sys/dev/pci/piixpm.c				1.66,1.68-1.72 via patch
	sys/dev/pci/piixpmreg.h 			1.13

Add support new AMD chipsets that do not have indirect access
I/O ports.
2023-01-23 12:43:35 +00:00
martin e74255ca38 Pull up following revision(s) (requested by msaitoh in ticket #1572):
sys/arch/x86/pci/amdzentemp.c: revision 1.16

match zen3 "cezanne" (ryzen 5000-series APU.)
2023-01-23 12:27:33 +00:00
martin 3e24902ec0 Pull up following revision(s) (requested by msaitoh in ticket #1571):
sys/arch/x86/x86/procfs_machdep.c: revision 1.46

Add x2avic. Modify comment.
2023-01-23 12:23:53 +00:00
martin fafa9c64e7 Pull up the following revisions, requested by msaitoh in ticket #1570:
sys/dev/pci/xhci_pci.c				1.31 via patch
	sys/dev/usb/xhci.c				1.173-1.175
	sys/dev/usb/xhcivar.h				1.22

Support xHCI device which has USB 2 port only.
2023-01-23 12:05:36 +00:00
martin eea26eeb3c Tickets #1567 - #1569 2023-01-19 10:59:51 +00:00
martin b09be1f78c Pull up following revision(s) (requested by msaitoh in ticket #1569):
usr.bin/netstat/netstat.1: revision 1.76

Add note about "netstat -mssv".
2023-01-19 10:53:31 +00:00
martin 051495185f Pull up following revision(s) (requested by msaitoh in ticket #1568):
share/man/man4/lm.4: revision 1.38
	sys/dev/ic/nslm7x.c: revision 1.79
	sys/dev/isa/wbsio.c: revision 1.30
	sys/dev/isa/wbsioreg.h: revision 1.11

lm(4): Add Nuvoton NCT6797D support.
2023-01-19 10:40:25 +00:00
martin a50f46d018 Pull up following revision(s) (requested by skrll in ticket #1567):
common/lib/libc/arch/arm/string/strlen_arm.S: revision 1.11

Fix strnlen with a large maxlen argument by using unsigned comparison
conditions - from mlelstv.

I had a similar, but not quite as good patch.
2023-01-19 10:37:03 +00:00
martin ebd40d45aa Ticket #1566 2023-01-18 19:29:16 +00:00
martin 25208ee5c8 Regen for ticket #1566 2023-01-18 19:27:18 +00:00
martin cc8c7063c0 Pull up following revision(s) (requested by msaitoh in ticket #1566):
sys/dev/pci/sdhc_pci.c: revision 1.20
	sys/dev/pci/pcidevs: revision 1.1469
	sys/dev/pci/pcidevs: revision 1.1470
	sys/dev/pci/pcidevs: revision 1.1471
	sys/dev/pci/pcidevs: revision 1.1472
	sys/dev/pci/pcidevs: revision 1.1473
	sys/dev/pci/pcidevs: revision 1.1474
	sys/dev/pci/pcidevs: revision 1.1475
	sys/dev/pci/pcidevs: revision 1.1476

Add some AMD 17h/9xh devices from OpenBSD.
Add AMD F17/Axh devices.
Add some Xeon Scalable devices from OpenBSD.
Update Intel Elkhart Lake devices.
Add Elkhart Lake Shared SRAM.
Fix typo. s/SSC/SCC/.
Fix typo. No functional change.
add Aquantia (Marvell) AQC113 ethernet devices and the variants
Add AMD Family 19h/1xh devices.
2023-01-18 19:26:30 +00:00
martin 4b3d48ab09 Tickets #1564 and #1565 2023-01-07 15:04:01 +00:00
martin f74173e140 Pull up following revision(s) (requested by tsutsui in ticket #1565):
sys/arch/mac68k/conf/INSTALL: revision 1.58

Disable (comment out) options DIAGNOSTIC in INSTALL kernels.

It has been there since the initial revision 1.1 while
it was disabled in GENERIC in revision 1.121 back in 2002.

Briefly discussed in PR/57107
2023-01-07 15:02:38 +00:00
martin d72dc903c6 Pull up following revision(s) (requested by tsutsui in ticket #1564):
sys/arch/m68k/m68k/bus_dma.c: revision 1.39

Fix out of bounds invalidate (and writeback) in bus_dmamap_sync(9) ops.

Detected by the POOL_REDZONE check in sys/kern/subr_pool.c that
has been activated if options DIAGNOSTIC is enabled on post netbsd-9.

The extra invalidate on DMASYNC_PREREAD op discards redzone pattern
data allocated right after an mbuf cluster without proper writeback
to memory so that it triggers false redzone assertions on freeing mbufs.

This bug was my botch in rev 1.25 committed 15 years ago. (sigh)

Fixes PR/57107 (kernel panic on -current when configuring network
with sn(4) on mac68k), as actually the bus_dma(9) op changes
in the past days were introduced for mac68k sn(4) improvements
by using the MI SONIC (src/sys/dev/ic/dp83932.c) driver.

https://mail-index.netbsd.org/port-mac68k/2007/06/01/0001.html
2023-01-07 14:57:55 +00:00
martin 4f19f5bfe4 Ticket #1563 2023-01-06 13:47:36 +00:00
martin 225140883f Pull up following revision(s) (requested by kre in ticket #1563):
lib/libc/gen/err.3: revision 1.23

Add errc() and verrc() to the list of functions which do not return,
but exit() instead.

This was omitted when the *c() set of functions were added in 2014.
2023-01-06 13:46:21 +00:00
martin f6e31bed09 Tickets #1560 - #1562 2023-01-03 18:29:21 +00:00
martin 4482c9e216 Pull up following revision(s) (requested by nia in ticket #1561):
lib/libc/locale/setlocale.3: revision 1.22
	lib/libc/locale/setlocale.3: revision 1.23

setlocale.3: minor updates to reflect the current implementation

Reflect a couple of amendments noted by John Marino on tech-userlevel:
https://mail-index.netbsd.org/tech-userlevel/2021/10/19/msg013091.html

setlocale.3: Reflect state of NetBSD locale support in the 21st century

Don't use LC_COLLATE in a real code example, since a real call to set
LC_COLLATE will fail. Mention this.

Inconsistencies noticed by khw on IRC.
2023-01-03 18:28:06 +00:00
martin fad829e1f9 Pull up following revision(s) (requested by hannken in ticket #1560):
sbin/fsck/partutil.c: revision 1.18

Change getdiskinfo() to no longer infer the partition from the device name.

Since 2016-06-16 we create disk devices "<type><<unit>" as an alias
for "<type><<unit><part>" where "<part>" is the raw partition.
These devices are treated as invalid partitions and a zero geometry
is returned.

Take the partition from "st_rdev" instead.

Fix for PR kern/57134: st_size of stat on vnd raw partition sometimes
is 0, causing newfs to fail
2023-01-03 18:22:09 +00:00
martin 508ab19a62 Pull up following revision(s) (requested by gutteridge in ticket #1562):
sys/conf/copyright: revision 1.21

Welcome to 2023.  Wrap lines so the years fit in to 80 columns with
a leading kernel log timestamp.
2023-01-03 16:46:12 +00:00
martin d4f2d09f0c Ticket #1559 2023-01-02 10:14:20 +00:00
martin 65428ffcf2 Pull up following revision(s) (requested by tsutsui in ticket #1559):
usr.sbin/sysinst/arch/x68k/md.c: revision 1.13
	usr.sbin/sysinst/disklabel.c: revision 1.49
	usr.sbin/sysinst/defs.h: revision 1.85
	usr.sbin/sysinst/arch/amiga/md.c: revision 1.8
	usr.sbin/sysinst/arch/amiga/md.c: revision 1.9

Check on-disk disklabel properly even on ports without raw BSD disklabel.
Fixes PR install/56890.

Fix typo
2023-01-02 10:13:30 +00:00
snj b77b5ac55e 1558 2022-12-31 05:03:52 +00:00
snj 41e308cf32 Pull up following revision(s) (requested by martin in ticket #1558):
usr.sbin/sysinst/disklabel.c: 1.46-1.48
	usr.sbin/sysinst/label.c: 1.40-1.41

disklabel_can_add_partition() did not consider additional partitions
(while there still is space in the disklabel). Part of PR 56886.

Fix free space accounting for partition size changes and deletions.
Part of PR 56886.

renumber_partitions() needs to deal with removed/added partitions.

Fix free space accounting when partitions change size or are deleted.
Part of PR 56886.

Fix inverted condition in previous and only apply special handling for
the "all of NetBSD" partition when we have an outer MBR label.
Pointed out by Izumi Tsutsui. Hopefully the last fix needed for PR 56886.
2022-12-31 05:03:14 +00:00
martin 5aa0829020 Ticket #1557 2022-12-30 14:40:05 +00:00
martin 1ffee21705 Pull up following revision(s) (requested by tsutsui in ticket #1557):
sys/dev/ic/ahcisata_core.c: revision 1.83
	sys/dev/ic/ahcisata_core.c: revision 1.102
	sys/dev/ata/ata.c: revision 1.164
	sys/dev/ata/ata_wdc.c: revision 1.115
	sys/dev/ata/ata_recovery.c: revision 1.4
	sys/dev/ic/siisata.c: revision 1.42
	sys/dev/ic/wdc.c: revision 1.308
	sys/dev/ic/mvsata.c: revision 1.56
	sys/dev/scsipi/atapi_wdc.c: revision 1.138
	sys/dev/ic/siisata.c: revision 1.49
	sys/dev/ata/atavar.h: revision 1.105
	sys/dev/ata/wd.c: revision 1.460
	sys/dev/ata/ata.c: revision 1.155
	sys/dev/ata/wd.c: revision 1.462
	sys/dev/ata/atavar.h: revision 1.109
	sys/dev/ata/satapmp_subr.c: revision 1.16
	sys/dev/ic/wdc.c: revision 1.299
	sys/dev/ic/ahcisata_core.c: revision 1.93
	sys/dev/ata/ata_wdc.c: revision 1.120
	sys/dev/ic/wdcvar.h: revision 1.100
	sys/dev/scsipi/atapi_wdc.c: revision 1.141
	sys/dev/ic/mvsata.c: revision 1.61
	sys/dev/usb/umass_isdata.c	(apply patch)

drop wd lock in wdstart1() before calling the ata_bio hook; when called
from ata thread context, that can still need to sleep for wdc attachments
in wdcwait()

fix use-after-free for ata xfer on bio submission found by KASAN
driver ata_bio hooks read parts of the xfer after ata_exec_xfer()
call in order to determine return value, change so that the hook
doesn't return any value - callers do not care already,
as all I/O requests are asynchronous

this problem was uncovered by recent change for wd(4) to not hold
wd mutex during ata_bio call, the interrupt for the xfer might
thus actually fire immediately

adjust also ata_exec_command driver hooks similarily - remove all
completion and waiting logic from drivers, upper layer ata code
using AT_WAIT/AT_POLL changed to call ata_wait_cmd() itself
PR kern/55169 by Nick Hudson

Function declaration formating whitespace consistency.  NFCI.

PR kern/56403
Fix kernel freeze for wdc(4) variants with ATAC_CAP_NOIRQ:

(1) Change ata_xfer_ops:c_poll from void to int function. When it returns
    ATAPOLL_AGAIN, let ata_xfer_start() iterate itself again.
(2) Let wdc_ata_bio_poll() return ATAPOLL_AGAIN until ATA_ITSDONE is
    achieved.

A similar change has been made for mvsata(4) (see mvsata_bio_poll()),
and no functional changes for other devices.

This is how the drivers worked before jdolecek-ncq branch was merged.
Note that this changes are less likely to cause infinite recursion:

(1) wdc_ata_bio_intr() called from wdc_ata_bio_poll() asserts ATA_ITSDONE
    in its error handling paths via wdc_ata_bio_done().
(2) Return value from c_start (= wdc_ata_bio_start()) is checked in
    ata_xfer_start().

Therefore, errors encountered in ata_xfer_ops:c_poll and c_start routines
terminate the recursion for wdc(4). The situation is similar for mvsata(4).

Still, there is a possibility where ata_xfer_start() takes long time to
finish a normal operation. This can result in a delayed response for lower
priority interrupts. But, I've never observed such a situation, even when
heavy thrashing takes place for swap partition in wd(4).
"Go ahead" by jdolecek@.
2022-12-30 14:39:09 +00:00
martin 6e26e42445 Ticket #1556 2022-12-28 17:59:01 +00:00
martin 3710c8c989 Pull up following revision(s) (requested by nia in ticket #1556):
usr.bin/calendar/calendars/calendar.christian: revision 1.11

Update for 2023
2022-12-28 17:57:17 +00:00
martin 1146885838 Ticket #1555 2022-12-20 09:58:01 +00:00
martin 31b3d1fd45 Pull up following revision(s) (requested by hannken in ticket #1555):
sys/nfs/nfs_srvsocket.c: revision 1.5

When partitioning a mbuf chain with m_split() the last mbuf of the returned
tail chain is not necessarily the same as the last mbuf of the initial chain.

Always set "slp->ns_rawend" to the last mbuf of the tail chain to prevent
mbuf leaks and corruption.
2022-12-20 09:56:28 +00:00
snj d7cf06760d 155[34] 2022-12-14 15:41:43 +00:00