Commit Graph

253593 Commits

Author SHA1 Message Date
snj 7f9d1029fd regen for ticket 1754 2022-08-02 15:43:04 +00:00
snj 87544821dc Pull up following revision(s) (requested by msaitoh in ticket #1754):
sys/dev/pci/pcidevs: 1.1445-1.1460 via patch
Update pcidevs:
- Add Intel Alder Lake devices and Intel 600 Series PCH devices.
- Add some Intel Xeon Scalable / Skylake-E devices.
- Fix AMD F16_HB from 0x1568 to 0x1538.
- Add some devices for AMD and improve some descriptions to clarify.
- Add VMware AHCI and NVMe.
- Update Intel 700 series Ethernet devices.
- Add some Broadcom devices.
- Add some Broadcom / LSI RAID cards.
- Fix typos and whitespace.
2022-08-02 15:41:46 +00:00
martin 2f82a2c060 Ticket #1753 2022-08-01 09:38:58 +00:00
martin a43e648473 Pull up following revision(s) (requested by rin in ticket #1753):
sys/dev/usb/uslsa.c: revision 1.32

PR kern/56946
Baud rate must be in little endian for SLSA_R_SET_BAUDRATE request.
2022-08-01 09:38:02 +00:00
martin 3f55959057 Ticket #1752 2022-07-15 17:20:56 +00:00
martin 308d256ae4 Ticket #1751 2022-07-11 14:17:49 +00:00
martin e624e5bc14 Pull up the following revisions, requested by msaitoh in ticket #1751:
sys/dev/pci/if_wmreg.h				1.122-1.125 via patch
	sys/dev/pci/if_wmvar.h				1.48
	sys/dev/pci/if_wm.c				1.719-1.720,1.722-1.725,
							1.727-1.740 via patch

- wm_tick: Add missing splx(s) when not WM_MPSAFE.
- Print DMA range info if the system is booting in the verbose mode.
- Micro optimization:
  - Call m_freem(m) only if m0 == NULL.
  - Call wm_xxeof() only when limit > 0.
  - Don't set the more flag when there is no packet to process.
- No functional changes:
  - Call txeof first, then rxeof for the consistency.
  - Remove duplicated break.
  - Remove stray semicolons from struct declaration.
  - Fix value return from void function.
  - Use macros.
  - Modify comment.
  - KNF.
2022-07-11 14:15:57 +00:00
martin ffb0f04832 Remove bogus ticket #1748 entry that was actually a fixup of ticket #1746 2022-06-17 15:33:02 +00:00
martin 510310d90e Ticket #1748 2022-06-17 15:28:01 +00:00
martin 07f63c60f0 Pull up following revision(s) (requested by shm in ticket #1748):
sys/miscfs/procfs/procfs_vnops.c: revision 1.229

Add missing permission check
2022-06-17 15:27:10 +00:00
martin f9cc874c8b Ticket #1748 2022-06-06 11:10:24 +00:00
martin eccdcbef89 Apply patch, requested by msaitoh in ticket #1746:
sys/dev/pci/ixgbe/ixgbe.c	(apply patch)

Fix the location of "break" statement. No functional change intended.
2022-06-06 11:09:16 +00:00
martin 8fe46da81a Ticket #1747 2022-06-04 12:41:38 +00:00
martin 390483be90 Pull up following revision(s) (requested by tsutsui in ticket #1747):
sys/arch/atari/atari/stalloc.c: revision 1.17

Restore NULL pointer checks lost in rev 1.16.

Fixes PR port-atari/56859, ok'ed mlelstv@, and confirmed on TT030.
Should be pulled up to netbsd-9 and netbsd-8.
2022-06-04 12:40:28 +00:00
martin 2f5c45a5fc Ticket #1746 2022-06-03 12:33:11 +00:00
martin 2e5e7c1583 Pull up the following revisions, requestes by msaitoh in ticket #1746:
sys/dev/pci/ixgbe/ix_txrx.c			1.95
	sys/dev/pci/ixgbe/ixgbe.c			1.261,1.263,
							1.265-1.268,1.273,
							1.275-1.277,1.305,
							1.312,
							1.316-1.321 via patch
	sys/dev/pci/ixgbe/ixgbe.h			1.85 via patch
	sys/dev/pci/ixgbe/ixgbe_mbx.c			1.19
	sys/dev/pci/ixgbe/ixgbe_netbsd.h		1.15-1.16
	sys/dev/pci/ixgbe/ixgbe_type.h			1.46-1.47
	sys/dev/pci/ixgbe/ixgbe_x550.c			1.26
	sys/dev/pci/ixgbe/ixv.c				1.178,1.182 via patch

- Reduce code duplication between ixgbe_msix_admin() and
  ixgbe_legacy_irq().
  - Add missing code which was not in ixgbe_msix_admin() from
    ixgbe_legacy_irq() and vice versa.
  - Reorder code.
- Disable/enable the OTHER interrupts correctly.
- Don't return in the middle of ixgbe_msix_admin() when an flow
  director reinit failed. NetBSD currently doesn't support flow
  director, so this is not a real bug.
- Print ECC, PHY and temp error log using with ratecheck().
- Correctly re-enable queue interrupt in ixgbe_legacy_irq().
- Correctly enter the recovery mode.
- No functional change:
  - Add some debug printf()s.
  - Don't use "more" flag for simplify.
  - Use macro.
  - Fix typos in comment.
  - KNF.
2022-06-03 12:31:09 +00:00
martin 3bb5e95a91 Ticket #1745 2022-05-31 14:08:47 +00:00
martin c8a1a0ac50 Pull up following revision(s) (requested by msaitoh in ticket #1745):
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.98
	sys/dev/pci/ixgbe/ixv.c: revision 1.181
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.315
	sys/dev/pci/ixgbe/ixgbe.h: revision 1.86

bus_dmamem_unmap() before bus_dmamem_free(), otherwise we may give back meomry
which is still (and will stay) mapped.

Fixes one instance of "panic: HYPERVISOR_mmu_update failed" on Xen.
There may be others.

Fix a bug that the legacy interrupt doesn't work when MSI-X allocation failed.
Fixes PR kern/56857.

Remove unused adapter->msix_mem.
2022-05-31 14:07:51 +00:00
martin ec1e2b1c16 Ticket #1744 2022-05-30 17:08:06 +00:00
martin f3af587ab8 Pull up the following revisions, requested by msaitoh in ticket #1744:
sys/dev/pci/ixgbe/ixgbe.c			1.270,1.280,1.307-1.311,
							1.313-1.314 via patch
	sys/dev/pci/ixgbe/ix_txrx.c			1.96-1.97
	sys/dev/pci/ixgbe/ixv.c				1.179-1.180 via patch


- ixg(4): Print Printed Board Assembly (PBA) number.
- ixg(4): Add IFF_RUNNING check in ixgbe_legacy_irq() again. this might
  fix small race but it's not so dangerous.
- Add value check for {tx,rx}_process_limit sysctl to avoid setting
  wrong value.
- Add missing num_tx_desc sysctl.
- No functional change:
  - KNF a bit.
  - Simplify setting of EIAC register.
  - Move the definition of eicr_mask variable.
  - Enclose flow director stuff in ixgbe_intr_admin_common() with
    IXGBE_FIR which is not defined in NetBSD.
  - Modify comment for consistency.
  - Use cached rx_copy_len in ixgbe_rxeof().
2022-05-30 17:05:51 +00:00
bouyer f933ab38b0 Ticket 1743 2022-05-17 12:12:38 +00:00
bouyer 1b091a4475 Pull up following revision(s) (requested by kre in ticket #1743):
libexec/mail.local/mail.local.c: revision 1.29
fix local privilege escalation due to a race condition
NetBSD-SA2016-006 included an incomplete fix for CVE-2016-6253,
a local privilege escalation vulnerability in mail.local(8).
mail.local(8) attempts to open(2) a user's existing mailbox file
to append to it.  If that call fails, mail.local(8) will then issue
a second open(2) call to create the file (O_CREAT).
An attacker had the opportunity to create the file in question (as
a symlink, or link to some other file) in between these two open(2) calls.
Fix this by using O_EXCL in the 2nd open call, if the file exists when
that one happens, something is going wrong, so just abort.  Also, only
attempt that 2nd open if the reason the first failed was that the file
did not exist (this doesn't fix the issue, but it potentially saves
some cycles).
Thanks to Jan Schaumann for bringing this to our attention.
2022-05-17 12:12:14 +00:00
bouyer bf67040bd0 ticket 1742 2022-05-17 10:35:22 +00:00
bouyer 8f3b8d50ed Pull up following revision(s) via patch (requested by msaitoh in ticket #1454):
sys/dev/ic/mfi.c: revisions 1.63, 1.66-77
	sys/dev/ic/mfireg.h: revisions 1.11-1.20 via patch
	sys/dev/pci/mfi_pci.c: revision 1.21
	sys/dev/pci/mfii.c: revisions 1.6-1.7, 1.10-1.15
	share/man/man4/mfi.4: revision 1.13

Improve mfi(4) and mfii(4):
- Set 'ld_sync' to NULL as part of 'again', to prevent use-after-free.
- Add some code for the SKINNY variant to make Dell PERC H310 work.
- Print the percentage correctly when the background initialization is
  running.
- Clear mailbox to not to pass garbage data.
- Use union mbox instead of unit8_t xxx[] to avoid unaligned access.
- Set stripe size for BIOCVOL to show the size correctly in bioctl.
- Add support for iBBU-09 to show BBU voltage, current and temperature
  correctly.
- Fix typos in comments.
- Sprinkle static.
- Improve debug printf()s.
- KNF. Remove extra semicolon. Whitespace fixes.
2022-05-17 10:33:46 +00:00
martin 0eab68c44d Ticket #1741 2022-05-15 12:18:18 +00:00
martin b5e1204dc5 Pull up following revision(s) (requested by msaitoh in ticket #1741):
sbin/bioctl/bioctl.c: revision 1.19

bioctl(8): Don't print garbage bv_seconds.

This bug was added in bioctl.c rev. 1.7.

Before:
Volume Status       Size         Device/Label    Level Stripe
=============================================================
     0 Online       5.5T                 mfi0   RAID 5    64K  65535 seconds

After:
Volume Status       Size         Device/Label    Level Stripe
=============================================================
     0 Online       5.5T                 mfi0   RAID 5    64K
2022-05-15 12:15:53 +00:00
sborrill 199a2429d3 Ticket #1740 2022-05-04 15:37:12 +00:00
sborrill 18b4ce6e3f Pull up the following revisions(s) (requested by martin in ticket #1740):
sys/net/if_pppoe.c:	revision 1.179

pppoe(4): fix CVE-2022-29867 - discovery phase local network
mbuf corruption.
2022-05-04 15:36:35 +00:00
martin 8423e9fc9b Ticket #1739 2022-04-27 16:56:09 +00:00
martin bfe718d437 Pull up following revision(s) (requested by hannken in ticket #1739):
usr.sbin/quotaon/quotaon.c: revision 1.31
	lib/libquota/quota_oldfiles.c: revision 1.10
	sys/ufs/ufs/ufs_quota1.c: revision 1.25

Fix default quota file names, both user and group quota used the
same default name "QUOTAFILENAME, names[USRQUOTA])" resulting in
diagnostic assertion and possibly corrupted quota data.

Keep flag "UFS_QUOTA" set until the last quota is closed.
Prevents a live lock when dqrele() finds a struct with "dq_cnt == 1"
and flag "DQ_MOD" and cannot sync as flag UFS_QUOTA is unset.

As the quota type comes from the kernel and is only valid when
quota is on get the type before quota_off and after quota_on.
2022-04-27 16:55:18 +00:00
martin e84fc9b4c3 Ammend ticket #1738 2022-03-18 13:27:22 +00:00
martin 41fb7c68b5 Minimal build fix for ticket #1738 2022-03-18 13:26:38 +00:00
martin 1fc078b66e Ticket #1738 2022-03-15 10:01:03 +00:00
martin 913915853e Pull up following revision(s) (requested by ozaki-r in ticket #1738):
usr.sbin/puffs/mount_9p/node.c: revision 1.30
	usr.sbin/puffs/mount_9p/node.c: revision 1.31

mount_9p: fix writing to a file opened with write-only mode

With the page cache, writing data to a file may demand to read contents
from a storage to fill a page in the page cache first.

Opening a file with write-only mode by a user lets a mount_9p process
open a file with write-only mode too at a 9p server.  Thus, a read
request to the file from the page cache fails.

So we need to open a file always with read mode (internally) even if it
is opened with write-only mode by a user.

Note that the change doesn't mean that mount_9p allows users to read
contents from a file that is opened with write-only mode.

 -

mount_9p: check returned type for Tread
2022-03-15 10:00:14 +00:00
martin 5d7957e858 Ticket #1737 2022-03-13 09:54:47 +00:00
martin 8b0f5621f4 Pull up following revision(s) (requested by gutteridge in ticket #1737):
usr.bin/man/man.c: revision 1.69
	usr.bin/man/man.c: revision 1.70
	usr.bin/man/man.c: revision 1.72

man.c: fix -m option so it works as documented

Refactoring work in man.c r. 1.40 from twelve years ago introduced a
regression where input from the -m option was appended rather than
prepended to the search paths. Problem reported by C. Chapman on
netbsd-users.

man: fix type mismatch between enum and int (since yesterday)
No binary change.

man: remove unused global variable 'instype' (since yesterday)
No functional change.
2022-03-13 09:54:01 +00:00
martin 6ec4a83858 Ticket #1736 2022-02-24 10:08:40 +00:00
martin c7cd5ba238 Pull up following revision(s) (requested by kre in ticket #1736):
bin/sh/histedit.c: revision 1.60

After (a few days short of) 21 years, revert 1.25, which did nothing except
make the -e option to "fc" fail to work (the commit message was about some
other changes entirely, so I an only assume this was committed by mistake).

It says a lot about the use of the fc command that no-one noticed that
this did not work properly for all this time.

Internally in sh, it is possible for built in commands to use either
getopt(3) (from libc) or the much simpler internal shell nextopt() routine
for option (flag) parsing.    However it makes no sense to use getopt()
and then access a global variable set only by nextopt() instead of the
one getopt() sets (which is what the code had used previously, forever).

Use the correct variable again.

XXX pullup -9 -8  (-7 -6 -5 ...)
2022-02-24 10:07:46 +00:00
martin bb08e688bc Ticket #1735 2022-02-03 14:22:17 +00:00
martin 4287b92a88 Ticket #1734 2022-02-01 11:40:02 +00:00
martin f66278394f Pull up the following revisions, requested by msaitoh in ticket #1734:
sys/dev/pci/ixgbe/ixgbe.c			1.264,1.269,1.272,
							1.306 via patch

Four INTx related fixes:
- Fix a bug that the all interrupt sources are enabled when the
  interface is UP and the INTx line is shared with other devices.
- Fix a bug that it might incorrectly enable interrupt when
  IFF_RUNNING is not set.
- Don't process TX/RX if a queue interrupt isn't occurred.
- Increment legacy interrupt counter after checking INTx sharing.
2022-02-01 11:38:29 +00:00
martin bae8f4df80 Tickets #1730 - #1733 2022-01-31 17:59:40 +00:00
martin 828576cfe2 Pull up following revision(s) (requested by msaitoh in ticket #1733):
sys/arch/x86/x86/procfs_machdep.c: revision 1.43
	sys/arch/x86/x86/procfs_machdep.c: revision 1.44

Update for cpuid flags:
  - The table 11 was changed from CPUID 0x0f leaf 0 %edx to a Linux mapping.
  - The table 12 was changed from CPUID 0x0f leaf 1 %edx to CPUID 0x07 leaf 1
    %edx. Print avx_vnni and avx512_bf16.
  - Print cppc, enqcmd and arch_lbr.
  - Modify linux mapping. No used on NetBSD.

Fix procfs_machdep.c rev. 1.143. Print CPUID 0x00000007:1 %eax correctly.
2022-01-31 17:58:04 +00:00
martin 1df3819f58 Pull up following revision(s) (requested by msaitoh in ticket #1732):
usr.sbin/cpuctl/arch/i386.c: revision 1.125
	usr.sbin/cpuctl/arch/i386.c: revision 1.126
	usr.sbin/cpuctl/arch/i386.c: revision 1.127

Add Alder Lake, Rocket Lake and Sapphire Rapids. From the latest Intel SDM.
Remove debug code and simplify. No functional change.
Decode Intel Hybrid Information Enumeration (CPUID Fn0000_001a).
2022-01-31 17:52:44 +00:00
martin 99d1d9667f Pull up the following revisions (all via patch), requested by
msaitoh in ticket #1731:

	sys/arch/x86/include/specialreg.h		1.179-1.188

- Add CPUID definitions of Last Branch Record, Thread Director,
  AVX version of VNNI, Fast short REP MOV, HRESET, PPIN, Architectural
  LBR, Linear Address Masking and Hybrid Information from the latest
  Intel SDM.
- Add CPUID definitions of AddrMaskExt, INT_WBINVD, IbrsSameMode,
  EferLmsleUnsupported, PSFD and SecureTSC from AMD APM.
- Print CLFSH instead of CLFLUSH because both Intel and AMD documents
  say so.
- Modify comment. Add comment. Fix typo. Use __BIT(). KNF. Sort lines.
  No functional change.
2022-01-31 17:46:36 +00:00
martin f8426de6ef Pull up following revision(s) (requested by msaitoh in ticket #1730):
sys/dev/pci/ixgbe/ixgbe_mbx.h: revision 1.19
	sys/dev/pci/ixgbe/ixgbe_vf.c: revision 1.31
	sys/dev/pci/ixgbe/ixgbe_x540.c: revision 1.23
	sys/dev/pci/ixgbe/if_sriov.c: revision 1.17
	sys/dev/pci/ixgbe/ixv.c: revision 1.172
	sys/dev/pci/ixgbe/ixv.c: revision 1.173
	sys/dev/pci/ixgbe/ixgbe.c: revision 1.301
	sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.55
	sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.29
	sys/dev/pci/ixgbe/ixgbe_mbx.c: revision 1.16
	sys/dev/pci/ixgbe/ixgbe_mbx.c: revision 1.17
	sys/dev/pci/ixgbe/ixgbe_mbx.c: revision 1.18

Add code to support API version 1.5. No functional change.
   - This change adds almost all code to support API 1.5 except real negotiation
     and upgrade mailbox functions.
   - From ix-3.3.18, ix-3.3.22 and ixv-1.5.24.

Enable mailbox API 1.5 support. Tested on ESXi with ixgben 1.10.3.0.

Don't clear mailbox related counters in ixgbe_upgrade_mbx_params_vf().
Don't clear mailbox related counters in ixgbe_upgrade_mbx_params_pf().
2022-01-31 17:38:36 +00:00
martin 88c1a6ca30 Ticket #1729 2022-01-30 16:08:14 +00:00
martin a6411a2aea Pull up the following, requested by msaitoh in ticket #1729:
sys/dev/pci/ixgbe/if_sriov.c			1.12-1.16
	sys/dev/pci/ixgbe/ixgbe.c			1.295-1.297,1.300,1.304 via patch
	sys/dev/pci/ixgbe/ixgbe.h			1.84
	sys/dev/pci/ixgbe/ixgbe_82598.c			1.17-1.18
	sys/dev/pci/ixgbe/ixgbe_82598.h			1.9
	sys/dev/pci/ixgbe/ixgbe_82599.c			1.24-1.28
	sys/dev/pci/ixgbe/ixgbe_82599.h			1.8
	sys/dev/pci/ixgbe/ixgbe_api.c			1.26-1.27
	sys/dev/pci/ixgbe/ixgbe_api.h			1.16
	sys/dev/pci/ixgbe/ixgbe_bypass.h		1.3
	sys/dev/pci/ixgbe/ixgbe_common.c		1.34-1.42
	sys/dev/pci/ixgbe/ixgbe_common.h		1.15-1.16
	sys/dev/pci/ixgbe/ixgbe_dcb.c			1.12-1.13
	sys/dev/pci/ixgbe/ixgbe_dcb.h			1.8-1.9
	sys/dev/pci/ixgbe/ixgbe_dcb_82598.c		1.10-1.12
	sys/dev/pci/ixgbe/ixgbe_dcb_82598.h		1.8
	sys/dev/pci/ixgbe/ixgbe_dcb_82599.c		1.10-1.11
	sys/dev/pci/ixgbe/ixgbe_dcb_82599.h		1.8
	sys/dev/pci/ixgbe/ixgbe_fdir.h			1.4
	sys/dev/pci/ixgbe/ixgbe_features.h		1.4
	sys/dev/pci/ixgbe/ixgbe_mbx.c			1.13-1.15
	sys/dev/pci/ixgbe/ixgbe_mbx.h			1.15-1.18
	sys/dev/pci/ixgbe/ixgbe_netmap.c		1.5
	sys/dev/pci/ixgbe/ixgbe_osdep.c			1.8
	sys/dev/pci/ixgbe/ixgbe_osdep.h			1.31
	sys/dev/pci/ixgbe/ixgbe_phy.c			1.25-1.29
	sys/dev/pci/ixgbe/ixgbe_phy.h			1.13
	sys/dev/pci/ixgbe/ixgbe_rss.h			1.6
	sys/dev/pci/ixgbe/ixgbe_sriov.h			1.5
	sys/dev/pci/ixgbe/ixgbe_type.h			1.51-1.54
	sys/dev/pci/ixgbe/ixgbe_vf.c			1.28-1.29
	sys/dev/pci/ixgbe/ixgbe_vf.h			1.15
	sys/dev/pci/ixgbe/ixgbe_x540.c			1.20-1.22
	sys/dev/pci/ixgbe/ixgbe_x540.h			1.10
	sys/dev/pci/ixgbe/ixgbe_x550.c			1.21-1.25
	sys/dev/pci/ixgbe/ixgbe_x550.h			1.7
	sys/dev/pci/ixgbe/ixv.c				1.170, 1.174-1.175 via patch

- Add typecast for type mismatch.
- Fix retry count calculation of I2C read/write.
- Wait longer for link after fiber MAC setup.
- ixv(4): Use adapter->mta for the multicast array memory instead of
  the on-stack array.
- Match X550_PHY_ID correctly on X550.
- Print NVM image version on 82598.
- Use 64bit for lxon + lxoff.
- Don't expose garbage data of hw.ixvN.debug.
- Some NetBSD unrelated changes:
  - Fix infinite recursion on PCIe link down if VMDQ is used.
  - Move PF mailbox initialization from ixgbe_attach() to
    ixgbe_init_iov().
  - Add IPv6 mask for flow director.
  - Change error level in ixgbe_fc_autoneg().
  - Check host interface return status when writing NVM.
  - Change DCB credit parameters.
- Restore some mailbox related functions. Revert part of ixgbe_mbx.c
  rev. 1.7 and ixgbe_mbx.h rev. 1.11. No functional change.
- Rename IXGBE_VT_MSGTYPE_{ACK,NACK} to
  IXGBE_VT_MSGTYPE_{SUCCESS,FAILURE}. No functional change.
- Remove unused argument. Change argument.
- Remove unnecessary return value check.
- Remove debug error message.
- Remove dead code.
- Add some unused macros.
- Fix typo in comment.
- Rename some functions.
- Sort lines, modify comment.
- Whitespace fix.
2022-01-30 16:06:35 +00:00
martin f67212c27d Ticket #1724 - #1728 2022-01-29 17:13:08 +00:00
martin 4488a55702 Pull up the following revisions, requested by msaitoh in ticket #1728:
sys/dev/pci/pci_subr.c				1.232-1.239 via patch
	sys/dev/pci/pcireg.h				1.62-1.63

- Decode link control2's Compliance Preset/De-emphasis more.
- Decode Physical Layer 16.0 GT/s extended capability.
- Decode Lane Margining at the Receiver extended capability.
- Print "reserved" instead of "unknown" when printing equalization
  preset. One of them is known to be the default value.
- Fix typo.
2022-01-29 17:11:22 +00:00