From nobody Thu Apr 9 12:08:47 2026 Received: from fout-a8-smtp.messagingengine.com (fout-a8-smtp.messagingengine.com [103.168.172.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 693E838F941; Mon, 9 Mar 2026 12:17:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773058676; cv=none; b=J487VCjCvL9XotocTfGXbGxb4PAl7zcl+8+SkehVMX+cLlsR2hRsXlRbjBgeUi2yd9rUBZaZ8pos1cpmLV3JAZQBb5B0ril3TiTSy6B2Pc7hSszDGJHWy5KFffdMjDm1UJwnJ5Q2Dqes8iuuVhtLFSK7zaDM5s5tSiczKCLtzT0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773058676; c=relaxed/simple; bh=nbRursth3NAOvheA1s6ueSqBViTq09Y3HTTMFy/tR98=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=N2a6Eb5F2K2tAGCk4TfMr052Ai05aM75IbmFmov++TeosY125bQMH148MsWNjMCWhb56+qtL6Yb24L0YH4tfb6N9Vu7TzjuNovpqhuF/BHAIctyPZrK6+7J2V6VV+SDKyz7GqIpVZnsNiu15i85UhtMJcViJLAOoPfbIgPhgZuQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=invisiblethingslab.com; spf=pass smtp.mailfrom=invisiblethingslab.com; dkim=pass (2048-bit key) header.d=invisiblethingslab.com header.i=@invisiblethingslab.com header.b=stkVUOnK; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=uOhkoL1E; arc=none smtp.client-ip=103.168.172.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=invisiblethingslab.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=invisiblethingslab.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=invisiblethingslab.com header.i=@invisiblethingslab.com header.b="stkVUOnK"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="uOhkoL1E" Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id D0090EC04DC; Mon, 9 Mar 2026 08:17:54 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Mon, 09 Mar 2026 08:17:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1773058674; x=1773145074; bh=vxQTTI3dqC AbknZWRjEqDbjVPMeCodcJdMqbuNqpGws=; b=stkVUOnKviF3cZ0l4UHwr7x8TD iQxAuWDpin2T6RvJFpnaPTD5gwimiUMx0k+WR7+ruRUG/cnD+kNbkWrNPw6o8p5E nOTkm501LswWKF9AZmCC6mwEQIFaOTzuWdjscdi0stunYP3g6ytAFpGZ/K2eP9rX +MWqvvQHhYpOGzZC7lKrGp7kig9sjdMhlSq4DogKW8GXPfbjiu60om2aITYYuEmW 3PzgHGQ8BpFb7NGaTTpXOTOZmq3Dc1m/ozSUk7mf9odJpqRIbeq40SgPoV9tG2zx LbNHIkwPgGoUgMZ7O7NRdZpy869uohejeJoSakkOT9WlpzUVtXritXmqKKCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1773058674; x= 1773145074; bh=vxQTTI3dqCAbknZWRjEqDbjVPMeCodcJdMqbuNqpGws=; b=u OhkoL1EE/l9xCqGN4gPTo4U3frn5K1lfoODCx0Tmxhodn43l1oYPT8iqiVSqwcHc 9XArMpkDY9NXe6ZfhhV0oQvqG8P/Pa7uM3m7zyFOVbi7vWo00jsnsh0liH3d4YXR 6PwC6S03/TPB020MFP18n1bHxe/Ip9Y/LjIW/1xmroOTzX13t7HBQgm7tO6IGsz8 RFo93xsHiY5aKdC75/2PyQSuq4Hs0eJoznfce6CsAo3v4VwVaegtJvgHwWyd6/C0 BoxOZQw3Y9AMBHr3ZZ80K6Y8aUGAKsNhrKQIuAd/chMqEzCqDjFli4bZX8gw43Uo o5HiaAUqTErTvi213XCXw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvjeektdelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghk ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpefguedu hefgvdefheehudejheefudevueeghfekhfehleegveduteeuiedugffgffenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgvkhes ihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhmpdhnsggprhgtphhtthhopeejpd hmohguvgepshhmthhpohhuthdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhg vghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehsohhumhihrghjhihothhishgrrh hkrghrvdefsehgmhgrihhlrdgtohhmpdhrtghpthhtohepgigvnhdquggvvhgvlheslhhi shhtshdrgigvnhhprhhojhgvtghtrdhorhhgpdhrtghpthhtohepmhgrrhhmrghrvghkse hinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomhdprhgtphhtthhopegrrhgusges khgvrhhnvghlrdhorhhgpdhrtghpthhtohepihhlihgrshdrrghprghlohguihhmrghsse hlihhnrghrohdrohhrghdprhgtphhtthhopehlihhnuhigqdgvfhhisehvghgvrhdrkhgv rhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i1568416f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 9 Mar 2026 08:17:53 -0400 (EDT) From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: linux-kernel@vger.kernel.org Cc: Soumyajyotii Ssarkar , xen-devel@lists.xenproject.org, =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Ard Biesheuvel , Ilias Apalodimas , linux-efi@vger.kernel.org (open list:EXTENSIBLE FIRMWARE INTERFACE (EFI)) Subject: [PATCH 2/2] efi: Enable BGRT loading under Xen Date: Mon, 9 Mar 2026 13:17:23 +0100 Message-ID: X-Mailer: git-send-email 2.52.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The BGRT table can be parsed if EFI_PARAVIRT is enabled, even if EFI_MEMMAP is not. Xen will take care of preserving the image even if EfiBootServicesData memory is reclaimed already, or invalidate the table if it didn't preserve it - in both cases accesing the table itself under virt is safe. Also allow the ESRT to be in reclaimable memory, as that is where future Xen versions will put it. This is similar approach as was taken for ESRT table in 01de145dc7fb "efi: Actually enable the ESRT under Xen". Signed-off-by: Marek Marczykowski-G=C3=B3recki --- drivers/firmware/efi/efi-bgrt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/efi/efi-bgrt.c b/drivers/firmware/efi/efi-bgr= t.c index 6aafdb6..1da4515 100644 --- a/drivers/firmware/efi/efi-bgrt.c +++ b/drivers/firmware/efi/efi-bgrt.c @@ -29,11 +29,12 @@ void __init efi_bgrt_init(struct acpi_table_header *tab= le) void *image; struct bmp_header bmp_header; struct acpi_table_bgrt *bgrt =3D &bgrt_tab; + int mem_type; =20 if (acpi_disabled) return; =20 - if (!efi_enabled(EFI_MEMMAP)) + if (!efi_enabled(EFI_MEMMAP) && !efi_enabled(EFI_PARAVIRT)) return; =20 if (table->length < sizeof(bgrt_tab)) { @@ -62,7 +63,9 @@ void __init efi_bgrt_init(struct acpi_table_header *table) goto out; } =20 - if (efi_mem_type(bgrt->image_address) !=3D EFI_BOOT_SERVICES_DATA) { + mem_type =3D efi_mem_type(bgrt->image_address); + if (mem_type !=3D EFI_BOOT_SERVICES_DATA && + mem_type !=3D EFI_ACPI_RECLAIM_MEMORY) { pr_notice("Ignoring BGRT: invalid image address\n"); goto out; } --=20 git-series 0.9.1