From patchwork Fri Mar 9 09:07:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 10270229 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E4BCD6016D for ; Fri, 9 Mar 2018 09:36:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFA7929DA2 for ; Fri, 9 Mar 2018 09:36:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D458529DA4; Fri, 9 Mar 2018 09:36:03 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID 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 5A1A229DA8 for ; Fri, 9 Mar 2018 09:36:03 +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:References: In-Reply-To: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:List-Owner; bh=/SO1SbkE+LayXTcQxz5yhfwRWZTMkpdALP6/ffmo/Hc=; b=NLi3zWIepN8GkfVLjJGk7OFKcv np+3kCRYvp8f15md17l+wonpLYbfC8IruMLo/YoX3aIcXbRM90OFpaw/HUYWNi+W8r42a7HLlMnNf rAI8Kmikg6FUixvQ5SlLAKvL4Le0y4srzTtCAdvN4woHbcqjV8IjuzAQMPqTBGHeNY0KsgCztupxl r5eAzm8CAMWbOIlZUKveF2CFPb9d7TUSnU9OVCgAr92tCxMfCxIkcJdMNJY8ehSLn1ZQJ0e/XvyDv nC1goCEbBfstKmQHJb7mAd+l9C4SOz2HkH7kh7F6ZXscA90D6L4EWYGi8ZwogHs6S15ehCWyFxg7z iV79842g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1euERP-0006OR-6T; Fri, 09 Mar 2018 09:35:55 +0000 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1euE4r-0006tW-R7 for linux-arm-kernel@lists.infradead.org; Fri, 09 Mar 2018 09:14:09 +0000 Received: by mail-pl0-x243.google.com with SMTP id w22-v6so4938820pll.2 for ; Fri, 09 Mar 2018 01:12:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lnOIPJhNibngwtNhM1LFwTHZX3s8yCuRtOtFqUyLiT0=; b=QoHvMeqWA6g9S9iav3ytV7N0PSWvC8uIN1hXlwBS8pblozDmOSX6Ik4Ywy6HGkjwTw AP6vym0PtYbuzNr4ptHEfoXmobYNlGoXcdjvLMwDVRRwR+CXoOrLefqA/5g16Y2A99Wz jPa7nnY0FLhJrER54n10jquTTjrfj/P30FuU0= 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:in-reply-to :references; bh=lnOIPJhNibngwtNhM1LFwTHZX3s8yCuRtOtFqUyLiT0=; b=D6fR/e+zIQJUUZzTy0r35Z5a/yTJNESdWvIVPLoYmV8877TSbLPEUpfegbr5MIRd3k McKaSFrTEUUbNtJlNTZQKOIrPyet+CFqUMUfrLg0EU0j+Y2qoOxqVY9nJD8TAgE4h+ML ggbi2nuWCpGnbIaZJU+jUhRP9wEwGWpMHDS58k/aicNFQYJ/i/kFFBk4TsW5Z8e+hb8N cxeB9iTpjg2BQlFqEh7LAlt6lzvXerP0HnvHuc/8UUVQyEogWVOmwYfqxty2mwCCGuqa 5I6AOsRg6NbB1m59JWYuDkVKWOENY+XTPIDUPXqOkkHlKaSEebBzBWkxCiu6phUS0Osc /NwQ== X-Gm-Message-State: APf1xPBcTAYmjpDUrih3fh63Ahd4clNqGz0kGti91Aca0m6FzEprGNaE LdbwanJ/FuaA7HcF7cXrBJzXDg== X-Google-Smtp-Source: AG47ELsrM8VUFMxr7/huJKNsYVJ8XjALUdrdCr+WHsiLzQAGZAvdLsauLYXNe0JWQZpsufs7993wgA== X-Received: by 2002:a17:902:3383:: with SMTP id b3-v6mr27458401plc.224.1520586747214; Fri, 09 Mar 2018 01:12:27 -0800 (PST) Received: from localhost.localdomain (176.122.172.82.16clouds.com. [176.122.172.82]) by smtp.gmail.com with ESMTPSA id c7sm1961752pfg.36.2018.03.09.01.12.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 01:12:26 -0800 (PST) From: Alex Shi To: Marc Zyngier , Will Deacon , Ard Biesheuvel , Catalin Marinas , broonie@linaro.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 37/39] arm/arm64: smccc: Make function identifiers an unsigned quantity Date: Fri, 9 Mar 2018 17:07:20 +0800 Message-Id: <20180309090722.26279-38-alex.shi@linaro.org> X-Mailer: git-send-email 2.16.2.440.gc6284da In-Reply-To: <20180309090722.26279-1-alex.shi@linaro.org> References: <20180309090722.26279-1-alex.shi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180309_011238_417915_7D9007F2 X-CRM114-Status: GOOD ( 12.19 ) 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: Alex Shi , stable@vger.kernel.org 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 From: Marc Zyngier commit ded4c39e93f3 upstream. Function identifiers are a 32bit, unsigned quantity. But we never tell so to the compiler, resulting in the following: 4ac: b26187e0 mov x0, #0xffffffff80000001 We thus rely on the firmware narrowing it for us, which is not always a reasonable expectation. Cc: stable@vger.kernel.org Reported-by: Ard Biesheuvel Acked-by: Ard Biesheuvel Reviewed-by: Robin Murphy Tested-by: Ard Biesheuvel Signed-off-by: Marc Zyngier Signed-off-by: Catalin Marinas Signed-off-by: Will Deacon Signed-off-by: Alex Shi --- include/linux/arm-smccc.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h index e7a439454950..e857670a8e01 100644 --- a/include/linux/arm-smccc.h +++ b/include/linux/arm-smccc.h @@ -14,14 +14,16 @@ #ifndef __LINUX_ARM_SMCCC_H #define __LINUX_ARM_SMCCC_H +#include + /* * This file provides common defines for ARM SMC Calling Convention as * specified in * http://infocenter.arm.com/help/topic/com.arm.doc.den0028a/index.html */ -#define ARM_SMCCC_STD_CALL 0 -#define ARM_SMCCC_FAST_CALL 1 +#define ARM_SMCCC_STD_CALL _AC(0,U) +#define ARM_SMCCC_FAST_CALL _AC(1,U) #define ARM_SMCCC_TYPE_SHIFT 31 #define ARM_SMCCC_SMC_32 0