From nobody Sun Aug 9 11:32:08 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4hHwhn1Mfgz6nYVt for ; Sun, 09 Aug 2026 11:32:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hHwhm4mF6z44g0 for ; Sun, 09 Aug 2026 11:32:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786275128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KHvk/GhxagL67OU9csfV5urv/nGxqfLpVL2RlTw0nv8=; b=PJfocrFJqMk/IwGgmcpjcQCi3oQhSatSMwqhYQjjAwSIthCzf0uH3FFCL94bNdKVK5ROL+ /TyW3d/r5crYbI4k+Z7kc8ksCYhEvm+o48r9A13TkvJ2OU21CEtvW8UbD/ZG2ZgmcWb2Eb 2Pyqt8Jo1g8B7bru1ZJ169I4UbXaa7KvhJ8PsJAj0eiDSh0ThO6ylPwFXSOtJSCwyxhp04 EZOhGNsLDOitLg8nTW52xf+dfrQ39yz9isu0JuT25Ef/rhPNbPKF0NEM1WE3hbCtZoLfZB Q7m0bzZFC+aEk/04KyNdOyTHfABK/VbaRlXo/x7TIvFJZHApnZvho/BjLYZWyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786275128; a=rsa-sha256; cv=none; b=K9BsMsgVVfjWH40N7ER0XoP2iaBk2m9GefwypMbqLDMWV3EOXSUbtZr4/lzxYrD+NtEaJH vDuR0b84FMDON8FO80cVfQ9M/0kgdbIYcogVv73z+WhwJLAWRksuZW9t3r3BKQQoaGkAxZ l9adPjuGozf2wecfG3KhNYmuUfl6ECS/syTQrhwu2Pt5ingBa2p33x8aeqmS+rDyIfvh1H +HKxmQuDUDHce8P+3ri8JdEcy+Zmmo6aljFXca9JS8tx0YgGbHwTpKtWHpPKrkhbSz9hOL OWJdQSy4LPG2GwWNlWBsbyw10fIj8OBiCk5mZLV5D4FPrfllYLZsCjU6I6PfCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786275128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KHvk/GhxagL67OU9csfV5urv/nGxqfLpVL2RlTw0nv8=; b=yr3TmfRyArE2iLvarvlGMtRXVW5dZ+2AMjJ2oLFIyhwHCfYnteurGL/WyHty7vAVI59YBU ICbKgoqoqzWqD4ShUOJSJcUSD11WFJtaJ7gWhXIsBUcjusYv5gU3qrtH3OTlsBYA7/X46a yOC6oTTLe7t22J/cQPjjhPxWhvXTzQqrt/O/sgUkDOaoHCA1Mr8NzszFRCK6ShOiTcNkDU PV1WNLsicHyVnS6aZ5VltoVcAitoFL7FncLpzrsjoNXQEuLXdiESnri8ew3/4hgSIkppHF 88Z1sO5viXECMevibwTIQ4v87Duvlr+Bt1MIfFYQJAjU7yABa+JdkDG56oni6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hHwhm3LXbz6Dp for ; Sun, 09 Aug 2026 11:32:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3fd0f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 09 Aug 2026 11:32:08 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: da309ed47603 - main - pci_iov: Use native types for status ioctl List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: da309ed47603a6b55ca75ef392a630c7ea46004f Auto-Submitted: auto-generated Date: Sun, 09 Aug 2026 11:32:08 +0000 Message-Id: <6a786538.3fd0f.151b0b3e@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=da309ed47603a6b55ca75ef392a630c7ea46004f commit da309ed47603a6b55ca75ef392a630c7ea46004f Author: Kevin Bowling AuthorDate: 2026-08-09 11:12:04 +0000 Commit: Kevin Bowling CommitDate: 2026-08-09 11:26:58 +0000 pci_iov: Use native types for status ioctl IOV_CONFIG and IOV_GET_SCHEMA expose native pointers and size_t lengths, and pci_iov has no compat32 ioctl translation. Using fixed-width fields for IOV_GET_STATUS alone does not make the interface usable by 32-bit binaries on a 64-bit kernel. It instead complicates otherwise ordinary pointer and length handling. Use void * and size_t like the existing ioctls. This also makes the %zu diagnostic in iovctl correct on ILP32 and removes the unneeded PTRIN conversion. Fixes: 6f8b3be1fbd6 ("pci: Add SR-IOV status reporting") --- sys/dev/pci/pci_iov.c | 8 ++------ sys/sys/iov.h | 8 +++----- usr.sbin/iovctl/iovctl.c | 5 ++--- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/sys/dev/pci/pci_iov.c b/sys/dev/pci/pci_iov.c index 00a9c8e8be72..545d91e372f4 100644 --- a/sys/dev/pci/pci_iov.c +++ b/sys/dev/pci/pci_iov.c @@ -27,7 +27,6 @@ #include #include "opt_bus.h" -#include #include #include #include @@ -1109,8 +1108,7 @@ pci_iov_get_schema_ioctl(struct cdev *cdev, struct pci_iov_schema *output) { struct pci_devinfo *dinfo; void *packed; - size_t size; - uint64_t output_len; + size_t output_len, size; int error; packed = NULL; @@ -1161,8 +1159,6 @@ pci_iov_get_status_ioctl(struct cdev *cdev, struct pci_iov_status *output) status = NULL; packed = NULL; - if (output->reserved != 0) - return (EINVAL); mtx_lock(&Giant); dinfo = cdev->si_drv1; error = pci_iov_build_status(dinfo, &status); @@ -1179,7 +1175,7 @@ pci_iov_get_status_ioctl(struct cdev *cdev, struct pci_iov_status *output) output_len = output->len; output->len = size; if (size <= output_len) { - error = copyout(packed, PTRIN(output->status), size); + error = copyout(packed, output->status, size); if (error != 0) goto out; output->error = 0; diff --git a/sys/sys/iov.h b/sys/sys/iov.h index 67a890bba66f..04545c99dec2 100644 --- a/sys/sys/iov.h +++ b/sys/sys/iov.h @@ -200,13 +200,11 @@ struct pci_iov_schema #define IOV_STATUS_BOUND_DRIVER_NAME "bound-driver" #define IOV_STATUS_PASSTHROUGH_NAME "passthrough" -/* Fixed-width fields keep the ioctl ABI identical for 32-bit callers. */ struct pci_iov_status { - uint64_t status; /* User pointer to the packed nvlist. */ - uint64_t len; - int32_t error; - uint32_t reserved; /* Must be zero. */ + void *status; /* Packed nvlist. */ + size_t len; + int error; }; /* diff --git a/usr.sbin/iovctl/iovctl.c b/usr.sbin/iovctl/iovctl.c index 8938607a61e5..735b30340903 100644 --- a/usr.sbin/iovctl/iovctl.c +++ b/usr.sbin/iovctl/iovctl.c @@ -100,15 +100,14 @@ get_status(int fd) buflen = 0; for (;;) { memset(&arg, 0, sizeof(arg)); - arg.status = (uintptr_t)buf; + arg.status = buf; arg.len = buflen; error = ioctl(fd, IOV_GET_STATUS, &arg); if (error != 0) err(1, "Could not fetch SR-IOV status"); if (arg.error == 0) break; - if (arg.error != EMSGSIZE || arg.len <= buflen || - arg.len > SIZE_MAX) { + if (arg.error != EMSGSIZE || arg.len <= buflen) { errno = arg.error; err(1, "Could not fetch SR-IOV status"); }