Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3707462imu; Mon, 28 Jan 2019 09:22:47 -0800 (PST) X-Google-Smtp-Source: ALg8bN4NirHkCZTr17J31+GGesCo54SR9eQAV7L4vPydEZe3T3FIkXJn0OAqRlILNHj1IWgNJZo2 X-Received: by 2002:a62:938f:: with SMTP id r15mr22552388pfk.27.1548696166948; Mon, 28 Jan 2019 09:22:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548696166; cv=none; d=google.com; s=arc-20160816; b=FlgCqsC86Vs9VIfoEgZxTSB0hjsRNDOrkjI08StUbjXFcBLFbRsu6o0h04KrIe6ujF 0baePYhiRvjox2m/qI5b9N5/GjKPjzMI+97Us+ME7SvXh2StlmLAkb978jt/Kyl6u8yn oQMnxuAPtOgEE3qii3i5PPmlKuagEADi+0dFte/0lye8hMz4gWrMbxs4VCk6eXnIcQjT hojIVYYwrOIqrXOctnmQSEXa2kmTrRRpyMNNMzd8X9L9b7290RQHeI9ZXca8Y4EYnM+c 0kAR8OTZmgaTiaNB6Eh6VFjTfBDysICe8dMQ4i4uc319Kk0W8U1JGlEmaLbCd1KYQvN2 VjVg== 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=XmjG+jk0tzR0rHgM/rmdKO3sy/wCp5Lvf7OqwnyRvvA=; b=YrtaFog/E/XuGpsrAjzdR/t4yoJzdmNE69tatRRq4Mx/0tXEqJ3D5xaAKHMmAElI/w GBkzlZ2AJj0BZaeXPI5XznRCkGVLEgiqc9++KsTrDixajdm/uHDMLtjKk9pOUYjxwi9I aTzNm2y7OPlAZf+h3Dcg9iK3LdIQaNWEyI5BSPkT+GJ9xzWMqR9BbKHyAyaxNOkYPFdS 9Wtxs5s2B/8KFgCRtJA1AzgPz/4DTiExY1oRrXTiq+G6XPujaVhfnu8FTXXQp5cQG3Z0 EaxJ+qHYIAXrUXUVmIIPSTn0u9vKiMjk9psmdJ5qQLlRtwRpjhWFnEJuZF3PS9mRIZdP l7Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wzbIkT2a; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 bj2si32786670plb.27.2019.01.28.09.22.31; Mon, 28 Jan 2019 09:22:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=wzbIkT2a; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1731408AbfA1QDb (ORCPT + 99 others); Mon, 28 Jan 2019 11:03:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:48816 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728431AbfA1QD3 (ORCPT ); Mon, 28 Jan 2019 11:03:29 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (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 B13792175B; Mon, 28 Jan 2019 16:03:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691408; bh=TEkgNeXJVm2BYY9sKTJNoUkPb7TZeze7t3q2S7JhTZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wzbIkT2abSX5LelxNKLydLjeklTBQ0L6hMW4Rvu2NWfE9I4ym9g/oGXCYFCdmLpNG OG49DUSVoC8plbitK56J+afYAxs2VX+yr/4vK46NzmOCCsriigHqqzaU6fGWOW5OgE JOuonP6ROGFaaXiH4xt+YaZVGKYcOzCq0YDXUKu0= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Will Deacon , Sasha Levin Subject: [PATCH AUTOSEL 4.19 085/258] arm64: io: Ensure value passed to __iormb() is held in a 64-bit register Date: Mon, 28 Jan 2019 10:56:31 -0500 Message-Id: <20190128155924.51521-85-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Will Deacon [ Upstream commit 1b57ec8c75279b873639eb44a215479236f93481 ] As of commit 6460d3201471 ("arm64: io: Ensure calls to delay routines are ordered against prior readX()"), MMIO reads smaller than 64 bits fail to compile under clang because we end up mixing 32-bit and 64-bit register operands for the same data processing instruction: ./include/asm-generic/io.h:695:9: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths] return readb(addr); ^ ./arch/arm64/include/asm/io.h:147:58: note: expanded from macro 'readb' ^ ./include/asm-generic/io.h:695:9: note: use constraint modifier "w" ./arch/arm64/include/asm/io.h:147:50: note: expanded from macro 'readb' ^ ./arch/arm64/include/asm/io.h:118:24: note: expanded from macro '__iormb' asm volatile("eor %0, %1, %1\n" \ ^ Fix the build by casting the macro argument to 'unsigned long' when used as an input to the inline asm. Reported-by: Nick Desaulniers Reported-by: Nathan Chancellor Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- arch/arm64/include/asm/io.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h index b2bc7dbc1fa6..49bb9a020a09 100644 --- a/arch/arm64/include/asm/io.h +++ b/arch/arm64/include/asm/io.h @@ -119,7 +119,8 @@ static inline u64 __raw_readq(const volatile void __iomem *addr) */ \ asm volatile("eor %0, %1, %1\n" \ "cbnz %0, ." \ - : "=r" (tmp) : "r" (v) : "memory"); \ + : "=r" (tmp) : "r" ((unsigned long)(v)) \ + : "memory"); \ }) #define __iowmb() wmb() -- 2.19.1