From nobody Thu Nov 02 09:22:09 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 4SLdgW17P0z4ychv; Thu, 2 Nov 2023 09:22:15 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SLdgW0frkz3Gwb; Thu, 2 Nov 2023 09:22:15 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698916935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y4FXQXS4OEYpNKxqXPlhIP8A/nhUDUjKIX/mIgNrhXw=; b=DrvZL4R/gsqgpXK9YcW+a9PKpgwjtHsgsJtawtu1sliLZcJGRoyzROTMI9t46uJIsztxJT U4jt1TZey3YdPFEXycr8JvtsjGldEc4aqXTtrIIf/z/uRolWIOIE3pvWYAZXdu5Ce+Cr1C 4HNmCcFcqEWSK8SCXAgCCaHTEQnMJZNADc6DYcqBoKEE22WENkPjQKx/QsAhuutqjJPvC9 Edjzqv3fii276TmuCMuXlJFB9ZkQXk6vVBbPss38IIQuR+cfikaNDNeL+SWcV8uFlcOfjA DmICDUMFsybGc5qN8gJp07rGJqJZIkvCmGYZfdWvqPjEFkj50pTl60rd+f+/jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698916935; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y4FXQXS4OEYpNKxqXPlhIP8A/nhUDUjKIX/mIgNrhXw=; b=tvR4D8oJ06kRLF8gUj0XItNvsT25sSX3+pcj8bN2MqW5/U8e7sJMNzCx4TPnGG2l6rBPtd XSDz1l1QefhMppekCt+7GnH1u/B5F+uKqxliNIK4UgXRIRa4hYxWkrqb6zQz5R6wi5hX4r y+HmkFIaZSSlLKsvpao3SjRL134LAVI/RIu5TXrzC7mYOLnDIlU1x1ZfI02HzK1ZCmWPFP l6nMrq2RUuua1hG9czVuViWCNLSPc9nnDS3lc+afuNisaMGBfUtYmLYIlwVJ2xXQqtfi4N chQBufS3mThS3gnkkJee53GVfH4dPZCOQ1srzirAZ1Kzu6LnW64u+HAYWluv5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698916935; a=rsa-sha256; cv=none; b=elwejapjJcEvKGgu/qRuDeuGDjsvAPWl1lifUY3XZXmIZX+3OnyOPFCY+1oauF2+wtmBlG kDUCBuNCf/8olOaIiNg8AWXvVr9U6rSVmsK6+VEXtVSOC5uclA80+x/rWOUJTHbUd5Cgcl g5a6TXyJshws/ZEvcT19fM1MymETCfOuiLDe0wIBrhlhwx/du30EUA7dtjx4FfNU5yCeA/ Menx4lAZ/yeXEdWt3ahjBL2BL5Iba+wpPEk09AGt322zHuMjJ5lN8IeCr4+Nw52uZktDWJ sMDibYnxhrmBfMqxEEonir7522y5TxG3FFpsL9RQLh/Ql5LpUk2PTpd3vSg6yA== Received: from smtpclient.apple (unknown [112.66.183.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4SLdgT4vgJz1WTg; Thu, 2 Nov 2023 09:22:13 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Content-Type: text/plain; charset=us-ascii 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 (Mac OS X Mail 16.0 \(3696.120.41.1.4\)) Subject: Re: git: 63bf943d4af1 - main - Hyper-V: vmbus: Add NULL check for vmbus_res From: Zhenlei Huang In-Reply-To: <202311020909.3A299SXQ075865@gitrepo.freebsd.org> Date: Thu, 2 Nov 2023 17:22:09 +0800 Cc: Souradeep Chakrabarti Content-Transfer-Encoding: quoted-printable Message-Id: <2E6A685B-A8E4-48A2-B21A-422AFBEA4440@FreeBSD.org> References: <202311020909.3A299SXQ075865@gitrepo.freebsd.org> To: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" X-Mailer: Apple Mail (2.3696.120.41.1.4) Sorry I committed too fast. I should give credentials to Souradeep in the commit message. Thank him for the analysis ! > On Nov 2, 2023, at 5:09 PM, Zhenlei Huang wrote: >=20 > The branch main has been updated by zlei: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D63bf943d4af17799cef21e2bb78dd280= 03ce1ce5 >=20 > commit 63bf943d4af17799cef21e2bb78dd28003ce1ce5 > Author: Zhenlei Huang > AuthorDate: 2023-11-02 09:07:11 +0000 > Commit: Zhenlei Huang > CommitDate: 2023-11-02 09:07:11 +0000 >=20 > Hyper-V: vmbus: Add NULL check for vmbus_res >=20 > QEMU emulates Hyper-V [1] but lacks the emulation for vmbus_res, = thus no > coherence information is available. Add NULL check for it and = fallback > to no coherence. This will prevent FreeBSD guests from panic on = QEMU > with the Hyper-V enlightenment hv-synic enabled. >=20 > For real Hyper-V, both gen1 and gen2 have vmbus_res then they are = not > affected by this change. >=20 > 1. https://www.qemu.org/docs/master/system/i386/hyperv.html >=20 > PR: 274810 > Reviewed by: mhorne, emaste, delphij, whu > Diagnosed by: mhorne > Fixes: e7a9817b8d32 Hyper-V: vmbus: implementat = bus_get_dma_tag in vmbus > Insta-MFC approved by: re (delphij) for 14.0-RC4 > Differential Revision: https://reviews.freebsd.org/D42414 > --- > sys/dev/hyperv/vmbus/vmbus.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) >=20 > diff --git a/sys/dev/hyperv/vmbus/vmbus.c = b/sys/dev/hyperv/vmbus/vmbus.c > index ee412e643b4f..0ea401507b79 100644 > --- a/sys/dev/hyperv/vmbus/vmbus.c > +++ b/sys/dev/hyperv/vmbus/vmbus.c > @@ -1393,7 +1393,7 @@ vmbus_doattach(struct vmbus_softc *sc) > int ret; > device_t dev_res; > ACPI_HANDLE handle; > - unsigned int coherent; > + unsigned int coherent =3D 0; >=20 > if (sc->vmbus_flags & VMBUS_FLAG_ATTACHED) > return (0); > @@ -1416,10 +1416,12 @@ vmbus_doattach(struct vmbus_softc *sc) >=20 > /* Coherency attribute */ > dev_res =3D devclass_get_device(devclass_find("vmbus_res"), 0); > - handle =3D acpi_get_handle(dev_res); > + if (dev_res !=3D NULL) { > + handle =3D acpi_get_handle(dev_res); >=20 > - if (ACPI_FAILURE(acpi_GetInteger(handle, "_CCA", &coherent))) > - coherent =3D 0; > + if (ACPI_FAILURE(acpi_GetInteger(handle, "_CCA", = &coherent))) > + coherent =3D 0; > + } > if (bootverbose) > device_printf(sc->vmbus_dev, "Bus is%s = cache-coherent\n", > coherent ? "" : " not");