From: Wei Liu <wei.liu@kernel.org>
To: mhklinux@outlook.com
Cc: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org,
decui@microsoft.com, deller@gmx.de, javierm@redhat.com,
arnd@arndb.de, linux-kernel@vger.kernel.org,
linux-hyperv@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2 1/1] Drivers: hv: Always select CONFIG_SYSFB for Hyper-V guests
Date: Fri, 23 May 2025 16:40:10 +0000 [thread overview]
Message-ID: <aDCk6haZF4fjRHf4@liuwe-devbox-ubuntu-v2.tail21d00.ts.net> (raw)
In-Reply-To: <20250520040143.6964-1-mhklinux@outlook.com>
On Mon, May 19, 2025 at 09:01:43PM -0700, mhkelley58@gmail.com wrote:
> From: Michael Kelley <mhklinux@outlook.com>
>
> The Hyper-V host provides guest VMs with a range of MMIO addresses
> that guest VMBus drivers can use. The VMBus driver in Linux manages
> that MMIO space, and allocates portions to drivers upon request. As
> part of managing that MMIO space in a Generation 2 VM, the VMBus
> driver must reserve the portion of the MMIO space that Hyper-V has
> designated for the synthetic frame buffer, and not allocate this
> space to VMBus drivers other than graphics framebuffer drivers. The
> synthetic frame buffer MMIO area is described by the screen_info data
> structure that is passed to the Linux kernel at boot time, so the
> VMBus driver must access screen_info for Generation 2 VMs. (In
> Generation 1 VMs, the framebuffer MMIO space is communicated to
> the guest via a PCI pseudo-device, and access to screen_info is
> not needed.)
>
> In commit a07b50d80ab6 ("hyperv: avoid dependency on screen_info")
> the VMBus driver's access to screen_info is restricted to when
> CONFIG_SYSFB is enabled. CONFIG_SYSFB is typically enabled in kernels
> built for Hyper-V by virtue of having at least one of CONFIG_FB_EFI,
> CONFIG_FB_VESA, or CONFIG_SYSFB_SIMPLEFB enabled, so the restriction
> doesn't usually affect anything. But it's valid to have none of these
> enabled, in which case CONFIG_SYSFB is not enabled, and the VMBus driver
> is unable to properly reserve the framebuffer MMIO space for graphics
> framebuffer drivers. The framebuffer MMIO space may be assigned to
> some other VMBus driver, with undefined results. As an example, if
> a VM is using a PCI pass-thru NVMe controller to host the OS disk,
> the PCI NVMe controller is probed before any graphics devices, and the
> NVMe controller is assigned a portion of the framebuffer MMIO space.
> Hyper-V reports an error to Linux during the probe, and the OS disk
> fails to get setup. Then Linux fails to boot in the VM.
>
> Fix this by having CONFIG_HYPERV always select SYSFB. Then the
> VMBus driver in a Gen 2 VM can always reserve the MMIO space for the
> graphics framebuffer driver, and prevent the undefined behavior. But
> don't select SYSFB when building for HYPERV_VTL_MODE as VTLs other
> than VTL 0 don't have a framebuffer and aren't subject to the issue.
> Adding SYSFB in such cases is harmless, but would increase the image
> size for no purpose.
>
> Fixes: a07b50d80ab6 ("hyperv: avoid dependency on screen_info")
> Signed-off-by: Michael Kelley <mhklinux@outlook.com>
> Reviewed-by: Saurabh Sengar <ssengar@linux.microsoft.com>
Applied.
prev parent reply other threads:[~2025-05-23 16:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-20 4:01 [PATCH v2 1/1] Drivers: hv: Always select CONFIG_SYSFB for Hyper-V guests mhkelley58
2025-05-23 16:40 ` Wei Liu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aDCk6haZF4fjRHf4@liuwe-devbox-ubuntu-v2.tail21d00.ts.net \
--to=wei.liu@kernel.org \
--cc=arnd@arndb.de \
--cc=decui@microsoft.com \
--cc=deller@gmx.de \
--cc=haiyangz@microsoft.com \
--cc=javierm@redhat.com \
--cc=kys@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhklinux@outlook.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).