From nobody Thu Nov 2 09:30:25 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 4SLdry6JvFz4ydwF; Thu, 2 Nov 2023 09:30:26 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SLdry4dTHz3J3r; Thu, 2 Nov 2023 09:30:26 +0000 (UTC) (envelope-from mjguzik@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-3b2b1af964dso427227b6e.1; Thu, 02 Nov 2023 02:30:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698917425; x=1699522225; darn=freebsd.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=qpkPt4fc7NXhlIoj52yFt6HQug/R77RWJUzFY0AeTJg=; b=AYrwF3FWAHEQYaVrZTWexwr43im0YCN8ZDWaonXtzVib5KKsuHnSND0ekPYE0jbCH9 Ze1FQjbWjZ3mhddJ7Md/DKhNSNdx2CATFmoHomn5CD8De7au8pmb4JEJ5eeaoqyArTil 8UFXlUlt4M2g86u+0Wk1mM10EJd2LSn/5P9NitaafDXHd6Z1SWWSTawfuTW5IUvkfsiP KRLLx3zdIh/qaWMA+7ccdP0IF942TdVk+iWvgz3rOn8hBlhF/yV/lNKTa4uhB8ZExIL9 c8QzWTPtMC4gwQebBDbf0hbTftxjtFvaJ1vb+3NbgsMP+CxEpbYNpNyuA7RJSS2Je1QW XyKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698917425; x=1699522225; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qpkPt4fc7NXhlIoj52yFt6HQug/R77RWJUzFY0AeTJg=; b=UmOIzU6IspR1dtx/9XOkLnVw+i7uG2p9fO0RVuCknhbOxwWavlBMdjGlzzvGzlidKI 3piRSJxqJYxwCGvH6ovHi/9UaSXZjYAqblJ8BeQCVy35QDYB4V3nvxqIhpl6bVqAtgmZ pqYIU+xd8vqJdGrIMlHhpV/WP4f1Vxvm0H5UbbjHkJu+48IF8RwHdYG+tRbAgSMyB9IL DLjOdCGCFb4nkXkKQ48bsPiGOg3jNKnydWFtugRcKJuWtPLm2KKNJy1oDDS9DGxSBCFJ nU76k7B19hQ2O7+tpQWWZGIk8qJeEh3wgnSV0GA7sQNzP8vHoMFOMFkLd8yL6BHCCY53 MRMg== X-Gm-Message-State: AOJu0YzJjaCG8/V8LAvlNlNsADby8ySk2A3sUqLdqDhtaOW24EVhbc8e vrGpNV+w6k4FGhzRRqWrCyMWG2NbB3HJ5RSiIqQnoy7m X-Google-Smtp-Source: AGHT+IFpmFcBZNh7STe3DERAy6R3OdR+J8Kbc5mBUmkcnVedaD8jgddgJqTsk3yOBt13l9L8Nt0wgFLZBXDazy5mT2w= X-Received: by 2002:aca:1214:0:b0:3ae:1446:d48b with SMTP id 20-20020aca1214000000b003ae1446d48bmr18533706ois.3.1698917425640; Thu, 02 Nov 2023 02:30:25 -0700 (PDT) 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 Received: by 2002:a8a:118c:0:b0:4f0:1250:dd51 with HTTP; Thu, 2 Nov 2023 02:30:25 -0700 (PDT) In-Reply-To: <2E6A685B-A8E4-48A2-B21A-422AFBEA4440@FreeBSD.org> References: <202311020909.3A299SXQ075865@gitrepo.freebsd.org> <2E6A685B-A8E4-48A2-B21A-422AFBEA4440@FreeBSD.org> From: Mateusz Guzik Date: Thu, 2 Nov 2023 10:30:25 +0100 Message-ID: Subject: Re: git: 63bf943d4af1 - main - Hyper-V: vmbus: Add NULL check for vmbus_res To: Zhenlei Huang Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , Souradeep Chakrabarti Content-Type: text/plain; charset="UTF-8" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4SLdry4dTHz3J3r On 11/2/23, Zhenlei Huang 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 >> On Nov 2, 2023, at 5:09 PM, Zhenlei Huang wrote: >> >> The branch main has been updated by zlei: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=63bf943d4af17799cef21e2bb78dd28003ce1ce5 >> >> commit 63bf943d4af17799cef21e2bb78dd28003ce1ce5 >> Author: Zhenlei Huang >> AuthorDate: 2023-11-02 09:07:11 +0000 >> Commit: Zhenlei Huang >> 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: 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(-) >> >> 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 = 0; >> >> if (sc->vmbus_flags & VMBUS_FLAG_ATTACHED) >> return (0); >> @@ -1416,10 +1416,12 @@ vmbus_doattach(struct vmbus_softc *sc) >> >> /* Coherency attribute */ >> dev_res = devclass_get_device(devclass_find("vmbus_res"), 0); >> - handle = acpi_get_handle(dev_res); >> + if (dev_res != NULL) { >> + handle = acpi_get_handle(dev_res); >> >> - if (ACPI_FAILURE(acpi_GetInteger(handle, "_CCA", &coherent))) >> - coherent = 0; >> + if (ACPI_FAILURE(acpi_GetInteger(handle, "_CCA", &coherent))) >> + coherent = 0; >> + } >> if (bootverbose) >> device_printf(sc->vmbus_dev, "Bus is%s cache-coherent\n", >> coherent ? "" : " not"); > > > > -- Mateusz Guzik