From nobody Thu Jan 26 22:34:54 2023 X-Original-To: dev-commits-src-branches@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 4P2wWL2x2dz3cCSW; Thu, 26 Jan 2023 22:34:54 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P2wWL28jJz4D7D; Thu, 26 Jan 2023 22:34:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674772494; 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=e0leYdOm78nEpOmmNdrG4Y1vN1TmI7MElf4L+ZvAa7Y=; b=i6tNqvxnCk+VLnnFB6vn0dZZmkOZnR0fkjNnPC65Oamh1rLTj8Txkm+nASlbg0DI3REMt4 o/wwmYQx1aJHyGBXLY0DFMi06zUCejz6gSWOP9Fs+2LzOZHxs5qNJztes4JxVNnBnR/YyR i7F9/wUECaXb9aGpgFkzVSK+2XZUC09ANXWPuN8AAaGCl20m0+chWH7CqRXVHctIBPdcy3 pYu6+bS6R5oGFYThvDuaV0tT8mlB3ijkmsqSmRxnJnXYAMq/ILsoNmnURUohZ5jexuJq8r GDBBjWJUVNAjw08UzgZ0hqTnCGI0PBu5corheO5jSHkOLs2Nmt2GIStwQfztpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674772494; 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=e0leYdOm78nEpOmmNdrG4Y1vN1TmI7MElf4L+ZvAa7Y=; b=LADyYbtXlIBtjRe9QihaaRKBBUW7nLs2PuDUuYMTXgraxVDJyfkXI+QmXORcwOQ6ktIo3l lzxSSEYxGAWp48lvJLYmj3T1dEtw41AuVS0/P+eZTJto8WPwTQCMNAU0nXNVkwnFus4HTR o4a4kVw115ae1DBxiXh7x9aYvHhgrfAgxpArwwO4Nflrh7Fb5EAx2AVbjvoShLneeYai5G e6kdjrldqfOPZ39VfGn7AhkjfNnkvL9Q4EzZGlJRiOl4rW5kgYNnXtE8L+N5pxhHkK1BWJ 8vmRlBa7OB3Rwdmh9YkVjLDDYhVMH5d41C7jCmlmqFqaVOwdXFjfKy266ng9jQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674772494; a=rsa-sha256; cv=none; b=w3HUJOsGzD4HZJs/li85VPhGRW4HFPMdQoxbYsAi+wJV6QYD9OPFiU8L7a9G6m0w9iyCOe kIh5L+sEnYvtB+jTfSzsWzyXT2HEYhjg3BUoo0thiZUix/a6ZwqhPSx7kpQPFbsINlTYh0 Fk8e8pm6RY0gK9c8ZaJv6xoFHdY/hzW0jmoq/atu2di49iaynI7BzPvfdk/HH4jnSOUm1A WXwj5wT+VpTCPpMqepPzjr7lYcnLJ85pxTYuhu6vTCooJOMwwq0595wipK25n8SrPeLQ1W WlwgwQU0fugpgne+TRaC/xg5NeFEWSFuBcRemr4lnMZhSVYMP8DwndUHftJ1Mw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P2wWL1FbTzm7s; Thu, 26 Jan 2023 22:34:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30QMYscN051374; Thu, 26 Jan 2023 22:34:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30QMYseX051373; Thu, 26 Jan 2023 22:34:54 GMT (envelope-from git) Date: Thu, 26 Jan 2023 22:34:54 GMT Message-Id: <202301262234.30QMYseX051373@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 8506352dd517 - stable/13 - bhyve: Pass a vCPU ID of 0 to vm_setup_pptdev_msi*. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8506352dd517c0a6df4dac434929d4ee40ecc5f7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8506352dd517c0a6df4dac434929d4ee40ecc5f7 commit 8506352dd517c0a6df4dac434929d4ee40ecc5f7 Author: John Baldwin AuthorDate: 2022-12-09 18:28:11 +0000 Commit: John Baldwin CommitDate: 2023-01-26 22:16:35 +0000 bhyve: Pass a vCPU ID of 0 to vm_setup_pptdev_msi*. These ioctls are not vCPU-specific and the ioctl now ignores the vCPU ID. 0 is used instead of -1 to provide limited forwards compatibility. Reviewed by: corvink, markj Differential Revision: https://reviews.freebsd.org/D37651 (cherry picked from commit 0857e5555d77357e34ea6d70b28ead6335e41d33) --- usr.sbin/bhyve/pci_passthru.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/usr.sbin/bhyve/pci_passthru.c b/usr.sbin/bhyve/pci_passthru.c index 285874f3925d..65df3a0a162b 100644 --- a/usr.sbin/bhyve/pci_passthru.c +++ b/usr.sbin/bhyve/pci_passthru.c @@ -386,7 +386,7 @@ msix_table_read(struct passthru_softc *sc, uint64_t offset, int size) } static void -msix_table_write(struct vmctx *ctx, int vcpu, struct passthru_softc *sc, +msix_table_write(struct vmctx *ctx, struct passthru_softc *sc, uint64_t offset, int size, uint64_t data) { struct pci_devinst *pi; @@ -445,7 +445,7 @@ msix_table_write(struct vmctx *ctx, int vcpu, struct passthru_softc *sc, /* If the entry is masked, don't set it up */ if ((entry->vector_control & PCIM_MSIX_VCTRL_MASK) == 0 || (vector_control & PCIM_MSIX_VCTRL_MASK) == 0) { - (void)vm_setup_pptdev_msix(ctx, vcpu, + (void)vm_setup_pptdev_msix(ctx, 0, sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, sc->psc_sel.pc_func, index, entry->addr, entry->msg_data, entry->vector_control); @@ -955,7 +955,7 @@ passthru_cfgread(struct vmctx *ctx __unused, int vcpu __unused, } static int -passthru_cfgwrite(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, +passthru_cfgwrite(struct vmctx *ctx, int vcpu __unused, struct pci_devinst *pi, int coff, int bytes, uint32_t val) { int error, msix_table_entries, i; @@ -976,7 +976,7 @@ passthru_cfgwrite(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, if (msicap_access(sc, coff)) { pci_emul_capwrite(pi, coff, bytes, val, sc->psc_msi.capoff, PCIY_MSI); - error = vm_setup_pptdev_msi(ctx, vcpu, sc->psc_sel.pc_bus, + error = vm_setup_pptdev_msi(ctx, 0, sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, sc->psc_sel.pc_func, pi->pi_msi.addr, pi->pi_msi.msg_data, pi->pi_msi.maxmsgnum); @@ -991,7 +991,7 @@ passthru_cfgwrite(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, if (pi->pi_msix.enabled) { msix_table_entries = pi->pi_msix.table_count; for (i = 0; i < msix_table_entries; i++) { - error = vm_setup_pptdev_msix(ctx, vcpu, + error = vm_setup_pptdev_msix(ctx, 0, sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, sc->psc_sel.pc_func, i, pi->pi_msix.table[i].addr, @@ -1036,8 +1036,8 @@ passthru_cfgwrite(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, } static void -passthru_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx, - uint64_t offset, int size, uint64_t value) +passthru_write(struct vmctx *ctx, int vcpu __unused, struct pci_devinst *pi, + int baridx, uint64_t offset, int size, uint64_t value) { struct passthru_softc *sc; struct pci_bar_ioreq pio; @@ -1045,7 +1045,7 @@ passthru_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx, sc = pi->pi_arg; if (baridx == pci_msix_table_bar(pi)) { - msix_table_write(ctx, vcpu, sc, offset, size, value); + msix_table_write(ctx, sc, offset, size, value); } else { assert(pi->pi_bar[baridx].type == PCIBAR_IO); assert(size == 1 || size == 2 || size == 4);