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 2E529C433FE for ; Wed, 23 Nov 2022 02:12:34 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 074BB8553C; Wed, 23 Nov 2022 03:10:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="UW7TEbXO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5BF34854F7; Wed, 23 Nov 2022 03:10:34 +0100 (CET) Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CDDC685479 for ; Wed, 23 Nov 2022 03:10:31 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-io1-xd31.google.com with SMTP id y6so12274909iof.9 for ; Tue, 22 Nov 2022 18:10:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=hAcwztR5zKjtiNCRm0A2jd1D+Pzd36zzRn4Z0dDgJ0Q=; b=UW7TEbXO21rVfe1sOr4uhNIITeGH9DnkCXq1lg1z53vAoFxRrhBmEr5JGtjM8su3bc HVsREd0myOE46HYTV0Yzv2f/yzuTAlecXlACkLjrszlCXKYCDnQT6tnDMNtEYdfKATjN 6CP2e07m9/eF8IDpD/d/B0+wixZyu+CNUAZxY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hAcwztR5zKjtiNCRm0A2jd1D+Pzd36zzRn4Z0dDgJ0Q=; b=Ga0IpqaZRjwooo+1GiZpqaq4HQOjs+Uo/ZjAqAx7hSpf74NgtvjGpazz86c8puab67 Wiw74DLEcnXxvrY3T6W2GmZ5+P8flyFpksQx5m4IiCBkbOlkaraFmAiG6Yn/fBQRMxz4 Pok1KgDrLm6Cwn7zCWZpQhfpo7GoTQULhFfhkLGeTDlRLjQfh6b/Ztufeh9ZxL/9FbDA XPqW13IvDAJKteQaIygxNgfx0DIUvitTX8NnNT9OL5P7awW6GZcbEL/7EgHOCAqn+g6F CPWHLeW8C0bKjQDOc21Go870XKOQptB3Mt01p/WXMi5B5WL8nz0NySC/oJgf1cfN4Tyz H09w== X-Gm-Message-State: ANoB5pmlLhXjjS1idez0pfeT7ajfoMEY2t5U0Qay6H64/cXnTvGB5lx2 h7cty7gBzaGkm8jjMaqrXAdmc/6HA2Zj0onF2SiHew== X-Google-Smtp-Source: AA0mqf5TCOaD+ampvzTUwsP0Fb7UtPxfFIFgtmENYva+UUShV5X41pTVwRXVcINx3rs29caLE9iFY5mR4Zl29mki7eA= X-Received: by 2002:a05:6602:e:b0:6d6:d016:b56a with SMTP id b14-20020a056602000e00b006d6d016b56amr5542621ioa.204.1669169431135; Tue, 22 Nov 2022 18:10:31 -0800 (PST) MIME-Version: 1.0 References: <20221107192055.21669-1-abdellatif.elkhlifi@arm.com> <20221122131751.22747-1-abdellatif.elkhlifi@arm.com> <20221122131751.22747-5-abdellatif.elkhlifi@arm.com> In-Reply-To: <20221122131751.22747-5-abdellatif.elkhlifi@arm.com> From: Simon Glass Date: Tue, 22 Nov 2022 19:09:17 -0700 Message-ID: Subject: Re: [PATCH v8 04/10] arm_ffa: efi: unmap RX/TX buffers To: Abdellatif El Khlifi Cc: Drew.Reed@arm.com, achin.gupta@arm.com, ilias.apalodimas@linaro.org, jens.wiklander@linaro.org, nd@arm.com, trini@konsulko.com, u-boot@lists.denx.de, vishnu.banavath@arm.com, xueliang.zhong@arm.com Content-Type: text/plain; charset="UTF-8" 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 Hi Abdellatif, On Tue, 22 Nov 2022 at 06:18, Abdellatif El Khlifi wrote: > > unmap RX/TX buffers at ExitBootServices() > > Unmapping the RX/TX buffers created by u-boot is needed before EFI > runtime. U-Boot > > 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. U-Boot > > Signed-off-by: Abdellatif El Khlifi > Cc: Tom Rini > Cc: Simon Glass > Cc: Ilias Apalodimas > Cc: Jens Wiklander > > --- > > Changelog: > =============== > > v8: pass NULL device pointer to the FF-A bus operation > 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 253f9f75ef..8949aca250 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 > + Can we include it always? > 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) Can this use if() ? I am not sure what this is being done in EFI code, though. We can use device_remove(...DM_REMOVE_ACTIVE_ALL) which is designed to handle this. > + /* unmap FF-A RX/TX buffers */ > + if (ffa_bus_ops_get()->rxtx_unmap(NULL)) > + log_err("Can't unmap FF-A RX/TX buffers\n"); > +#endif > + > /* Patch out unsupported runtime function */ > efi_runtime_detach(); > > -- > 2.17.1 > Regards, SImon