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 9AED0C4332F for ; Tue, 8 Nov 2022 10:48:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 236CA84DEB; Tue, 8 Nov 2022 11:48:54 +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 7DA1184DEB; Tue, 8 Nov 2022 11:48:52 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id D7E2281C06 for ; Tue, 8 Nov 2022 11:48:49 +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 76B3D1FB; Tue, 8 Nov 2022 02:48:55 -0800 (PST) Received: from e121910.cambridge.arm.com (unknown [10.57.36.86]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 77CE53F534; Tue, 8 Nov 2022 02:48:48 -0800 (PST) Date: Tue, 8 Nov 2022 10:48:45 +0000 From: Abdellatif El Khlifi To: Ilias Apalodimas Cc: u-boot@lists.denx.de, nd@arm.com Subject: Re: [PATCH v6 04/10] arm_ffa: efi: unmap RX/TX buffers Message-ID: <20221108104845.GA31733@e121910.cambridge.arm.com> References: <20220926140827.15125-1-abdellatif.elkhlifi@arm.com> <20221013103857.614-1-abdellatif.elkhlifi@arm.com> <20221013103857.614-5-abdellatif.elkhlifi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) 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 On Mon, Oct 24, 2022 at 03:08:53PM +0300, Ilias Apalodimas wrote: > On Thu, Oct 13, 2022 at 11:38:51AM +0100, Abdellatif El Khlifi wrote: > > 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 > > --- > > lib/efi_loader/efi_boottime.c | 15 +++++++++++++++ > > 1 file changed, 15 insertions(+) > > > > diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c > > index a56021559b..2054b33568 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,14 @@ 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()) > > + debug("[efi_boottime][ERROR]: can not unmap FF-A RX/TX buffers\n"); > > Just do log_err() here and get rid of the else Thanks. Done in v7. > > > + else > > + debug("[efi_boottime][INFO]: FF-A RX/TX buffers unmapped\n"); > > +#endif > > + > > /* Patch out unsupported runtime function */ > > efi_runtime_detach(); > > > > -- > > 2.17.1 > > > > Thanks > /Ilias