Received: by 10.223.185.116 with SMTP id b49csp388033wrg; Fri, 16 Feb 2018 00:16:50 -0800 (PST) X-Google-Smtp-Source: AH8x225A14xIYTeNKjWDgUi3rzR4Zv30iFFyZ9XtKw6lCyp1o/vQPQ+OiA66Y7VjQ+vzt6HLnR2r X-Received: by 2002:a17:902:a50d:: with SMTP id s13-v6mr5190904plq.191.1518769010402; Fri, 16 Feb 2018 00:16:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518769010; cv=none; d=google.com; s=arc-20160816; b=Z5kFyUQSSCPKefPjLmxVaNAWsyqgmS7UxoClw4ZisZhILMv2GLPeemMpShptYHrITQ w+oQYchBH3gVr/PS7sFWLXCXYTDPHOY5MMkNB2O8oSwtSlBCtmb9OCKXN6aOv0zCxS+x 17Ic9fkc2YlFuTeAmMomlIwMc6INyJFBMZ81ZA7dU1V6RsbnhddE+V8Nghwnwov74sSu eLDwldNS2cp4AnZvbzDRPw2MYsOxlPFc5XJHUxe5tO5WZvdArIunln9fLYzf2sKL286e iwgAYDKexT7l/UfmIr/9JQZqcb8lQ62QhI0ckvUpyiylR6Q5+ntMQVey60jn1CVEFvh6 y8bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=lErbmpuGUm4FXeezRLGdKMo3/VBqIvY4/u5Y6eMeBwM=; b=KP4azVQp1abALIobVD7PkxDT3J1D+Sun1C96b0y4e0HF/A6+pdrRUB2KvvV/jkhmiZ MNYe5JAiOWJhR20RXsnl3+u0K78HSCyYcuyjhUIaSiTpDUv5PXxx9UCRlUmkz/KTx71I RWmiLvc6MFOxplJcJOWyWkfREmtXQQZLaXMPv7I9P9TSYJfmVjJCumpz3bNt4MgFgdZG 03k9eQs3ucXIS3G4b4XS+Sj9YPFxjR+j7sLqwQekVQRZIJYAthomsnwIjLt8hqBQBB6t imXHi9mKxdPkbK/YzzvptYFds6Vq56hkx2RRrm6pVEdi6LiiHUp2/2s7ansynk8WrGxV //fw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k125si1006712pgc.385.2018.02.16.00.16.35; Fri, 16 Feb 2018 00:16:50 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425944AbeBOQaN (ORCPT + 99 others); Thu, 15 Feb 2018 11:30:13 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:33284 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424162AbeBOPm0 (ORCPT ); Thu, 15 Feb 2018 10:42:26 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 3630AF91; Thu, 15 Feb 2018 15:42:25 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Rutland , Will Deacon , Catalin Marinas Subject: [PATCH 4.15 049/202] [Variant 1/Spectre-v1] arm64: barrier: Add CSDB macros to control data-value prediction Date: Thu, 15 Feb 2018 16:15:49 +0100 Message-Id: <20180215151715.780120327@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151712.768794354@linuxfoundation.org> References: <20180215151712.768794354@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Will Deacon Commit 669474e772b9 upstream. For CPUs capable of data value prediction, CSDB waits for any outstanding predictions to architecturally resolve before allowing speculative execution to continue. Provide macros to expose it to the arch code. Reviewed-by: Mark Rutland Signed-off-by: Will Deacon Signed-off-by: Catalin Marinas Conflicts: arch/arm64/include/asm/assembler.h Signed-off-by: Greg Kroah-Hartman --- arch/arm64/include/asm/assembler.h | 7 +++++++ arch/arm64/include/asm/barrier.h | 1 + 2 files changed, 8 insertions(+) --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -109,6 +109,13 @@ .endm /* + * Value prediction barrier + */ + .macro csdb + hint #20 + .endm + +/* * NOP sequence */ .macro nops, num --- a/arch/arm64/include/asm/barrier.h +++ b/arch/arm64/include/asm/barrier.h @@ -32,6 +32,7 @@ #define dsb(opt) asm volatile("dsb " #opt : : : "memory") #define psb_csync() asm volatile("hint #17" : : : "memory") +#define csdb() asm volatile("hint #20" : : : "memory") #define mb() dsb(sy) #define rmb() dsb(ld)