Received: by 10.192.165.156 with SMTP id m28csp233732imm; Tue, 17 Apr 2018 09:14:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx48iZJVTawk9MjlZN99GpdPHZE8Aw2PXwORg91nkvAhCPtst/j9x1aICPl8u0RFs3h6f/rQD X-Received: by 10.99.6.66 with SMTP id 63mr2308190pgg.10.1523981660712; Tue, 17 Apr 2018 09:14:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523981660; cv=none; d=google.com; s=arc-20160816; b=aoiivFyFz/bEJF97TAoyPzd80lgjK+ZNxfrH6jpzTY4f/9wtdbfSlOo0ZO1zfSa94p b8G+NmVeupGPEfwfKJM+qf12Q01NioeVZoWxa9daRZ3bvlSxN04/7KV/rjVUwRUuYltF n2HO7WAMhbb2bBFIb6Hu669/qB+U/jIJbO58D444DSaQq1m36YHmWbg6kpTFHcCPXFVZ WotXZwokjSrk8AVKgznR5nKiVEdAgU7i+dfUqceLpdhRknXjwadxTljwRWtCBfBcZYx8 xc7+xEB+IUYeVAcM1KQgtdH16Cr1i65RiHFp5v+TeeVn7P0P/6C6woFwxeKRei2zCNGk JfjQ== 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=I8PygovQDsuPNY0pIM8/RnCYTZ+ZuKDsp3FBHHhP2zE=; b=PJoQgBLSWdPMblgnx2L4fgGAjfmvFQInsb0czb4Pkk8uU7OVTAYquwyZ21nog9AkAe 7e+8bE7li+KeR6OPAbBq/dJKje9yVMVeYfpjPsDMGz+jJ9u9MmH2Jq+46CrAivJx6bxe 9APJqhxSN1oy5K3qbOmYisP2bp+ET2vrJPoCCgn9XMNhMNOdz8wqPTBGTazXQdFpdGjP MuWF6wQeMUGSlfOEc8Ci9bMoASgB+u3ZZym1X69sKICsK0ZnqS/1ODHOmKLCKooeguU8 HijuzBh84nI20XG+FLb0GCpeJJYn/nK8u9eLVZSnEAvULtW+QxkhB6wDfx4qyumeLT8G P4Fw== 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 k189si3254108pgc.388.2018.04.17.09.14.06; Tue, 17 Apr 2018 09:14:20 -0700 (PDT) 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 S932149AbeDQQMV (ORCPT + 99 others); Tue, 17 Apr 2018 12:12:21 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36802 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755298AbeDQQMT (ORCPT ); Tue, 17 Apr 2018 12:12:19 -0400 Received: from localhost (unknown [46.44.180.42]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 39337DE5; Tue, 17 Apr 2018 16:12:19 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Mark Rutland , Will Deacon , Catalin Marinas , Greg Hackmann Subject: [PATCH 4.9 10/66] arm64: barrier: Add CSDB macros to control data-value prediction Date: Tue, 17 Apr 2018 17:58:43 +0200 Message-Id: <20180417155646.280705889@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180417155645.868055442@linuxfoundation.org> References: <20180417155645.868055442@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mark Rutland From: Will Deacon commit 669474e772b952b14f4de4845a1558fd4c0414a4 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 Signed-off-by: Mark Rutland Signed-off-by: Greg Kroah-Hartman --- arch/arm64/include/asm/assembler.h | 7 +++++++ arch/arm64/include/asm/barrier.h | 2 ++ 2 files changed, 9 insertions(+) --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -87,6 +87,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 @@ -31,6 +31,8 @@ #define dmb(opt) asm volatile("dmb " #opt : : : "memory") #define dsb(opt) asm volatile("dsb " #opt : : : "memory") +#define csdb() asm volatile("hint #20" : : : "memory") + #define mb() dsb(sy) #define rmb() dsb(ld) #define wmb() dsb(st)