From nobody Tue Apr 11 06:41:52 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 4Pwbq502lDz44DNW; Tue, 11 Apr 2023 06:41:53 +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 4Pwbq44J9Fz3nQ3; Tue, 11 Apr 2023 06:41:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681195312; 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=P0X4/MPsLQmYDzt8YaOWhTA84vBChpZy/GuiUl9fKJc=; b=WId7sjbPcNiMN1SDhxiYer1R3VZQ/zVy8pzBIansDWZ7eGLkfzEjOGLrHM2I8EiGXAos7W aAE/np4GiAqzSkbE7sBixb1jZRyMyJ9E2+aX1vsCinIvVvxppM2Jxx+AYCv2adh0GoKsY0 324JQD3U7xX9r3n7TYFc+1pe2rixY9255GhkpxTnR8wNoGX0kplCjKit4NGnu9ak4/vxtf aQ102RGZvkLmRhT7jHp5dAP9xk1YtQ/8TObgP/u5rWa3E+9fPRIasC0mZ4R7LrJsaoP2yD Z1YWP5UgQCOdihj0NaEhoXeU2rE4UIxjJnDGtuBuFjIX4g/NVopjwPQp1BckDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681195312; 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=P0X4/MPsLQmYDzt8YaOWhTA84vBChpZy/GuiUl9fKJc=; b=GVNX4ukS2Gt9hnKbeYFOE4tYXR0uAxZdyotZxN6p6+w1L7W/P/QD7OSuUoOu6hx0sO0Fy+ ipd7Tjeln/ehvVR877FWdESpb+E1xMzfIMJWBQfSWqVdH9FdFNcvQ4cN9+J3daVKMyjh83 gDPpQsJMSG1uLqLuhj0brLjiI5BrDISc9VeRHFtDy0HTSEdGa7iH1gtgvVLOUrejjT+lD9 wqrQ06qSK6Wxtixb3tXO2yCqywlVbFaBbNkSjvt7WUDSYu3WZ/FymPsJkKsR5EVAq0rUTI G0CvDNCliDrC/dEGs9ACd5RI7W9JMEzqrN+oau0FzO0DF+F9Q4gupEFVkYzlIQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681195312; a=rsa-sha256; cv=none; b=QDqpGr3IMTEufWIJizUdT9G/KNnHsf5NBkZi89+FGX8d43o+eOfBgj56nOme9WmFnEuVeZ DEPk0j417ElJ/37blPg0+etdZUUSJVJQu+Gq0IrGMFN9rQ08hFQ5gzarYNStj/l5SDEjCn XsLT+AHR24oiXxn+mboXW8Kprbt8Rh2zlUn5XZdivxGd2Dw2STQ8hPOB9uX7OC91HQp9Rw Y3hBt9KrtSAK0yrvA+47oKu6nEOJxLGoTdTktVFBNPhxT6f14QEC0um75ta/HkKh6SUsZP CpEb5DUWvLIqetyHZMnvzkay6/fH8HhfFVy2RT5da1Vb9tZkg/1M8wKdlixfEA== 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 4Pwbq43LZrz1Mj4; Tue, 11 Apr 2023 06:41:52 +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 33B6fqZR055004; Tue, 11 Apr 2023 06:41:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33B6fqVg055003; Tue, 11 Apr 2023 06:41:52 GMT (envelope-from git) Date: Tue, 11 Apr 2023 06:41:52 GMT Message-Id: <202304110641.33B6fqVg055003@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 0d29d750b9a7 - main - bhyve: do not exit if LPC finds no host selector 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: corvink X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0d29d750b9a7188c435d3701b2183f4df15ac98b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=0d29d750b9a7188c435d3701b2183f4df15ac98b commit 0d29d750b9a7188c435d3701b2183f4df15ac98b Author: Corvin Köhne AuthorDate: 2023-03-29 08:07:10 +0000 Commit: Corvin Köhne CommitDate: 2023-04-11 06:39:21 +0000 bhyve: do not exit if LPC finds no host selector The host selector is only required when the user likes to use the same LPC device IDs as the physical LPC device. This is an uncommon use case. For that reason, it makes no sense to exit when we don't find the host selector. Reviewed by: markj MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D39311 --- usr.sbin/bhyve/pci_lpc.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/usr.sbin/bhyve/pci_lpc.c b/usr.sbin/bhyve/pci_lpc.c index 02105ef01bdf..8213f32985ef 100644 --- a/usr.sbin/bhyve/pci_lpc.c +++ b/usr.sbin/bhyve/pci_lpc.c @@ -480,6 +480,8 @@ pci_lpc_get_sel(struct pcisel *const sel) } } + warnx("%s: Unable to find host selector of LPC bridge.", __func__); + return (-1); } @@ -487,6 +489,7 @@ static int pci_lpc_init(struct pci_devinst *pi, nvlist_t *nvl) { struct pcisel sel = { 0 }; + struct pcisel *selp = NULL; uint16_t device, subdevice, subvendor, vendor; uint8_t revid; @@ -511,15 +514,15 @@ pci_lpc_init(struct pci_devinst *pi, nvlist_t *nvl) if (lpc_init(pi->pi_vmctx) != 0) return (-1); - if (pci_lpc_get_sel(&sel) != 0) - return (-1); + if (pci_lpc_get_sel(&sel) == 0) + selp = &sel; - vendor = pci_config_read_reg(&sel, nvl, PCIR_VENDOR, 2, LPC_VENDOR); - device = pci_config_read_reg(&sel, nvl, PCIR_DEVICE, 2, LPC_DEV); - revid = pci_config_read_reg(&sel, nvl, PCIR_REVID, 1, LPC_REVID); - subvendor = pci_config_read_reg(&sel, nvl, PCIR_SUBVEND_0, 2, + vendor = pci_config_read_reg(selp, nvl, PCIR_VENDOR, 2, LPC_VENDOR); + device = pci_config_read_reg(selp, nvl, PCIR_DEVICE, 2, LPC_DEV); + revid = pci_config_read_reg(selp, nvl, PCIR_REVID, 1, LPC_REVID); + subvendor = pci_config_read_reg(selp, nvl, PCIR_SUBVEND_0, 2, LPC_SUBVEND_0); - subdevice = pci_config_read_reg(&sel, nvl, PCIR_SUBDEV_0, 2, + subdevice = pci_config_read_reg(selp, nvl, PCIR_SUBDEV_0, 2, LPC_SUBDEV_0); /* initialize config space */