Received: by 10.223.185.116 with SMTP id b49csp3830650wrg; Mon, 19 Feb 2018 06:44:33 -0800 (PST) X-Google-Smtp-Source: AH8x226I6sCuV1kBcHCEdkDTz+SLmrq96XTPXkQZk+BB4z5R6J5VJ3P1ZOFsYtPty6ZlkExyC7eV X-Received: by 10.101.67.71 with SMTP id k7mr12436809pgq.136.1519051472926; Mon, 19 Feb 2018 06:44:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519051472; cv=none; d=google.com; s=arc-20160816; b=U09u90krCoojEk0SRkrzeDSIEjG1pMkMnJ84drSYzzgVg0AlX90AhioFT7j69lnTz0 q4wt6vfMGZMig43wZgdDydQjKw58hUJF+Mjb/WBlhbmXu+0rCQryLWC6230vJbXVEwk8 cEUlPvghm9Jzi0lfefM77CIhh3x40e5+ejRKmGIlkr8gWinHWR7vwo9HqZy5hnEYOjjn W7QWh1/qMpSNtqPHlI0PYYGEiLpWUx3qwQ7dGkpZGbWUCEBxfxSF54HBnZM8frbWfeSM lxWWCpBhF8H4Fs5GaC2LMG/Pwzjr0vn/P9Mj2G9XcnCzTLL6D6+lvuyH6hqmV7u6IRe2 bwHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=8ZRupDBUVIps03Uat8VLpAIc1IXyU+tfpqo4aVCsEKo=; b=t2VWY6zYbOaZ8ljWE+nK1FE973s+hqQdPQstSPvtucFJV1OaxHcNApC3pR52+bgdAH EhYF4a8DKRLQGpL/CQVKIzjQQSj4gVBIWyi3uBvHLsbZ4g54x9UTnxSsTKpSoTo8JPhr bWCu2FayI0JWlF1qA2rFw8tA89t48bpYfqnos7w38NkAlkmAZw4bg8+tvTef3zbBtMwD IjGRHvRdYhEYpoQIQUjtv4xbQnpCvzCE0i3ObmGiuB2NGIMbNLl+2DB1L9WYqilWYt25 2Q6StBh1Ip9b1XF0mYOvrY1KYFeINKaXP0wU4wxfoWslbqFQkYNmDK33AKjlaK6Wkpfl AlQw== 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 p1si63779pgc.593.2018.02.19.06.44.17; Mon, 19 Feb 2018 06:44:32 -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 S1752772AbeBSOnj (ORCPT + 99 others); Mon, 19 Feb 2018 09:43:39 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:60012 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752313AbeBSOni (ORCPT ); Mon, 19 Feb 2018 09:43:38 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F3E361529; Mon, 19 Feb 2018 06:43:37 -0800 (PST) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C56153F41F; Mon, 19 Feb 2018 06:43:37 -0800 (PST) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id B3BDB1AE11BC; Mon, 19 Feb 2018 14:43:46 +0000 (GMT) Date: Mon, 19 Feb 2018 14:43:46 +0000 From: Will Deacon To: Shanker Donthineni Cc: linux-kernel , linux-arm-kernel , Catalin Marinas , kvmarm , Marc Zyngier , Vikram Sethi , Philip Elcan Subject: Re: [PATCH] arm64: Add support for new control bits CTR_EL0.IDC and CTR_EL0.IDC Message-ID: <20180219144346.GF30394@arm.com> References: <1518829066-3558-1-git-send-email-shankerd@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1518829066-3558-1-git-send-email-shankerd@codeaurora.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Shanker, On Fri, Feb 16, 2018 at 06:57:46PM -0600, Shanker Donthineni wrote: > Two point of unification cache maintenance operations 'DC CVAU' and > 'IC IVAU' are optional for implementors as per ARMv8 specification. > This patch parses the updated CTR_EL0 register definition and adds > the required changes to skip POU operations if the hardware reports > CTR_EL0.IDC and/or CTR_EL0.IDC. > > CTR_EL0.DIC: Instruction cache invalidation requirements for > instruction to data coherence. The meaning of this bit[29]. > 0: Instruction cache invalidation to the point of unification > is required for instruction to data coherence. > 1: Instruction cache cleaning to the point of unification is > not required for instruction to data coherence. > > CTR_EL0.IDC: Data cache clean requirements for instruction to data > coherence. The meaning of this bit[28]. > 0: Data cache clean to the point of unification is required for > instruction to data coherence, unless CLIDR_EL1.LoC == 0b000 > or (CLIDR_EL1.LoUIS == 0b000 && CLIDR_EL1.LoUU == 0b000). > 1: Data cache clean to the point of unification is not required > for instruction to data coherence. > > Signed-off-by: Philip Elcan > Signed-off-by: Shanker Donthineni > --- > arch/arm64/include/asm/assembler.h | 48 ++++++++++++++++++++++++-------------- > arch/arm64/include/asm/cache.h | 2 ++ > arch/arm64/kernel/cpufeature.c | 2 ++ > arch/arm64/mm/cache.S | 26 ++++++++++++++------- > 4 files changed, 51 insertions(+), 27 deletions(-) I was looking at our CTR_EL0 code last week but forgot to post the patch I wrote fixing up some of the fields. I just send it now, so please can you rebase on top of: http://lists.infradead.org/pipermail/linux-arm-kernel/2018-February/560488.html Also: > diff --git a/arch/arm64/include/asm/cache.h b/arch/arm64/include/asm/cache.h > index ea9bb4e..aea533b 100644 > --- a/arch/arm64/include/asm/cache.h > +++ b/arch/arm64/include/asm/cache.h > @@ -22,6 +22,8 @@ > #define CTR_L1IP_MASK 3 > #define CTR_CWG_SHIFT 24 > #define CTR_CWG_MASK 15 > +#define CTR_IDC_SHIFT 28 > +#define CTR_DIC_SHIFT 29 > > #define CTR_L1IP(ctr) (((ctr) >> CTR_L1IP_SHIFT) & CTR_L1IP_MASK) > > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c > index 29b1f87..f42bb5a 100644 > --- a/arch/arm64/kernel/cpufeature.c > +++ b/arch/arm64/kernel/cpufeature.c > @@ -200,6 +200,8 @@ static int __init register_cpu_hwcaps_dumper(void) > > static const struct arm64_ftr_bits ftr_ctr[] = { > ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_EXACT, 31, 1, 1), /* RAO */ > + ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_DIC_SHIFT, 1, 0), /* DIC */ > + ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_IDC_SHIFT, 1, 0), /* IDC */ > ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_HIGHER_SAFE, 24, 4, 0), /* CWG */ > ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, 20, 4, 0), /* ERG */ > ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, 16, 4, 1), /* DminLine */ Could you update the other table entries here to use the CTR_*_SHIFT values as well? Thanks, Will