The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Roman Kisel" <romank@linux.microsoft.com>,
	"Arnd Bergmann" <arnd@kernel.org>
Cc: "Dexuan Cui" <decui@microsoft.com>,
	"Haiyang Zhang" <haiyangz@microsoft.com>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Michael Kelley" <mhklinux@outlook.com>,
	nunodasneves@linux.microsoft.com,
	"Saurabh Singh Sengar" <ssengar@linux.microsoft.com>,
	"Wei Liu" <wei.liu@kernel.org>
Subject: Re: [PATCH] hv: add CONFIG_EFI dependency
Date: Tue, 10 Jun 2025 17:45:54 +0200	[thread overview]
Message-ID: <df1261e1-25d4-43ae-88c4-4f5d75370aee@app.fastmail.com> (raw)
In-Reply-To: <20250610153354.2780-1-romank@linux.microsoft.com>

On Tue, Jun 10, 2025, at 17:33, Roman Kisel wrote:
>> Selecting SYSFB causes a link failure on arm64 kernels with EFI disabled:
>>
>> ld.lld-21: error: undefined symbol: screen_info
>> >>> referenced by sysfb.c
>> >>>               drivers/firmware/sysfb.o:(sysfb_parent_dev) in archive vmlinux.a
>> >>> referenced by sysfb.c
>>
>> The problem is that sysfb works on the global 'screen_info' structure, which
>> is provided by the firmware interface, either the generic EFI code or the
>> x86 BIOS startup.
>>
>> Assuming that HV always boots Linux using UEFI, the dependency also makes
>> logical sense, since otherwise it is impossible to boot a guest.
>>
>
> Hyper-V as of recent can boot off DeviceTree with the direct kernel 
> boot, no UEFI
> is required (examples would be OpenVMM and the OpenHCL paravisor on 
> arm64).

I was aware of hyperv no longer needing ACPI, but devicetree and UEFI
are orthogonal concepts, and I had expected that even the devicetree
based version would still get booted using a tiny UEFI implementation
even if the kernel doesn't need that. Do you know what type of bootloader
is actually used in the examples you mentioned? Does the hypervisor
just start the kernel at the native entry point without a bootloader
in this case?

> Being no expert in Kconfig unfortunately... If another solution is possible to
> find given the timing constraints (link errors can't wait iiuc) that would be
> great :)
>
> Could something like "select EFI if SYSFB" work?

You probably mean the reverse here:

      select SYSFB if EFI && !HYPERV_VTL_MODE

I think that should work, as long as the change from the 96959283a58d
("Drivers: hv: Always select CONFIG_SYSFB for Hyper-V guests") patch
is not required in the cases where the guest has no bootloader.

Possibly this would also work

     select SYSFB if X86 && !HYPERV_VTL_MODE

in case only the x86 host requires the sysfb hack, but arm can
rely on PCI device probing instead.

Or perhaps this version

--- a/drivers/hv/Kconfig
+++ b/drivers/hv/Kconfig
@@ -19,6 +19,7 @@ config HYPERV_VTL_MODE
        bool "Enable Linux to boot in VTL context"
        depends on (X86_64 || ARM64) && HYPERV
        depends on SMP
+       depends on !EFI
        default n
        help
          Virtual Secure Mode (VSM) is a set of hypervisor capabilities and

if the VTL mode is never used with a boot loader in the guest.

     Arnd

  reply	other threads:[~2025-06-10 15:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-10  9:18 [PATCH] hv: add CONFIG_EFI dependency Arnd Bergmann
2025-06-10 15:33 ` Roman Kisel
2025-06-10 15:45   ` Arnd Bergmann [this message]
2025-06-10 16:17     ` Michael Kelley
2025-06-10 16:26       ` Roman Kisel
2025-06-10 16:36       ` Roman Kisel
2025-06-10 18:45       ` Michael Kelley
2025-06-13 15:50         ` Michael Kelley
2025-06-13 16:06           ` Arnd Bergmann

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=df1261e1-25d4-43ae-88c4-4f5d75370aee@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhklinux@outlook.com \
    --cc=nunodasneves@linux.microsoft.com \
    --cc=romank@linux.microsoft.com \
    --cc=ssengar@linux.microsoft.com \
    --cc=wei.liu@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