From mboxrd@z Thu Jan 1 00:00:00 1970 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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 26B03C433FE for ; Mon, 7 Nov 2022 19:21:52 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B35F78503E; Mon, 7 Nov 2022 20:21:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 3B2478502C; Mon, 7 Nov 2022 20:21:25 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 19DE984FA4 for ; Mon, 7 Nov 2022 20:21:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=abdellatif.elkhlifi@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 72FCA23A; Mon, 7 Nov 2022 11:21:27 -0800 (PST) Received: from e121910.arm.com (unknown [10.57.38.120]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B884C3F534; Mon, 7 Nov 2022 11:21:18 -0800 (PST) From: Abdellatif El Khlifi To: abdellatif.elkhlifi@arm.com Cc: Drew.Reed@arm.com, achin.gupta@arm.com, ilias.apalodimas@linaro.org, jens.wiklander@linaro.org, nd@arm.com, sjg@chromium.org, trini@konsulko.com, u-boot@lists.denx.de, vishnu.banavath@arm.com, xueliang.zhong@arm.com Subject: [PATCH v7 04/10] arm_ffa: efi: unmap RX/TX buffers Date: Mon, 7 Nov 2022 19:20:49 +0000 Message-Id: <20221107192055.21669-5-abdellatif.elkhlifi@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221107192055.21669-1-abdellatif.elkhlifi@arm.com> References: <20221013103857.614-1-abdellatif.elkhlifi@arm.com> <20221107192055.21669-1-abdellatif.elkhlifi@arm.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean unmap RX/TX buffers at ExitBootServices() Unmapping the RX/TX buffers created by u-boot is needed before EFI runtime. At EFI runtime the linux kernel takes care of allocating its own RX/TX buffers and registering them with the secure world. Secure world should be using the RX/TX buffers created by the kernel. So, RX/TX buffers created by u-boot must be unmapped. Signed-off-by: Abdellatif El Khlifi Cc: Tom Rini Cc: Simon Glass Cc: Ilias Apalodimas Cc: Jens Wiklander --- Changelog: =============== v7: replace debug() by log_err() lib/efi_loader/efi_boottime.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index a56021559b..b0b61bc812 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -3,6 +3,9 @@ * EFI application boot time services * * Copyright (c) 2016 Alexander Graf + * + * (C) Copyright 2022 ARM Limited + * Abdellatif El Khlifi */ #include @@ -23,6 +26,10 @@ #include #include +#if CONFIG_IS_ENABLED(ARM_FFA_TRANSPORT) +#include +#endif + DECLARE_GLOBAL_DATA_PTR; /* Task priority level */ @@ -2178,6 +2185,12 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle, dm_remove_devices_flags(DM_REMOVE_ACTIVE_ALL); } +#if CONFIG_IS_ENABLED(ARM_FFA_TRANSPORT) + /* unmap FF-A RX/TX buffers */ + if (ffa_bus_ops_get()->rxtx_unmap()) + log_err("Can't unmap FF-A RX/TX buffers\n"); +#endif + /* Patch out unsupported runtime function */ efi_runtime_detach(); -- 2.17.1