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 A19B1C77B75 for ; Fri, 21 Apr 2023 08:10:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2F9B886094; Fri, 21 Apr 2023 10:10:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="PmRG/Mf1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 05BBF860B1; Fri, 21 Apr 2023 10:10:10 +0200 (CEST) Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) (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 861EE86074 for ; Fri, 21 Apr 2023 10:10:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3f167d0c91bso14928275e9.2 for ; Fri, 21 Apr 2023 01:10:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1682064607; x=1684656607; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=5TN/vmGAmpSdpdMs0zdaSG/837DwbgA4gSGla1Z2iFE=; b=PmRG/Mf1Sy2xe9vCH8MeMpGQDMI5l0AkY661VmY4CCnndtg41NrHdXFW5AIaNzhMPz kcUOPDuWMS2XAFCnsgVTl3w1GWZaJLLgM4O+ZLBAA/MuYF/xI6oSwsgYaubkdpP9Xvs9 rHuz8NgPzpGvOvcoqzHohpnxXFZHNyrr1TOAX8EJYP/jfAHVRQs+EXPrgshmMpggObYa b6tB/d60d261HR1GbnfCE8YmUcBfBvqnJc0OtHbU8v+bXLZw2FVpyWQ58PglCq30SgCU bQV1gq79FE9Guu5rQXDmagL1JRt2fPnSYQQ9pR2GuJpdP/DDhVujusHwCEeaSIh/pbA/ zjSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682064607; x=1684656607; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5TN/vmGAmpSdpdMs0zdaSG/837DwbgA4gSGla1Z2iFE=; b=JAXe5O3oaKVSQo34yzZ+nIhsfvjd69lUiohPyPsIdvMoQCNMrks1iLvmuJ5uIGqhcA ZSJUmWaoifoxOKMbdjxBJ/9lAhxZqIJscQKo4oQT9E5TPqC5vzDn0nI0u3bE0lYSIapt B6uBm7rEG/xXYwE2neVMZy9e83+oXJ24hUS26sXSPOZ1ZxpH8OvPXphC2vuJN9T8Zc6S ABR+H6qBY48M2jRj+Gxck7OHv4UuIt+FCMNAwmcXTubslGAhaveW9Vk0+U+KvWbk8XCI r7wo7pc5pAbhi+S48J5VUSZucP4SHx9aJgiiNfutZrOCc+zJFdY0a1M9jC8FReoUnzex BDwg== X-Gm-Message-State: AAQBX9cffCgtqBa9/f6cMpbu6n7fRc3MFEh+vO3seRy1SZ+d074MPM6w XZMjrC8xMIsDCbuHjnQ0l9MeOQ== X-Google-Smtp-Source: AKy350Zc6sTkoq4E4dGFsZyu2QUf/n5l+ivQfCsFJcJDii+tmxIy4yruGHCLe4KituqqTgcrzILu+A== X-Received: by 2002:a05:600c:21c7:b0:3f1:7ae0:8256 with SMTP id x7-20020a05600c21c700b003f17ae08256mr1128497wmj.34.1682064606909; Fri, 21 Apr 2023 01:10:06 -0700 (PDT) Received: from hera (ppp176092130041.access.hol.gr. [176.92.130.41]) by smtp.gmail.com with ESMTPSA id r16-20020a5d4e50000000b002c7066a6f77sm3860965wrt.31.2023.04.21.01.10.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Apr 2023 01:10:06 -0700 (PDT) Date: Fri, 21 Apr 2023 11:10:04 +0300 From: Ilias Apalodimas To: Abdellatif El Khlifi Cc: Drew.Reed@arm.com, achin.gupta@arm.com, jens.wiklander@linaro.org, nd@arm.com, robh@kernel.org, sjg@chromium.org, trini@konsulko.com, u-boot@lists.denx.de, xueliang.zhong@arm.com, Gowtham Suresh Kumar Subject: Re: [PATCH v11 09/10] arm_ffa: efi: introduce FF-A MM communication Message-ID: References: <20230328161157.219375-1-abdellatif.elkhlifi@arm.com> <20230412094245.44674-1-abdellatif.elkhlifi@arm.com> <20230412094245.44674-10-abdellatif.elkhlifi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230412094245.44674-10-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.8 at phobos.denx.de X-Virus-Status: Clean Hi Abdellatif, [...] > > @@ -162,7 +450,16 @@ static efi_status_t mm_communicate(u8 *comm_buf, efi_uintn_t dsize) > mm_hdr = (struct efi_mm_communicate_header *)comm_buf; > var_hdr = (struct smm_variable_communicate_header *)mm_hdr->data; > > - ret = optee_mm_communicate(comm_buf, dsize); > + mm_comms = select_mm_comms(); switch()/case probably looks more readable here > + if (mm_comms == MM_COMMS_UNDEFINED) { > + ret = EFI_UNSUPPORTED; > + } else { > + if (mm_comms == MM_COMMS_OPTEE) > + ret = optee_mm_communicate(comm_buf, dsize); > + else > + ret = ffa_mm_communicate(comm_buf, dsize); > + } > + > if (ret != EFI_SUCCESS) { > log_err("%s failed!\n", __func__); > return ret; > @@ -258,6 +555,13 @@ efi_status_t EFIAPI get_max_payload(efi_uintn_t *size) > goto out; > } > *size = var_payload->size; > + > + #if (IS_ENABLED(CONFIG_ARM_FFA_TRANSPORT)) > + if (*size > FFA_SHARED_MM_BUFFER_SIZE) > + *size = FFA_SHARED_MM_BUFFER_SIZE - MM_COMMUNICATE_HEADER_SIZE - > + MM_VARIABLE_COMMUNICATE_SIZE; > + #endif > + > /* > * There seems to be a bug in EDK2 miscalculating the boundaries and > * size checks, so deduct 2 more bytes to fulfill this requirement. Fix > @@ -697,7 +1001,7 @@ void efi_variables_boot_exit_notify(void) > ret = EFI_NOT_FOUND; > > if (ret != EFI_SUCCESS) > - log_err("Unable to notify StMM for ExitBootServices\n"); > + log_err("Unable to notify the MM partition for ExitBootServices\n"); > free(comm_buf); > > /* > -- > 2.25.1 > Thanks /Ilias