From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Soumyajyotii Ssarkar <soumyajyotisarkar23@gmail.com>
Cc: xen-devel@lists.xenproject.org, sarkarsoumyajyoti23@gmail.com,
"Jan Beulich" <jbeulich@suse.com>,
"Daniel P . Smith" <dpsmith@apertussolutions.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>
Subject: Re: [PATCH 3/3] x86/efi: Add opt-out mechanism for BGRT preservation
Date: Sun, 8 Mar 2026 19:34:42 +0100 [thread overview]
Message-ID: <aa3BQryZJYHyKJ3j@mail-itl> (raw)
In-Reply-To: <20260305191810.31033-4-soumyajyotisarkar23@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2891 bytes --]
On Fri, Mar 06, 2026 at 12:48:10AM +0530, Soumyajyotii Ssarkar wrote:
> As described in the task, BGRT preservation is now enabled by default to fix ACPI corruption
> for desktop/workstation systems (similar to ESRT).
>
> Add an opt-out parameter 'efi=no-bgrt' to allow disabling BGRT
> preservation on systems where the ~1MB memory overhead is not
> desired.
>
> The parameter is parsed during normal Xen boot (not during EFI
> phase), so it only affects diagnostic logging. The opt-out flag
> is checked at the start of efi_preserve_bgrt_img().
>
> Usage:
> Default: BGRT preserved automatically
> Opt-out: Add 'efi=no-bgrt' in Xen command line
>
> Signed-off-by: Soumyajyotii Ssarkar <soumyajyotisarkar23@gmail.com>
> ---
> xen/common/efi/boot.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
> index 1e3489e902..b735eac6b2 100644
> --- a/xen/common/efi/boot.c
> +++ b/xen/common/efi/boot.c
> @@ -167,6 +167,7 @@ static SIMPLE_TEXT_OUTPUT_INTERFACE *__initdata StdErr;
>
> static UINT32 __initdata mdesc_ver;
> static bool __initdata map_bs;
> +static bool __initdata opt_bgrt_disabled = false;
>
> static struct file __initdata cfg;
> static struct file __initdata kernel;
> @@ -868,6 +869,9 @@ static void __init efi_preserve_bgrt_img(EFI_SYSTEM_TABLE *SystemTable)
> bgrt_debug_info.preserved = false;
> bgrt_debug_info.failure_reason = NULL;
>
> + if ( opt_bgrt_disabled )
> + return;
> +
> bgrt = find_bgrt_table(SystemTable);
> if ( !bgrt )
> {
> @@ -1873,6 +1877,10 @@ static int __init cf_check parse_efi_param(const char *s)
> else
> __clear_bit(EFI_RS, &efi_flags);
> }
> + else if ( (ss - s) == 7 && !memcmp(s, "no-bgrt", 7) )
> + {
> + opt_bgrt_disabled = true;
> + }
This is too late - standard param parsing happens after efi_exit_boot()
already. See early cmdline parsing in efi_multiboot2() and also in
efi_start() (but note the latter is about options to xen.efi, which
isn't exactly the same as standard xen cmdline...)
> else if ( (ss - s) > 5 && !memcmp(s, "attr=", 5) )
> {
> if ( !cmdline_strcmp(s + 5, "uc") )
> @@ -1968,7 +1976,11 @@ void __init efi_init_memory(void)
> if ( !efi_enabled(EFI_BOOT) )
> return;
>
> - if ( bgrt_debug_info.preserved )
> + if ( opt_bgrt_disabled )
> + {
> + printk(XENLOG_INFO "EFI: BGRT preservation disabled\n");
> + }
> + else if ( bgrt_debug_info.preserved )
> {
> printk(XENLOG_INFO "EFI: BGRT image preserved: %u KB\n",
> bgrt_debug_info.size / 1024);
> --
> 2.53.0
>
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2026-03-08 18:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 19:18 [PATCH 0/3] Fixing ACPI BGRT (Boot Graphics Resource Table) corruption Soumyajyotii Ssarkar
2026-03-05 19:18 ` [PATCH 1/3] x86/efi: Add BGRT image preservation during boot Soumyajyotii Ssarkar
2026-03-08 18:30 ` Marek Marczykowski-Górecki
2026-03-09 7:31 ` Jan Beulich
2026-03-10 13:05 ` Soumyajyotii Ssarkar
2026-03-10 14:14 ` Jan Beulich
2026-03-14 4:32 ` Soumyajyotii Ssarkar
2026-03-05 19:18 ` [PATCH 2/3] x86/acpi: Remove BGRT invalidation code Soumyajyotii Ssarkar
2026-03-06 1:53 ` Marek Marczykowski-Górecki
2026-03-06 3:29 ` Soumyajyotii Ssarkar
2026-03-08 18:30 ` Marek Marczykowski-Górecki
2026-03-05 19:18 ` [PATCH 3/3] x86/efi: Add opt-out mechanism for BGRT preservation Soumyajyotii Ssarkar
2026-03-08 18:34 ` Marek Marczykowski-Górecki [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=aa3BQryZJYHyKJ3j@mail-itl \
--to=marmarek@invisiblethingslab.com \
--cc=andrew.cooper3@citrix.com \
--cc=dpsmith@apertussolutions.com \
--cc=jbeulich@suse.com \
--cc=roger.pau@citrix.com \
--cc=sarkarsoumyajyoti23@gmail.com \
--cc=soumyajyotisarkar23@gmail.com \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.