From patchwork Thu Mar 1 12:54:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Shi X-Patchwork-Id: 10251349 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 C2AF4602B5 for ; Thu, 1 Mar 2018 13:24:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B05DA1FFF9 for ; Thu, 1 Mar 2018 13:24:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A431D20134; Thu, 1 Mar 2018 13:24:23 +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 834AE1FFF9 for ; Thu, 1 Mar 2018 13:24:22 +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=HYhJGi7u8udfIT65t/1BrEeuTr6DYDjUGOH+CHWV9Ao=; b=iUrp98SZqGtspvrLRRODnQbaTJ MrpIynmH+QaI4YF2ESI0HG7FVgmIAUgW3aPCyaD2Mm0CtefX8HiTdIfCAaHqIwAJgd09KIzsfocYI /qJt0VLEllknhi9AHO7Vn1v57P0T8ZGKd6urR2qH4PTDJ9yY8C83TiI5ps75l1OiYh+3RkvM/C9vk hoWS7N1YYJGjnA+CgfLljZWRYRfFAO+Il07KunePagZahTU362zL/CCpguMD8jpQoiabl8p8PKoV9 a+ivDfmdPIhzHg1g2fpUxoWrZFtYuUSPvbOM+jaNLxoPLhOu42YHONPPNnABc222u6DEpSIZ8IBr9 VPfgVQ6A==; 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 1erOBv-0005rJ-7t; Thu, 01 Mar 2018 13:24:11 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1erNpd-0005L0-N6 for linux-arm-kernel@lists.infradead.org; Thu, 01 Mar 2018 13:02:46 +0000 Received: by mail-pf0-x244.google.com with SMTP id q13so2415191pff.0 for ; Thu, 01 Mar 2018 05:00:59 -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=xjpJ8k7CKNbvTvoCWi2+8tjs1SrG8L5eeUCBFmDTG3o=; b=ULhcJObd7hh6GHhVGPDcF1aqBB2fpD46RptqYqg6FZVnAxO64acvPhAp+B82sOpc9N W1brkOsZBelO139nXlzRrF5YP/oQAuK+c1zwqf8/PA/+1k0AuaTsk51RhO37DC+kdxEs 0jD5orIB1QIJ3OBDgSaqE1zcz686DGtNsBDgc= 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=xjpJ8k7CKNbvTvoCWi2+8tjs1SrG8L5eeUCBFmDTG3o=; b=N0U/ekPSTJEG/1yarvwEXc6iUD+D0XjmptExrlZq5qX+4s0eqVZwLY/1s/zabj02l2 tM6nBOh/lTHlQ18ocKZ4OWD990+BtxNuXkDCawHU91KD883o5stMNcyPQQFGiNE+AfD+ dq4GEN0gmqkbGe0S2qtYjbQ3CAIjDC52tqSr7MUbUT4epumjVUtj3m8Mjg/ZJ6Mgiqro 26rmD91gs8pI4v/piqBoi0mcqqOE+/npAeVW3px0NbciPbxmSsSH9yiujbkM8IzAwMt7 iKmdpDlboMcuLGyv4cxuWArwACky+f8oRshAgCjjr32NdC29ik7KG7ddAfuhY5LEJdRJ frBA== X-Gm-Message-State: APf1xPBcGUp3yrt/8IgMUr7YZF6NdSvXlUm4qZuvTVOcyLqMH90Fv7po r6PVRg3+ZyxIpwQ3h5W88i/hJw== X-Google-Smtp-Source: AG47ELtk5UIblqE4EjZZZmblxyUl0egcP/ETuZdAP2NsG4qBYpoepQrn4DXTcsQu6PMQDGoCf3OtFA== X-Received: by 10.101.92.66 with SMTP id v2mr1482378pgr.341.1519909256952; Thu, 01 Mar 2018 05:00:56 -0800 (PST) Received: from localhost.localdomain (176.122.172.82.16clouds.com. [176.122.172.82]) by smtp.gmail.com with ESMTPSA id x4sm2289655pfb.46.2018.03.01.05.00.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Mar 2018 05:00:56 -0800 (PST) From: Alex Shi To: Marc Zyngier , Will Deacon , Ard Biesheuvel , Catalin Marinas , stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 42/45] arm/arm64: smccc: Make function identifiers an unsigned quantity Date: Thu, 1 Mar 2018 20:54:19 +0800 Message-Id: <1519908862-11425-43-git-send-email-alex.shi@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519908862-11425-1-git-send-email-alex.shi@linaro.org> References: <1519908862-11425-1-git-send-email-alex.shi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180301_050110_950886_EFCBC9F1 X-CRM114-Status: GOOD ( 12.08 ) 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 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 e1ef944..dd44d84 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