From nobody Thu Nov 02 09:40:00 2023 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 4SLf4H1VNhz4yghK; Thu, 2 Nov 2023 09:40: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 4SLf4H108Zz3Kvr; Thu, 2 Nov 2023 09:40:15 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698918015; 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: in-reply-to:in-reply-to:references:references; bh=6WJiawtMQgWJpFqp8xepVgR+HUqX29UCjUXfZ64XOjQ=; b=rmUsulqrJ92L7f71vTFxTFSwRYicTX/kD6/Y1C5WWktXjxuA7tz9FTMnTyAMVHaEmJgDSr C/RAiCnHNPpPs0RLPK0e4X4ZDPp+WUh1BAEqyWkEHZLX6WBBJl5a56qm2VDr0rStvSRS+T PcuyX2RYdoZaeJXgadwfSU2mkF57KYfoIT5ruGKOdIMyYlQV6t2sEY3iVi85cAjAe1qd4J 35KYhfIpIgZgzcMkgMmKZFN8p3xXWA/ODLKLez+PmvTLf4JdIy+CMUOebTvczItho/MFtI c/ze7kEjfgorR6PgkXBI90f6QIJqJPNLw4IAGVich4H4WOvW09q6nRblLO8gyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698918015; 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: in-reply-to:in-reply-to:references:references; bh=6WJiawtMQgWJpFqp8xepVgR+HUqX29UCjUXfZ64XOjQ=; b=UTJOBZinYIdwazfxPlOTbspizT8Bl8uAvOFe9nr0ML0ZEgqwOUirxrWQwFHEkK+FPbmNFS QiVdVkLnTh6y8PpNquK/9Gb4rVRABdLVl2zDr3oy2bd/f/uVDPZP8k+s7GP2ItOGxBHXwI 3wWFpaqbpnTjF0hdOVRGlnthvAAvTX0t0V0PbyUlBqcwevibJMutAjpTBT75XrLitv8leR n6e0ZD5EEaICCyaCIlHh9befSxAX9/3iLvE87dHBW0AvCDL2aY2y+zNXfag78XLzNqXVFn RIt4u2RsRiO/S8Cw30JZweoWulx6ihJU2rbqkQdxJLeADpPJCsxpIPV0c7zIeQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698918015; a=rsa-sha256; cv=none; b=h/xSG4P13DQbcja62DQcGBzcu70iPjLzAWGsTB9WXE01nXU90y1DHNbgjgbSqQ21BKNVoL QdFmu8xmZFLVfl/oGbQlZpdRw//tEs/dONGY3S7pRZwUTRLfSMVqNcE2omRCgYr79/M/Dz +8L4SX5EwTvzbRxRwKqfdpBFtgD7ThNrnK/nr3CXjk70aZr338HV4z3E+wO95Wxfh6mANE 2fqYltQ7f0AydE58oQPWDYq/SDKPT+80lwijA2JVg+p+GrrvjbCXJm2PCS/eaFlFL2FLwy j0GNJDLkidgzQfhu6LlZEz8aBWmSg92UOpf9XhsGBGSYvHq+j0blxoL48u7wmg== Received: from smtpclient.apple (ns1.oxydns.net [45.32.91.63]) (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 4SLf4F10lzz1WyV; Thu, 2 Nov 2023 09:40:12 +0000 (UTC) (envelope-from zlei@FreeBSD.org) From: Zhenlei Huang Message-Id: <06D3671F-870E-4E50-A075-4CB4C73D2BDD@FreeBSD.org> Content-Type: multipart/alternative; boundary="Apple-Mail=_C99E4D6A-FEDF-4AB4-A2F9-E2F8C3A89B06" 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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 Date: Thu, 2 Nov 2023 17:40:00 +0800 In-Reply-To: Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , Souradeep Chakrabarti To: Mateusz Guzik References: <202311020909.3A299SXQ075865@gitrepo.freebsd.org> <2E6A685B-A8E4-48A2-B21A-422AFBEA4440@FreeBSD.org> X-Mailer: Apple Mail (2.3696.120.41.1.4) --Apple-Mail=_C99E4D6A-FEDF-4AB4-A2F9-E2F8C3A89B06 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Nov 2, 2023, at 5:30 PM, Mateusz Guzik wrote: >=20 > On 11/2/23, Zhenlei Huang > = wrote: >> Sorry I committed too fast. >>=20 >> I should give credentials to Souradeep in the commit message. >>=20 >> Thank him for the analysis ! >>=20 >=20 > again this kind of change you can revert and recommit with proper > authorship, as long as it happens fast I'm really really sorry for that. I realized that until the commit has been MFCed into stable/14 and = releng/14.0 .=20 >=20 >>> 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"); >>=20 >>=20 >>=20 >>=20 >=20 >=20 > --=20 > Mateusz Guzik > --Apple-Mail=_C99E4D6A-FEDF-4AB4-A2F9-E2F8C3A89B06 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

On Nov 2, 2023, at 5:30 PM, Mateusz Guzik <mjguzik@gmail.com> = wrote:

On 11/2/23, Zhenlei Huang <zlei@freebsd.org> = wrote:
Sorry = I committed too fast.

I should give = credentials to Souradeep in the commit message.

Thank him for the analysis !


again this kind of change you can revert and recommit with = proper
authorship, = as long as it happens fast

I'm really really sorry for = that.
I realized that until the commit has been MFCed into = stable/14 and releng/14.0 . 


On Nov 2, 2023, at 5:09 = PM, Zhenlei Huang <zlei@FreeBSD.org> wrote:

The branch main has been updated by zlei:

URL:
https://cgit.FreeBSD.org/src/commit/?id=3D63bf943d4af17799cef21= e2bb78dd28003ce1ce5

commit = 63bf943d4af17799cef21e2bb78dd28003ce1ce5
Author: =     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2023-11-02 09:07:11 +0000
Commit: =     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2023-11-02 09:07:11 +0000

  Hyper-V: vmbus: Add NULL check for vmbus_res

  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.

  For real Hyper-V, both = gen1 and gen2 have vmbus_res then they are not
  affected by this change.

  1. = https://www.qemu.org/docs/master/system/i386/hyperv.html
  PR: =             27= 4810
  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(-)

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;

if = (sc->vmbus_flags & VMBUS_FLAG_ATTACHED)
return = (0);
@@ -1416,10 +1416,12 @@ vmbus_doattach(struct = vmbus_softc *sc)

/* = 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);

- 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");






-- Mateusz Guzik = <mjguzik gmail.com>



= --Apple-Mail=_C99E4D6A-FEDF-4AB4-A2F9-E2F8C3A89B06--