From: Michael Kelley <mhklinux@outlook.com>
To: "arnd@arndb.de" <arnd@arndb.de>,
"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: Regarding commit a07b50d80ab62 ("hyperv: avoid dependency on screen_info")
Date: Mon, 21 Apr 2025 22:23:13 +0000 [thread overview]
Message-ID: <SN6PR02MB4157149AAF2DBDFD271C21C3D4B82@SN6PR02MB4157.namprd02.prod.outlook.com> (raw)
Arnd --
Your commit a07b50d80ab62 ("hyperv: avoid dependency on screen_info") [1]
introduced a subtle bug. The commit message says, in part:
Similarly, the vmbus_drv code marks the original EFI framebuffer as
reserved, but this is not required if there is no sysfb.
This statement turns out to be false. In a Generation 2 VM, if it is not
reserved, a PCI-passthru NVMe device that contains the OS partition can
try to use the framebuffer's MMIO space. Doing so causes Hyper-V to
report an error to Linux when Linux is probing the NVMe device. The
OS disk fails to get setup, and Linux then fails to boot in the VM.
Hyper-V VM configurations with a PCI-passthru NVMe device as the
OS disk are relatively rare at the moment, and the Linux images
for the Azure cloud usually have CONFIG_FB_EFI=y, so that
CONFIG_SYSFB is "y". So the problem hasn't typically shown up.
But PCI pass-thru NVMe OS disks will become increasingly common,
with the potential for boot failure if CONFIG_SYSFB is "n". I
recently stumbled across this problem, and it took a while to
figure out why my kernel wouldn't boot.
The Hyper-V host provides the guest with ACPI tables describing
the overall MMIO space available to the guest. But the location of
the Hyper-V synthetic framebuffer is only communicated to the guest
via screen_info. It's not in the ACPI tables. Maybe that's the real
underlying problem, but it is what it is.
I don't have a full perspective on your goals and status in making
screen_info more local to the sysfb helper code. So I'm soliciting
your input on how to solve this problem. I have two ideas to run
by you:
1) In Kconfig, have CONFIG_HYPERV select SYSFB. This way
Hyper-V guests will always have CONFIG_SYSFB=y, even if none
of FB_VESA, FB_EFI, or SYSFB_SIMPLEFB is selected. The VMBus
driver will always properly reserve the MMIO space for the
synthetic framebuffer.
2) If #1 is objectionable, the next best thing is for the VMBus
driver to "guess" where the synthetic framebuffer is, and reserve
that MMIO space. The "guess" would be that the synthetic
framebuffer is always at the beginning of the MMIO space reported
in the ACPI tables, with a size of 8 MiB. That's what Hyper-V seems
to always do today, though it's not a guaranteed contract. But
that would prevent an NVMe device from trying to use that
MMIO space and failing. It's a hack but probably better than
leaving things as they currently are.
The problem can currently happen only on x86/x64 VMs,
but will probably be possible on arm64 VMs as well at some
point in the future.
Any input is appreciated. Thanks.
Michael
[1] https://lore.kernel.org/linux-hyperv/20231009211845.3136536-9-arnd@kernel.org/
reply other threads:[~2025-04-21 22:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=SN6PR02MB4157149AAF2DBDFD271C21C3D4B82@SN6PR02MB4157.namprd02.prod.outlook.com \
--to=mhklinux@outlook.com \
--cc=arnd@arndb.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®