From nobody Wed Jul 5 13:07:54 2023 X-Original-To: dev-commits-src-all@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 4Qx0MH0FgCz4mDm7; Wed, 5 Jul 2023 13:07:55 +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 4Qx0MG6mSDz3CQw; Wed, 5 Jul 2023 13:07:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688562475; 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=3ftFMI6ZBFPGl26R3glg6WPHH7DeXFtoI9k0rJhiEcM=; b=nVrGxiBpt3mpocPhG8HCzceiwWLT85iZ+layVpGvk7k27trZYSCfLUu5oDUeWKen33h8mS UtulHGRie4yUMPDn0QKrykCujLcZKNBoFiaE9zeq0L3Qa5C2T3ARW863nN8j+O99QgFukG FLlqqQyflZ7I7re/pl7m3byUc0U63RZhBVJEbfSZhm4nCiu3sBoGLmqKDAnz5aQeiunxNi XOhZ6WTTeNiIpy5n57l7Ipg9f8BM5o2LZYKfESU4QORgP5rnsgaD7D0G5BFeupVNOm/yuM oWyPEwgbVDBGj5zudoQAaYwW5w32a35WC/jJ9AZPOYtoEBOmWHLu9ITHrEl+Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1688562474; 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=3ftFMI6ZBFPGl26R3glg6WPHH7DeXFtoI9k0rJhiEcM=; b=ZzN34+tMk4/vtXSC7TYdTj5U4Zm+E7zOIA4V2zX4q5dBjlpWGZQ62M6DcOfMh2+c2zJ2ig 1SFtHwHG4/D0TcajAO5tuc+eF7kyvotfqhpDYH2j5q0vimr6m1kuY5j3fwDKusibMgLGqh MrtXexb5MQHKdKk77B/EqbL1I0Bi5oTiW+IFYGOINV0rIJBPD+btoiCgqdw7Fxmj1mtdsj drN2wqx5FoNgCB7VM55DMVk/zRggswI4zSffS+PvOyEVb90V2Ihop4k1QuQJKrA6t1ILfT AtYQcMQ+KMnR8VyM8f17mGixZDFb7yJe8QmF8TVIcp3teCH+PFu2Kqomtgj+2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1688562474; a=rsa-sha256; cv=none; b=r23THODru7QbFRmVVmj14/Tor/Q3JTELQwovKpbdghbiq7EZ1st4E5ePaBxyQSAfoFjwyj /mY6yLGDRUDwWIziDn2aQjkECKrwevXvctYSWsgyXQa1jhUGCaV57xY6QVhAofrDvZBPRr C9MiR4SvEB6iedZe0qCfr5qdlR8Gg6hErQrzpH+Y1VxV4BiSY9qrUGCvi4es85Ew2yUtwC FAqpqh6WL4Gh1fzH9uJD1cRu+6nSUkiHSz/FaBoBC74NNumwjSXnTqHl+RWKS3vg0PWU8m bYfMzlR9lJkDLc5UODAiYAZCwnNXdRilCRGvpL3f9PfjA7KR9NZqRv0P/1V/yw== 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 4Qx0MG5ncNzGfF; Wed, 5 Jul 2023 13:07:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 365D7sWB071231; Wed, 5 Jul 2023 13:07:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 365D7sf8071230; Wed, 5 Jul 2023 13:07:54 GMT (envelope-from git) Date: Wed, 5 Jul 2023 13:07:54 GMT Message-Id: <202307051307.365D7sf8071230@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: b16a120b3b9b - stable/13 - bhyve: Rename a pci_cfgrw() parameter List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b16a120b3b9b682944da8d54d826e52fa7720e04 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b16a120b3b9b682944da8d54d826e52fa7720e04 commit b16a120b3b9b682944da8d54d826e52fa7720e04 Author: Mark Johnston AuthorDate: 2023-06-28 20:06:37 +0000 Commit: Mark Johnston CommitDate: 2023-07-05 13:06:59 +0000 bhyve: Rename a pci_cfgrw() parameter pci_cfgrw() may be called via a write to the extended config space, which is memory-mapped. In this case, the name "eax" is misleading. Give it a more generic name. No functional change intended. Reviewed by: corvink, jhb MFC after: 1 week Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D40732 (cherry picked from commit f4841d8af0cd42c16fa66529bfde7b3a8b4f16d6) --- usr.sbin/bhyve/pci_emul.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c index 41b7718e6935..34ce3cb7d49a 100644 --- a/usr.sbin/bhyve/pci_emul.c +++ b/usr.sbin/bhyve/pci_emul.c @@ -2099,7 +2099,7 @@ pci_emul_cmdsts_write(struct pci_devinst *pi, int coff, uint32_t new, int bytes) static void pci_cfgrw(int in, int bus, int slot, int func, int coff, int bytes, - uint32_t *eax) + uint32_t *valp) { struct businfo *bi; struct slotinfo *si; @@ -2121,7 +2121,7 @@ pci_cfgrw(int in, int bus, int slot, int func, int coff, int bytes, if (pi == NULL || (bytes != 1 && bytes != 2 && bytes != 4) || (coff & (bytes - 1)) != 0) { if (in) - *eax = 0xffffffff; + *valp = 0xffffffff; return; } @@ -2131,7 +2131,7 @@ pci_cfgrw(int in, int bus, int slot, int func, int coff, int bytes, */ if (coff >= PCI_REGMAX + 1) { if (in) { - *eax = 0xffffffff; + *valp = 0xffffffff; /* * Extended capabilities begin at offset 256 in config * space. Absence of extended capabilities is signaled @@ -2139,7 +2139,7 @@ pci_cfgrw(int in, int bus, int slot, int func, int coff, int bytes, * offset 256. */ if (coff <= PCI_REGMAX + 4) - *eax = 0x00000000; + *valp = 0x00000000; } return; } @@ -2152,19 +2152,19 @@ pci_cfgrw(int in, int bus, int slot, int func, int coff, int bytes, if (in) { /* Let the device emulation override the default handler */ if (pe->pe_cfgread != NULL) { - needcfg = pe->pe_cfgread(pi, coff, bytes, eax); + needcfg = pe->pe_cfgread(pi, coff, bytes, valp); } else { needcfg = 1; } if (needcfg) - *eax = CFGREAD(pi, coff, bytes); + *valp = CFGREAD(pi, coff, bytes); - pci_emul_hdrtype_fixup(bus, slot, coff, bytes, eax); + pci_emul_hdrtype_fixup(bus, slot, coff, bytes, valp); } else { /* Let the device emulation override the default handler */ if (pe->pe_cfgwrite != NULL && - (*pe->pe_cfgwrite)(pi, coff, bytes, *eax) == 0) + (*pe->pe_cfgwrite)(pi, coff, bytes, *valp) == 0) return; /* @@ -2193,7 +2193,7 @@ pci_cfgrw(int in, int bus, int slot, int func, int coff, int bytes, pi->pi_bar[idx].addr = bar = 0; break; case PCIBAR_IO: - addr = *eax & mask; + addr = *valp & mask; addr &= 0xffff; bar = addr | pi->pi_bar[idx].lobits; /* @@ -2205,7 +2205,7 @@ pci_cfgrw(int in, int bus, int slot, int func, int coff, int bytes, } break; case PCIBAR_MEM32: - addr = bar = *eax & mask; + addr = bar = *valp & mask; bar |= pi->pi_bar[idx].lobits; if (addr != pi->pi_bar[idx].addr) { update_bar_address(pi, addr, idx, @@ -2213,7 +2213,7 @@ pci_cfgrw(int in, int bus, int slot, int func, int coff, int bytes, } break; case PCIBAR_MEM64: - addr = bar = *eax & mask; + addr = bar = *valp & mask; bar |= pi->pi_bar[idx].lobits; if (addr != (uint32_t)pi->pi_bar[idx].addr) { update_bar_address(pi, addr, idx, @@ -2222,7 +2222,7 @@ pci_cfgrw(int in, int bus, int slot, int func, int coff, int bytes, break; case PCIBAR_MEMHI64: mask = ~(pi->pi_bar[idx - 1].size - 1); - addr = ((uint64_t)*eax << 32) & mask; + addr = ((uint64_t)*valp << 32) & mask; bar = addr >> 32; if (bar != pi->pi_bar[idx - 1].addr >> 32) { update_bar_address(pi, addr, idx - 1, @@ -2230,12 +2230,12 @@ pci_cfgrw(int in, int bus, int slot, int func, int coff, int bytes, } break; case PCIBAR_ROM: - addr = bar = *eax & mask; + addr = bar = *valp & mask; if (memen(pi) && romen(pi)) { unregister_bar(pi, idx); } pi->pi_bar[idx].addr = addr; - pi->pi_bar[idx].lobits = *eax & + pi->pi_bar[idx].lobits = *valp & PCIM_BIOS_ENABLE; /* romen could have changed it value */ if (memen(pi) && romen(pi)) { @@ -2249,11 +2249,11 @@ pci_cfgrw(int in, int bus, int slot, int func, int coff, int bytes, pci_set_cfgdata32(pi, coff, bar); } else if (pci_emul_iscap(pi, coff)) { - pci_emul_capwrite(pi, coff, bytes, *eax, 0, 0); + pci_emul_capwrite(pi, coff, bytes, *valp, 0, 0); } else if (coff >= PCIR_COMMAND && coff < PCIR_REVID) { - pci_emul_cmdsts_write(pi, coff, *eax, bytes); + pci_emul_cmdsts_write(pi, coff, *valp, bytes); } else { - CFGWRITE(pi, coff, *eax, bytes); + CFGWRITE(pi, coff, *valp, bytes); } } }