From patchwork Fri Aug 24 14:08:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 10575435 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1BFF81390 for ; Fri, 24 Aug 2018 15:01:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BF522CA52 for ; Fri, 24 Aug 2018 15:01:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09F002CA57; Fri, 24 Aug 2018 15:01:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 09BE52CA52 for ; Fri, 24 Aug 2018 15:01:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=F05lJGpa/ep1lbaDSsaJY8Iej03LOI9L7VPpE1NYD1w=; b=eOc RJm/6KX6ysbTs8UcH53Jy/Crx/CKp77rCIbJW3tKB3HHUxcTmxLOK/jpCHuhpQ56wEFMzcmYPh9Gk dEkPl+4FZQfLSghZWY0Vd/SqzIAQqSZ3N4K4Hmvzf1tzIYZ2btcXcpvJQM4dYP8LyyF9iET5DXFLn 8enKvHiQiZzp0CACdqw1p4mT5zqAd+3I6GuiYO+qSXp9ShoY2FZlUIhZP3k3K4keVY8azFJJTW0pa jGBk1rdj/crzuGU0xdtQ6D2CiemuplmVHskEwg21dEPMiUZjClofl1ngpBU+8eQX9WCh6jANh39+h 1cnux1zwEWTTkWJYmMamndoR0JlgQLA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ftDaS-0005Tf-HL; Fri, 24 Aug 2018 15:01:20 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ftD8p-00043M-30 for linux-arm-kernel@bombadil.infradead.org; Fri, 24 Aug 2018 14:32:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=xPTf0SvqKIWY/juVz5G+7Il7OPknYYT68ijESngjej4=; b=J/rX2tDBvJ3yJTLBMl5axl4Zr o5WPZcSJIsrnK9ehLgiDfWww0d7j78d84gQqnseJmSj/1Hrju8saMyUt4GwDDMgulZthH/Lm/MeX6 WK78exg01oYTDR+ZE+aquBp+8Ox3YK1hvCXCs4zUmbFvppSe3FxJ86OpjGZh5FbXpFjGIe6quzOl4 wi9LHwMkztb+yDTauHXVrimYjShb8wrwg8a1dgZl88na44Nzef/6p9nXzrI8GuZPI6To8KNFsOLdu L4WzBjsU+ycUawKSZtOJS5IS/tT8Y/pRSBQIVs/gZ0w4FRJq32HJFIXsTvuHXFSv+cy4u4p0mKTZ5 11iUWDjng==; Received: from foss.arm.com ([217.140.101.70]) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ftCnd-0007AS-0V for linux-arm-kernel@lists.infradead.org; Fri, 24 Aug 2018 14:10:54 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7EA43ED1; Fri, 24 Aug 2018 07:09:02 -0700 (PDT) Received: from approximate.Emea.Arm.com (approximate.emea.arm.com [10.4.13.119]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6EDC73F5BC; Fri, 24 Aug 2018 07:09:01 -0700 (PDT) From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 0/2] arm/arm64: smccc-1.1 fixes Date: Fri, 24 Aug 2018 15:08:28 +0100 Message-Id: <20180824140830.12747-1-marc.zyngier@arm.com> X-Mailer: git-send-email 2.18.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180824_151053_183512_0F36029E X-CRM114-Status: UNSURE ( 8.87 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Catalin Marinas , Julien Grall , Will Deacon , Dave P Martin MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Julien Grall recently reported that our smccc-1.1 helpers suffer from a couple of glaring problems: - the return values are not necessarily of the same type as the input, and we may end-up truncating them - the macros are not safe in the presence of function calls passed as parameters. These two patches are trying to handle that. Note that the current use of these macros in the kernel is safe, so this is not an urgent fix. Marc Zyngier (2): arm/arm64: smccc-1.1: Make return values unsigned long arm/arm64: amccc-1.1: Handle function result as parameters include/linux/arm-smccc.h | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-)