Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DFFBC106F2FE for ; Thu, 26 Mar 2026 08:46:13 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1263511.1555421 (Exim 4.92) (envelope-from ) id 1w5gLc-0001bY-Ba; Thu, 26 Mar 2026 08:45:48 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1263511.1555421; Thu, 26 Mar 2026 08:45:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w5gLc-0001bR-7j; Thu, 26 Mar 2026 08:45:48 +0000 Received: by outflank-mailman (input) for mailman id 1263511; Thu, 26 Mar 2026 08:45:47 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1w5gLb-0001bL-03 for xen-devel@lists.xenproject.org; Thu, 26 Mar 2026 08:45:47 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1w5gLa-008fyN-C7 for xen-devel@lists.xenproject.org; Thu, 26 Mar 2026 09:45:46 +0100 Received: from [10.42.69.12] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 69c4f232-e002-0a2a0a5209dd-0a2a450cd698-28 for ; Thu, 26 Mar 2026 09:45:46 +0100 Received: from [209.85.221.50] (helo=mail-wr1-f50.google.com) by tlsNG-d25034.mxtls.expurgate.net with ESMTPS (eXpurgate 4.55.2) (envelope-from ) id 69c4f239-f93d-0a2a450c0019-d155dd32e42a-3 for ; Thu, 26 Mar 2026 09:45:45 +0100 Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-439c6fc2910so407007f8f.0 for ; Thu, 26 Mar 2026 01:45:45 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43b919e722dsm5824472f8f.35.2026.03.26.01.45.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Mar 2026 01:45:44 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1774514745; x=1775119545; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=OK6kAUOsV5F4+1Xd/60jF2be9L/gHqBtwrdyMSriVKI=; b=F9uv4O07gUA+hVQN9sX2s7ndjBmYqUZazXq1/YQjX+mPJmVvq5/ILUvyLJUMmPZez/ tDtFCAjo24qOp3rDVoxA3U4PWr2aOQkVwfu/z2Y+e9loUuhfSjXJpkYZF9XXPMojqp61 Lq30de18z30gECOo84va+YGSg4ApXdmoJIlKkP9D/mPscwv6GBHkAAOParlmk7qms3Oc x4KK0GN+zKtclNBUXFGifoguXTDYuM9FnLIkoWN9ZMyPowJL5IUTg7REJwkDwR6MDaHp WDqsTbLB5Wgd3QrGwXP9fzT7qM+oeaMLM9ZcylPofyaWnbiJn2+lHWMMdJN1MkK7dYoX uTxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774514745; x=1775119545; h=content-transfer-encoding:in-reply-to:autocrypt: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=OK6kAUOsV5F4+1Xd/60jF2be9L/gHqBtwrdyMSriVKI=; b=gZzVY04lgDQqOY7E2kJ4zo7cY1d6S9cwAifVkhx3lhpcS1PWw0nc2DK8RjVoqAzVz1 FVKLaedFuXAod/65mDPaEGvCLcrBnW4cASdx2xGZebqyDAtabqg6/ndUYwW0llPuqAYX uHtbJZw4Grv9unez6TUSJRtN8q4D+n2ikVPwqr6ss7nnuWd3ZYcO+9BDkurqLoswSrjr OzUxc1h9Ap1Ikr7ppoAR6TTzjELiVZu7r924seXCSL1zjts7udW7B2nNe3ec8BUuuILi ZxIXTK7HfAl3po8vUA9I3x1iXZhu7Jlbjwg1fHFIN6nAyMWNgC/m/2DvYL3AFG1wokF7 jqLw== X-Forwarded-Encrypted: i=1; AJvYcCWJSpmmjv2Ex4L6y4Ztjmud9MI2vyb13QQ/AY0Eg0AcKw6FoJrJISkvdPwmv+nzWphowhwhcS9kYJo=@lists.xenproject.org X-Gm-Message-State: AOJu0Yxmg+4Cry0ZroaPCoW9pPs2ew7954Xb+Od1cYTE14uR4Px7WjQ4 Rg7Nkm0cjUFwhxd4w4HIK+ALPLRRhM0db7eTk74cJciehxLOTmvQ6dJj2qawtrQybA== X-Gm-Gg: ATEYQzxsZEA02TIIvyqsD0GsLhNruqXpDml3zRCiSs5+vEvRNpOqoYSYkf2zcLyUz+q 6ZFHTYQMbJhRwIhxdoXoavMIuezUr6Xx8lUZpyCSR6a1DNUlp2XOy0mn7fjzBr9RvehSQMcUICR a7RSCw0AMUfyX5qF09uiYzUlOLEPczw9JhtxtmUjvkCOXnGeHFq4A1Ucm8J/fJ8SZYfeAO3qGmt AREX3J5NFztQcvdYqP3DK/FhulaIieXbxndIPIjhuk6Ufqdduop1tq78doltrzE6IEFSpghGLjE 9LnN7ta9MAuHCho/gS5jFYwkCjZ4fg58IeoJvLEv1SysetAtXANgJSnxnjECLS56K9ibynRu+XS vQhmdvQqOQwpIwwi62Lr6qOG0Y0712TYelo7xw/LyWUqw5BkdOq2NwnWGrH+WUP5NdXOY1TVLsO gHsmHNKAd0tXIjqsEpU82dPcY9MWMy8XvCokIXhqoK5Ry8MjkpwujATNhNhaagyrJtv9S4JDu/z S4llE1jMdvfZ/A= X-Received: by 2002:a05:6000:220b:b0:43b:43ae:8c25 with SMTP id ffacd0b85a97d-43b88a44842mr10137377f8f.52.1774514744853; Thu, 26 Mar 2026 01:45:44 -0700 (PDT) Message-ID: <11c0a822-afc7-4e3d-b6f5-ef8e32bd2f0f@suse.com> Date: Thu, 26 Mar 2026 09:45:43 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 2/3] x86/acpi: Integrate BGRT preservation with status reporting To: =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= Cc: Soumyajyotii Ssarkar , Andrew Cooper , "Daniel P . Smith" , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , sarkarsoumyajyoti23@gmail.com, xen-devel@lists.xenproject.org References: <20260324123312.11076-1-soumyajyotisarkar23@gmail.com> <20260324123312.11076-3-soumyajyotisarkar23@gmail.com> <751e1d3e-d95a-4129-8baa-450a53d15efa@suse.com> <5e121a98-fcd1-4d20-aa6c-a02af7f7eef4@suse.com> Content-Language: en-US From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGs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JzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-purgate-ID: tlsNG-d25034/1774514745-6D2B9734-953399DA/0/0 X-purgate-type: clean X-purgate-size: 3564 On 25.03.2026 16:57, Marek Marczykowski-Górecki wrote: > On Wed, Mar 25, 2026 at 04:44:15PM +0100, Jan Beulich wrote: >> On 25.03.2026 16:32, Marek Marczykowski-Górecki wrote: >>> On Wed, Mar 25, 2026 at 04:16:25PM +0100, Jan Beulich wrote: >>>> On 24.03.2026 13:33, Soumyajyotii Ssarkar wrote: >>>>> @@ -327,6 +328,11 @@ static int __init cf_check acpi_parse_hpet(struct acpi_table_header *table) >>>>> return 0; >>>>> } >>>>> >>>>> +/* >>>>> + * Invalidate BGRT if image is in conventional RAM (preservation failed). >>>>> + * If preservation succeeded, image is in EfiACPIReclaimMemory, which >>>>> + * won't match RAM_TYPE_CONVENTIONAL check, so table remains valid. >>>>> + */ >>>>> static int __init cf_check acpi_invalidate_bgrt(struct acpi_table_header *table) >>>>> { >>>>> struct acpi_table_bgrt *bgrt_tbl = >>>>> @@ -754,5 +760,7 @@ int __init acpi_boot_init(void) >>>>> >>>>> acpi_table_parse(ACPI_SIG_BGRT, acpi_invalidate_bgrt); >>>>> >>>>> + efi_bgrt_status_info(); >>>>> + >>>>> return 0; >>>>> } >>>> >>>> Does this really need doing from here? If you called it ... >>>> >>>>> --- a/xen/common/efi/boot.c >>>>> +++ b/xen/common/efi/boot.c >>>>> @@ -1911,6 +1911,22 @@ static bool __init cf_check rt_range_valid(unsigned long smfn, unsigned long emf >>>>> return true; >>>>> } >>>>> >>>>> +void __init efi_bgrt_status_info(void) >>>>> +{ >>>>> + if ( !efi_enabled(EFI_BOOT) ) >>>>> + return; >>>>> + >>>>> + if ( bgrt_info.preserved ) >>>>> + { >>>>> + printk(XENLOG_INFO "EFI: BGRT image preserved: %lu KB\n", >>>>> + bgrt_info.size / 1024); >>>>> + printk(XENLOG_INFO "EFI: BGRT relocated from %p to %p\n", >>>>> + bgrt_info.old_addr, bgrt_info.new_addr); >>>>> + } >>>>> + else if ( bgrt_info.failure_reason[0] ) >>>>> + printk(XENLOG_WARNING "EFI: BGRT preservation failed: %s\n", >>>>> + bgrt_info.failure_reason); >>>>> +} >>>>> >>>>> void __init efi_init_memory(void) >>>>> { >>>> >>>> ... out of this function, it could be static and no stub (misplaced in >>>> the earlier patch) would be needed either. >>> >>> It was here before, and I complained about it, because it printed the >>> invalidation reason way later than the actual invalidation. >> >> Sadly now I complain about this call out of acpi_boot_init(). What's wrong >> with logging the BGRT stuff together with the memory map? > > If you try to diagnose what went wrong with BGRT, that's not very > intuitive to find - for example on my system it's 32 messages later. Simply grep the log for BGRT? > It's even worse if system happens to crash between those two points. Hmm, perhaps. > IMO it makes sense to log reason for BGRT invalidation together with > the actual invalidation (message). I would be okay with moving it before > the actual invalidation, but I don't think there is a place like this in > xen/common/efi/boot.c (at a point where normal printk can be used already). I guess what you really mean is printk() output actually going out (i.e. not just to the ring buffer). While still requiring the function to be extern (and there to be a stub), how about adding the call much earlier in __start_xen, in here: else if ( efi_enabled(EFI_BOOT) ) memmap_type = "EFI"; ? Or alternatively anywhere between setting system_state to SYS_STATE_boot and the call to acpi_boot_init()? Or re-using the other EFI_BOOT check that we have in __start_xen()? Jan