Received: by 10.223.185.116 with SMTP id b49csp7391136wrg; Thu, 1 Mar 2018 04:56:44 -0800 (PST) X-Google-Smtp-Source: AG47ELtk9EgOqDeDL6UC2IOFwLjrYYfneNrFz+jQkVTsfJgDZey9e6h/aK1wdrdkdaZ0CQAaxhEU X-Received: by 10.101.72.69 with SMTP id i5mr1451015pgs.78.1519909004229; Thu, 01 Mar 2018 04:56:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519909004; cv=none; d=google.com; s=arc-20160816; b=uwSmlMpZuTOrHGussCagtNUbNDDOT2EUAZp2mM44v8yS/+KfAWBDVMlrqHb547PVv+ HyCnYtVIXSg7F3t3W/ZiH1kF/qs6Ne36QpbT9/TJM0RuRIHXpRYDdeAIveAyoneOg4R4 GPuD6Xpin/BdtS5sXuXGRV+GGvOlQ18GAVEbEU7Ddg4jLNy+SwQuetnnA1urT+k6ycsO qX0334nZuJThXLTixro+2L+e2+6SLFUDdqMXu6zd/tZ7r8aALEJSt7waLUKkGQpQOdkI O7yGyI0aVfRys2kV2W2BZCTSPYzwSPJsJlLEKFiqKcTbTPqmr2YmOPDmR7WnUVK8C5j0 aybg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=nelMizWy+r+xl1PA+JMazlupbHfphoojSqCggA1RmD0=; b=y7qFhCG2mLhU9k1mGSv5J8zZ0oZvYM+MkcE8QJSpBo0og7nkPeMrdwKp1hJQ3siE5M KXrcVx4v5ey+malZlRWei3G0atBPImgY6po1ZbucMslAu2cpjrmx//R5VHsF7fg9ix8V siR5ZYbXrcWwDB2n9V2+1H6Tm0svLAdHbfA5R/o0mJxQkj+ARIbs2Y0WpFcXRmYZaQR6 xVix4LES8ZCML0hzDPhPHh44FTOapfAscCWyr/Ku2npPPi9vhpqXv4sq/Ilz+UMQRmOA i98V8bRZOGG64PgV0F7Gw9dKtmjXGe32+PUSIfItrzySHQRMGq82q1AqqFurkOvuDbz8 wiOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e66C1+HX; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 2si2449499pgc.114.2018.03.01.04.56.29; Thu, 01 Mar 2018 04:56:44 -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=@linaro.org header.s=google header.b=e66C1+HX; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030627AbeCAMzg (ORCPT + 99 others); Thu, 1 Mar 2018 07:55:36 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:43043 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030618AbeCAMzc (ORCPT ); Thu, 1 Mar 2018 07:55:32 -0500 Received: by mail-pl0-f67.google.com with SMTP id f23-v6so3581571plr.10 for ; Thu, 01 Mar 2018 04:55:32 -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=nelMizWy+r+xl1PA+JMazlupbHfphoojSqCggA1RmD0=; b=e66C1+HXHngXFMiUjstd+ocmupaazHCvdOBrdx7qoT6x8ORTs1kkR6JPnDxe8n0KC+ sESV0oVwuXo3a8YDGftEZzM9SGaGihMBRJce6ENYnaYpcRuqzRNl3gsMz1aY0qXcbqcP NaTqD67Sj3KeLfEDgnHs6SqsFBVSn4cMevd/Y= 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=nelMizWy+r+xl1PA+JMazlupbHfphoojSqCggA1RmD0=; b=IuMuVG6XpYp2u6cu4xRkb/zMslSO3L28BueN0iy5hyVcwreY/R8Wm9WyeyNW40VfG9 vM3A7MqXq8NcNPf4lRDrjrHLxDaLX8CrxeX0h5hO0v5btX3ryjpcvVkNsOvMCYM0/v3+ SD6sVQTrD92uPwnk/jomO6G/wsyFxvvGPx4iNaj0hv1a7dXnpDg9I13fDkwKVORBEN3P GmRkwF2QBzTo3QQsQMGIMF0f5rVDohjAFvuMlCO2CChPTjhtYxEhLDo0KhuIaGvCpgVR X/yuQPrYWCRLsA9zlk6eDb+NF/cgsMreY6DrYCzn3nyVzfMMryDUXf/4KZKk4j/gm3nL 964g== X-Gm-Message-State: APf1xPCNq19vIzAQiyEzRjvwQim3pobJD1sNFYvBK2NQNcAQmBG2bdNC w4FopmUGSBLefKV3h7z0srhM4w== X-Received: by 2002:a17:902:22f:: with SMTP id 44-v6mr1835471plc.418.1519908931827; Thu, 01 Mar 2018 04:55:31 -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.04.55.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Mar 2018 04:55:31 -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 Cc: Alex Shi Subject: [PATCH 03/45] arm64: barrier: Add CSDB macros to control data-value prediction Date: Thu, 1 Mar 2018 20:53:40 +0800 Message-Id: <1519908862-11425-4-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Alex Shi --- arch/arm64/include/asm/assembler.h | 7 +++++++ arch/arm64/include/asm/barrier.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h index 851290d..8760300 100644 --- 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 diff --git a/arch/arm64/include/asm/barrier.h b/arch/arm64/include/asm/barrier.h index 0fe7e43..c68fdc5 100644 --- 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) -- 2.7.4