From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 750BD366DA2 for ; Wed, 11 Feb 2026 21:54:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770846862; cv=none; b=cVihptFsSnp9ag5jjVa+sohPIKgv6ePGR8ISt//mGgbZrLAsJiHB+aJa3bsy5y+tk70Nrge4x62uDCmtiVu0f/3jDDj+f5HvLC4c8YHa8jslravmupp2oZv8OMXZI67adYK7pjaV0Rpeim472sXwqq/TBls3GGozHM2Ev0UAIRQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770846862; c=relaxed/simple; bh=q/WxrZyetVMNgjoPxdvbdSU+SXN1AYSXgG+wZiSAZ6Y=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=YIfRvty6sTgaFasWjqKkCkw+n9nc0sSxW4oXXw1Z97btDipWuvwyfp7KajKRVKs6i9JD41DtVLmYbzsFGacC0WaFatqp/ph6UcawaBfakxPcF2iFuE0/SUWA8pTWmDaXNxGBCTVYxn1S0UskPwDi4Cj/P+AfMFb0a0Ddc5x7EhY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=PL02LyKb; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=Ze64SQhM; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PL02LyKb"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="Ze64SQhM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770846859; 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=SI+sBRtkzJlBVk5fRANqyWyEonINF8qLvx0gBLbpWBU=; b=PL02LyKbNsp+6XG+nzhcLN9yIdX3kpKEHh6PRHgGoMwU4gZIT4yKog98nc+BkJ/aiGTYHz Q+ucv4SPV+OSguEYcz5Iy7nBe71B10v2h/ou/2I5/6z6LivAkL1LqyPPhSfLHrbg5pkFtU q9C9t5ZvNNjSb+xeHg6LxPKEjq9tS54= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-693-9UCxeQj-Pr2sigM9VoAqig-1; Wed, 11 Feb 2026 16:54:18 -0500 X-MC-Unique: 9UCxeQj-Pr2sigM9VoAqig-1 X-Mimecast-MFC-AGG-ID: 9UCxeQj-Pr2sigM9VoAqig_1770846857 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-483129eb5ccso33453945e9.2 for ; Wed, 11 Feb 2026 13:54:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770846857; x=1771451657; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=SI+sBRtkzJlBVk5fRANqyWyEonINF8qLvx0gBLbpWBU=; b=Ze64SQhMNPS5H74bz8Rt+Zz/PAREBNycIKyoPzDqjCEoXK9kqbk6l5V/5oSWiKqrcQ OGLrU2+z9COK1UY4ivFXXI2/Tll+5Meyjp7W556ec1KxHZ2uFQToGpTsGrlRWaMvjksz +KfX4DM8AemYajLfecQJ6LRhUGcxEunYRORInj7pRhwhrhDmrd24eUp8725z+mxSuFqz SS6kc7bkmvT/fZ4fK+gh00L05WIiUXdWGZf8+r7Byh8v9GfNlqhQ2d9zBcODg4SAr2uX Tzl5l519HObcHx2z2HgraORXKR0XRwaJEf2u5Q8NMoEwPP8ywdlYbd9KjY/EoM8JY2Z9 ymYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770846857; x=1771451657; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SI+sBRtkzJlBVk5fRANqyWyEonINF8qLvx0gBLbpWBU=; b=nVWXKB87xamG50FTGL894XbwYkT6o8qPApvfw1x24BpOercq5ph34mze3tPjSBMiLI bt4aC2Jz+kF7HWsHoNYafFbfBkZ0hrRHvkrdqK8wsbxaaBeE7W5ClXOPGdXABLblUVCj kuZyimURmcO4CdAj0TcwGQjspnyn4hBsdePzBByYchI+hSGUzVxyCppb1qCvvc4Y0k58 1yeovwToGI78uuchRcByvEMjY+JD/3TXHh9jKVIEXOMiHiHp8BEfI59aOZli37teBocg EqIBxtdAzCpEcKb1dMMRRu8sWUaw4Ci3L/Ib1NyaTABC1YgGuxRSyrLThqnspr3zAfFg HbFQ== X-Forwarded-Encrypted: i=1; AJvYcCXp3xnsCW2aywDdh+quFk3yZ42BMhYlOy7XkVczcyi/wzc2D0v7nBoHRyUydqSdvO8XyrdT+VLwmdT/gzQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyCjzRbMNrBu64spYQxFbE5+ok26Q9pEv/46Y9WoyqnktDB1r0v sksP/48/MVlzIrcmaCerYClLprTY6KVbrUrGA6EeOxZF2YcLQ1I205YEZIQDgOGTicflPDeQpET JXgzBk9VL72rQTI1EM8a5z+POfsQNC54+GedBhkHGxtnCnjY0PfE71X+BVYutQFBypg== X-Gm-Gg: AZuq6aL+qoku4GZqAYrH37+ICNGAIZnbfY36gEJFShFLwcGUlaTAU6f9k32tmWKM6SF oUpzHvco0L1T8R2tsDzJ/JgVGE/4ORlbO4S9kpxR+wc/mK7Hde2QGAGFQZcOnOW9DfG7TVc9GJg GNoMTtkaQzXRjhzMIcmNprvb3lYfwTgcCrY20XuEUf5ej6qbL8BjDEm5XLNOUo9z6g7jgPX+9r8 2MXUbJUMOjcWf1PwTPemC65d8Vb8GsuQHKCDqpmKVbGQEEQISjwsweDmXFJBOwh+SkNvnS72gLK MQ7Lwkkl+eCGNsejtk5NxohIK355CWQoChAtnWsWZ+Aj2AY+5RmvbemydkbZgl/DFSUTVA2dMKL q3RKUezRjhbAiDAmzMVct9XCLTqsXaxc/XuuNFYzX8XVBwc42yaDjT9JCVngFcg== X-Received: by 2002:a05:600c:5252:b0:480:20f1:7aa6 with SMTP id 5b1f17b1804b1-4836715a470mr429105e9.21.1770846856904; Wed, 11 Feb 2026 13:54:16 -0800 (PST) X-Received: by 2002:a05:600c:5252:b0:480:20f1:7aa6 with SMTP id 5b1f17b1804b1-4836715a470mr428695e9.21.1770846856390; Wed, 11 Feb 2026 13:54:16 -0800 (PST) Received: from ?IPV6:2a01:e0a:c:37e0:8998:e0cf:68cc:1b62? ([2a01:e0a:c:37e0:8998:e0cf:68cc:1b62]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4834d5e0ed5sm141422575e9.5.2026.02.11.13.54.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Feb 2026 13:54:15 -0800 (PST) Message-ID: Date: Wed, 11 Feb 2026 22:54:11 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] drm/hyperv: During panic do VMBus unload after frame buffer is flushed To: mhklinux@outlook.com, drawat.floss@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, longli@microsoft.com, ryasuoka@redhat.com Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, stable@vger.kernel.org References: <20260209070201.1492-1-mhklinux@outlook.com> <20260209070201.1492-2-mhklinux@outlook.com> Content-Language: en-US, fr From: Jocelyn Falempe In-Reply-To: <20260209070201.1492-2-mhklinux@outlook.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 09/02/2026 08:02, mhkelley58@gmail.com wrote: > From: Michael Kelley > > In a VM, Linux panic information (reason for the panic, stack trace, > etc.) may be written to a serial console and/or a virtual frame buffer > for a graphics console. The latter may need to be flushed back to the > host hypervisor for display. > > The current Hyper-V DRM driver for the frame buffer does the flushing > *after* the VMBus connection has been unloaded, such that panic messages > are not displayed on the graphics console. A user with a Hyper-V graphics > console is left with just a hung empty screen after a panic. The enhanced > control that DRM provides over the panic display in the graphics console > is similarly non-functional. > > Commit 3671f3777758 ("drm/hyperv: Add support for drm_panic") added > the Hyper-V DRM driver support to flush the virtual frame buffer. It > provided necessary functionality but did not handle the sequencing > problem with VMBus unload. > > Fix the full problem by using VMBus functions to suppress the VMBus > unload that is normally done by the VMBus driver in the panic path. Then > after the frame buffer has been flushed, do the VMBus unload so that a > kdump kernel can start cleanly. As expected, CONFIG_DRM_PANIC must be > selected for these changes to have effect. As a side benefit, the > enhanced features of the DRM panic path are also functional. Thanks for properly fixing this issue with DRM Panic on hyperv. I've a small comment below. With that fixed: Reviewed-by: Jocelyn Falempe The first patch looks good too, I can review it if no other step up, as I'm not familiar with hyperv. > > Fixes: 3671f3777758 ("drm/hyperv: Add support for drm_panic") > Signed-off-by: Michael Kelley > --- > drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 4 ++++ > drivers/gpu/drm/hyperv/hyperv_drm_modeset.c | 15 ++++++++------- > 2 files changed, 12 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c > index 06b5d96e6eaf..79e51643be67 100644 > --- a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c > +++ b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c > @@ -150,6 +150,9 @@ static int hyperv_vmbus_probe(struct hv_device *hdev, > goto err_free_mmio; > } > > + /* If DRM panic path is stubbed out VMBus code must do the unload */ > + if (IS_ENABLED(CONFIG_DRM_PANIC) && IS_ENABLED(CONFIG_PRINTK)) I think drm_panic should still work without printk. The "user" panic screen would be unaffected, but the "kmsg" screen might be blank, and the "qr_code" would generate an empty qr code. (Actually I never tried to build a kernel without printk). > + vmbus_set_skip_unload(true); > drm_client_setup(dev, NULL); > > return 0; > @@ -169,6 +172,7 @@ static void hyperv_vmbus_remove(struct hv_device *hdev) > struct drm_device *dev = hv_get_drvdata(hdev); > struct hyperv_drm_device *hv = to_hv(dev); > > + vmbus_set_skip_unload(false); > drm_dev_unplug(dev); > drm_atomic_helper_shutdown(dev); > vmbus_close(hdev->channel); > diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c > index 7978f8c8108c..d48ca6c23b7c 100644 > --- a/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c > +++ b/drivers/gpu/drm/hyperv/hyperv_drm_modeset.c > @@ -212,15 +212,16 @@ static void hyperv_plane_panic_flush(struct drm_plane *plane) > struct hyperv_drm_device *hv = to_hv(plane->dev); > struct drm_rect rect; > > - if (!plane->state || !plane->state->fb) > - return; > + if (plane->state && plane->state->fb) { > + rect.x1 = 0; > + rect.y1 = 0; > + rect.x2 = plane->state->fb->width; > + rect.y2 = plane->state->fb->height; > > - rect.x1 = 0; > - rect.y1 = 0; > - rect.x2 = plane->state->fb->width; > - rect.y2 = plane->state->fb->height; > + hyperv_update_dirt(hv->hdev, &rect); > + } > > - hyperv_update_dirt(hv->hdev, &rect); > + vmbus_initiate_unload(true); > } > > static const struct drm_plane_helper_funcs hyperv_plane_helper_funcs = { -- Jocelyn