From patchwork Fri Nov 8 12:35:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 178898 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp2636534ilf; Fri, 8 Nov 2019 04:36:34 -0800 (PST) X-Google-Smtp-Source: APXvYqzn8BxBu/cevuS9Pw48dzDeqtIYhc/peGZbqAVCsdwWXTyJxaHoU39frzK45l1Lq3/D39y2 X-Received: by 2002:a17:906:948a:: with SMTP id t10mr8467870ejx.110.1573216593916; Fri, 08 Nov 2019 04:36:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573216593; cv=none; d=google.com; s=arc-20160816; b=y40fm29bivZWApFHYwag5MMIzzJu6WYcM6fF1sF6R/0lSSGcxzr3bT9AIiAUHwQzQV LQGPgUwXSVYMqKry92TuH2JCdmxnNhV1Cw3lCTT2KPKRDkeB6O3UuRRhXWqPt8q5+ZNl xIgcj3Vg3/zuxGKXdAh4+HRG/mTJoRbukzgbWbZM5v1jXEkjiya3mgjm2pBy2m0rAaN6 UW1FCaWAwIPKYRmiJKZEVoYDfAB5WjBo1j6y8QnUHsLKUSaiCPGbnsZpzRdERIXT9S7r GkjYilaqR+dHI/BRrgcYbMVot3ZE74m1xyiDhmGzGEBKaywKpJ8Xe2quNTZ9Io/PUaFf T+Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nLqnsvQD+SCON052tKP+P8JtTf/6sIIpHZd8mjnujKI=; b=Nez+1kcX3uDzFZch0JoeJLyfIw/QQounB5aLkS2yatq3PwEX/QGUgz2q0XC/5uHu98 sQuB9Kv3NNbo87cuiwxvncZ6vgRuXx+rlGMMwrNjQuxfXvZCzPzuAM95aCJQyno0AU+j 2Eq37GlUxTQUGYOKvHagiDTzk61NDQ1cl9m6r6wtjQup9tjZ+jlUy6eundnBQdXx+sho xE0oGn4A9LtVNyZAF40Ae3V/1lsabSpqUBxTZlYu4jKxLV6K/Ic+p0dHYC35cVjqbxGr v0aqQw5n14sYhkfaZ31oMVBK47Rv9a0e6A0v71DW25AsHKMLDs164iUu+Lh5wqhExYvm kiDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nxH6mMbo; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o19si3411305ejc.315.2019.11.08.04.36.33; Fri, 08 Nov 2019 04:36:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nxH6mMbo; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726970AbfKHMgd (ORCPT + 14 others); Fri, 8 Nov 2019 07:36:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:44066 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbfKHMgd (ORCPT ); Fri, 8 Nov 2019 07:36:33 -0500 Received: from localhost.localdomain (lfbn-mar-1-550-151.w90-118.abo.wanadoo.fr [90.118.131.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EA823222D1; Fri, 8 Nov 2019 12:36:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573216592; bh=hZ58KCeOpoXgrQzTAjH4w4oy23xL1jI0H0PeVuccAMU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nxH6mMboS0cRp0baXTtWpN7s+hduPTy6a7sTkGDaSVYoC1d8odOxVB9cdF+d2zmcm SMj4iTLybYKd3RJFnf/JVRfb0fBm1zxjsbxwqN4rKaNnhuyVjVJEDsG+KPQAFnxgfb w0PTwJrg+u+HZV+JiCppfLtYdUbsJAa/oUf2I1pc= From: Ard Biesheuvel To: stable@vger.kernel.org Cc: linus.walleij@linaro.org, rmk+kernel@armlinux.org.uk, Mark Rutland , Ard Biesheuvel Subject: [PATCH for-stable-4.4 12/50] arm/arm64: smccc: Make function identifiers an unsigned quantity Date: Fri, 8 Nov 2019 13:35:16 +0100 Message-Id: <20191108123554.29004-13-ardb@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191108123554.29004-1-ardb@kernel.org> References: <20191108123554.29004-1-ardb@kernel.org> MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mark Rutland From: Marc Zyngier commit ded4c39e93f3b72968fdb79baba27f3b83dad34c 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: Mark Rutland [v4.9 backport] Tested-by: Greg Hackmann Signed-off-by: Greg Kroah-Hartman Signed-off-by: Ard Biesheuvel --- include/linux/arm-smccc.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h index f2416b58367d..82e1f3ae4010 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