From patchwork Fri Jul 17 04:55:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 235666 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp1382732ilg; Thu, 16 Jul 2020 21:55:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcJL/zPbv1w0ntYCK7hu09kz/lZRtSkCqgjatDnA6NPeiDlhKfv/9BU+UYIieA0JYdxAoc X-Received: by 2002:a05:6402:17ee:: with SMTP id t14mr7739596edy.359.1594961719109; Thu, 16 Jul 2020 21:55:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594961719; cv=none; d=google.com; s=arc-20160816; b=UZqW5zXdB3ifjOGegte6N97bkeke31FZzBAE6XZgSH0uj9tMKQgKMoVNEWnUKO32Yw Ogt+MpyQTO+iVD88zTfByD5A4vTzlIccBnPYy9F2NYSzarO2hQW7vajVNxsI/ejs4scx KfiSvwouDQnKNsMUR/mJGA3juoz1PYdhHlFWweHV8jtJdnBW7Dfhryn36FqmtoaL8tvk bfQ2W4f++lmvf4nwUNQq/M+WDO3SeLhHtB/y3dTDz0ZcxJLaNRQxi+9fuqKlXT9SU1ah lv8RryypijoMJvgB+MQNIE7XmrZXmfgXE91t5h858HRv7ldvXlJlE7hXi5LLWk3Fgk1n F/Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=fI4tEiFlih0MODJPviY82TcZqYwz6Aw7YLZvtUiC29A=; b=Mv6kfNMlRJ/+FdYLFhTiH3prWNIRDtQzH7hDWXzTTisOjrMbMsivbWMhOwnCeN7rlB Xscai2Un8JWjbMjea/CD/C6nxnVPUzYD52Bxt0QofSQ3C56FdaR/ZeChSoqK2Tsosjs3 vZIVUplIP/d2EVC+epZx1Z3jybz/K72Y3eSqrQ8Mq5FCLJ/IRdTTICzJojJW1U0Wo7uR zBzfd1wf2569zylbhkyvWZmNzDmxl5bL5AlX8UPOwd0+C4woYBMaaCKGLhcmOjk7dieB CnY53SNRVnkGiWCpU9DqBo5Hz0iCR7fWlrkVXxmjPibz0m5t9/X5bhtx5ESxBkLSssIb /+FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j3G3UXmD; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id f21si5563517ejl.362.2020.07.16.21.55.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 21:55:19 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j3G3UXmD; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 78C9081BF9; Fri, 17 Jul 2020 06:55:15 +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="j3G3UXmD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C702B81BFD; Fri, 17 Jul 2020 06:55:13 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (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 AA7A381BF7 for ; Fri, 17 Jul 2020 06:55:08 +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-wr1-x442.google.com with SMTP id f18so9679882wrs.0 for ; Thu, 16 Jul 2020 21:55:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fI4tEiFlih0MODJPviY82TcZqYwz6Aw7YLZvtUiC29A=; b=j3G3UXmDC8yGd9T6gPxTyaKk6Im42pLpWRhiXJYLULKI6hEYetp2K4r3QbleG+PcJW VzjpfLw4KZ2s6tMwfL155bsM+c/tWwm31TOmPMwPiaL15ljBQTH7Ho3+1Fw4YYP8XZhw 5OBVgzFnVzuNxOk1q53CrHaZFecGE+Ft2cCQViKRL86N5T1B7Bs1oL0uvwGuDN9i+3Fi whylBJghgWro4M77wIpKYSQtY6DsJCESUp6zCB1Nw6nF6cNEv69Y75dVq4l77hxHeX/r ja/FdxRsmHq/gpyzb1mfxaxOE2ovCwvFAD2HFcjwDSB3DB+ktebgjp9rYHaWEWENErJa TCDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fI4tEiFlih0MODJPviY82TcZqYwz6Aw7YLZvtUiC29A=; b=A+6E0UKy13AM8rxv6UWVSK/JPljOYKF8l/vNWaGSpxzfKYYRx4Ez7M9f8oKR3CK452 r7yftg31QxG5NE5kviFJyT/h7i+4zYXzZTcmGtdT8G93KbAPdzsEwsuGiKs97MoJMkME HQn0rloVVogZo1Ie9/Buh+zeiSK1P7FOQqQ2W8hpCFbsGkHUGGFjrLrmYSDPHD3XXa9p SF5Ast83h5bs87w1l9ANzEHKZlCBacGW6X7cqUtDlgnBSIIUjEK03O89VDfCsPgmUB61 5TiEVtTu6wb2FqBsLsSam8H50STzevCUVlGcbwxOqw1Qw8L9xWtaU3awwABtFB1eXWPE 9E/g== X-Gm-Message-State: AOAM532dIeeNmGXRiUUTXziAmtjNA9yEM8uVfz02ya5Ztfi2PPUoFHmd odOXm3gjR32cWYNbharxKsoDw7c8MgA= X-Received: by 2002:a05:6000:ce:: with SMTP id q14mr8315198wrx.294.1594961706615; Thu, 16 Jul 2020 21:55:06 -0700 (PDT) Received: from apalos.home ([2a02:587:460d:e29f:2e56:dcff:fe9a:8f06]) by smtp.gmail.com with ESMTPSA id x1sm12034089wrp.10.2020.07.16.21.55.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 21:55:06 -0700 (PDT) From: Ilias Apalodimas To: u-boot@lists.denx.de, xypron.glpk@gmx.de Cc: agraf@csgraf.de, Ilias Apalodimas Subject: [PATCH v2] efi_loader: Rename and correct values for ARM_SMC_MM_* Date: Fri, 17 Jul 2020 07:55:03 +0300 Message-Id: <20200717045503.185315-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.28.0.rc0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean Instead of adding the definition for the specific MM SVC used in StandAloneMM we added the one used in the standard SMC calls. So change the value from -4 to -5 to match the correct one defined in EDK2 and rename them to avoid future confusion Fixes 23a397d2e2fb: ("efi_loader: Add headers for EDK2 StandAloneMM communication") Signed-off-by: Ilias Apalodimas --- Changes since v1: - v1 was efi_loader: Correct value for ARM_SMC_MM_RET_NO_MEMORY - Renamed all the definitions according to EDK2 include/mm_communication.h | 16 ++++++++-------- lib/efi_loader/efi_variable_tee.c | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) -- 2.28.0.rc0 Reviewed-by: Heinrich Schuchardt diff --git a/include/mm_communication.h b/include/mm_communication.h index f9c05bb7f104..e464cbb48e22 100644 --- a/include/mm_communication.h +++ b/include/mm_communication.h @@ -52,14 +52,14 @@ struct efi_mm_communicate_header { #define MM_COMMUNICATE_HEADER_SIZE \ (sizeof(struct efi_mm_communicate_header)) -/* Defined in EDK2 ArmPkg/Include/IndustryStandard/ArmStdSmc.h */ - -/* MM return error codes */ -#define ARM_SMC_MM_RET_SUCCESS 0 -#define ARM_SMC_MM_RET_NOT_SUPPORTED -1 -#define ARM_SMC_MM_RET_INVALID_PARAMS -2 -#define ARM_SMC_MM_RET_DENIED -3 -#define ARM_SMC_MM_RET_NO_MEMORY -4 +/* Defined in EDK2 ArmPkg/Include/IndustryStandard/ArmMmSvc.h */ + +/* SPM return error codes */ +#define ARM_SVC_SPM_RET_SUCCESS 0 +#define ARM_SVC_SPM_RET_NOT_SUPPORTED -1 +#define ARM_SVC_SPM_RET_INVALID_PARAMS -2 +#define ARM_SVC_SPM_RET_DENIED -3 +#define ARM_SVC_SPM_RET_NO_MEMORY -5 /* Defined in EDK2 MdeModulePkg/Include/Guid/SmmVariableCommon.h */ diff --git a/lib/efi_loader/efi_variable_tee.c b/lib/efi_loader/efi_variable_tee.c index c0423489388a..5f4aae60bf23 100644 --- a/lib/efi_loader/efi_variable_tee.c +++ b/lib/efi_loader/efi_variable_tee.c @@ -106,19 +106,19 @@ static efi_status_t optee_mm_communicate(void *comm_buf, ulong dsize) tee_close_session(conn.tee, conn.session); switch (param[1].u.value.a) { - case ARM_SMC_MM_RET_SUCCESS: + case ARM_SVC_SPM_RET_SUCCESS: ret = EFI_SUCCESS; break; - case ARM_SMC_MM_RET_INVALID_PARAMS: + case ARM_SVC_SPM_RET_INVALID_PARAMS: ret = EFI_INVALID_PARAMETER; break; - case ARM_SMC_MM_RET_DENIED: + case ARM_SVC_SPM_RET_DENIED: ret = EFI_ACCESS_DENIED; break; - case ARM_SMC_MM_RET_NO_MEMORY: + case ARM_SVC_SPM_RET_NO_MEMORY: ret = EFI_OUT_OF_RESOURCES; break;