From nobody Mon May 6 23:04:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=quarantine dis=quarantine) header.from=epam.com ARC-Seal: i=1; a=rsa-sha256; t=1609934370; cv=none; d=zohomail.com; s=zohoarc; b=GLwFjhFoC/EzDavk4QHu7cvpHN+lAro1mlPeFZ0IYxIkKqf/LdUxMppz+H7M1IuDAoBLRmWHn/64BMDGzRjmpY7fFxUiELvWiCzgElxFUcZ6lcciJxJw296PWj10ZXSTjM6SAwZ3tCih9XdqEpWdh3ByInc834V8+tK6BCqellQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1609934370; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=JdFcMs/pUIsHSI+vfi2wmhcIQK7D4fvVMj9MOr+jVgs=; b=k4UCaN/rXy7Ao9B4Du4PZyoynxK3s7EFETRtk4pDTSpCWO2iKPzYR9nEthFa3IzdHmbUID8JvL4d1C+7gKd3EydpM8IPaVp0wQ3wja3Cy4uJqwMj82OLY1+AgDZFCE2lxW270ffyV1+fYMt7yz+rHvhgHSwhWKjO7yuKhSe8RtE= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=quarantine dis=quarantine) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1609934370208448.8661699802691; Wed, 6 Jan 2021 03:59:30 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.62457.110649 (Exim 4.92) (envelope-from ) id 1kx7T9-0006bt-HS; Wed, 06 Jan 2021 11:59:15 +0000 Received: by outflank-mailman (output) from mailman id 62457.110649; Wed, 06 Jan 2021 11:59:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kx7T9-0006bm-ER; Wed, 06 Jan 2021 11:59:15 +0000 Received: by outflank-mailman (input) for mailman id 62457; Wed, 06 Jan 2021 11:54:22 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kx7OQ-0006PW-PT for xen-devel@lists.xenproject.org; Wed, 06 Jan 2021 11:54:22 +0000 Received: from roman-X580VD (unknown [178.151.124.169]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 6dbeb541-4560-4860-9346-d070ea1399eb; Wed, 06 Jan 2021 11:54:21 +0000 (UTC) Received: from roman-X580VD (localhost [127.0.0.1]) by roman-X580VD (8.15.2/8.15.2/Debian-18) with ESMTP id 106BRwKO041026; Wed, 6 Jan 2021 13:27:58 +0200 Received: (from roman@localhost) by roman-X580VD (8.15.2/8.15.2/Submit) id 106BRwpL040994; Wed, 6 Jan 2021 13:27:58 +0200 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6dbeb541-4560-4860-9346-d070ea1399eb From: Roman Skakun To: xen-devel@lists.xenproject.org Cc: Volodymyr Babchuk , Stefano Stabellini , Julien Grall , Volodymyr Babchuk Subject: [PATCH v1] arm/optee: Use only least 32 bits for SMC type arg according to SMCCC Date: Wed, 6 Jan 2021 13:26:57 +0200 Message-Id: <123c27ed53ab50ca6f605a96002dcc7e1b7d3e6e.1609931750.git.rm.skakun@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This patch added additional sanity and increases an understanding for getting proper value from the first argument for SMC call on aarch64 according to SMCC Convention. [0] ARM DEN0028B, page 12 Signed-off-by: Roman Skakun Acked-by: Volodymyr Babchyk --- xen/arch/arm/tee/optee.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c index ee85359742..87060b52b8 100644 --- a/xen/arch/arm/tee/optee.c +++ b/xen/arch/arm/tee/optee.c @@ -1643,7 +1643,8 @@ static bool optee_handle_call(struct cpu_user_regs *r= egs) if ( !ctx ) return false; =20 - switch ( get_user_reg(regs, 0) ) + /* Only least 32 bits are significant (see ARM DEN 0028B, page 12) */ + switch ( (uint32_t)get_user_reg(regs, 0) ) { case OPTEE_SMC_CALLS_COUNT: set_user_reg(regs, 0, OPTEE_MEDIATOR_SMC_COUNT); --=20 2.25.1