Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp522393ybh; Tue, 21 Jul 2020 00:54:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzF6oko/lF9mC4i6n/LfmrgQNM9mw5uDcSh43cMoLq9/MEPREVwgInIPTUgcP6Fw2vdOx1U X-Received: by 2002:a17:906:1a59:: with SMTP id j25mr22886307ejf.398.1595318068976; Tue, 21 Jul 2020 00:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595318068; cv=none; d=google.com; s=arc-20160816; b=dyiA4lJNj+NgU83AIdUPg0MXJtN0VpTJSX6zI3XS8cPeexA5Dq67Hz+eAMvhHdpZWG 0skG3X+G1ylefVzeiICgCJ53uIBybahnLjICJydKFIpn/ntGnWEYBp8IA/Bhuv307eKr hbdHJpM49BfC43NEELTESmahTJDK6+VxIb50BkLM7TvyNKAMAfYoGTsuKKaESfxBBuRj 8anfpBi/3CqZZycVmslzxqPpDpMFWrTvCR/LTxlWSeOTS4FJovqnn+/9T4/tpJUK6vax 0PhaOgi+5c797TfRNFBFz93j88YSxl9aliR3vMzPxEk5B5hH/Hy2GzlQCLBQylWXUvIg G1rA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from; bh=LYYuoSmQ24w63P0UPxKx63KUZwH8LD8f3MU07CDHBAQ=; b=eHShAiff6ENRtJSAkYMeEQ5H45mKW6UjxY6vAieHrLPo2VRbbETk8nNf3VWHSu3Xu7 pLlWT5xSXneD0et6wln77zST/G4VcfYnTdi+W/1pwmzHGejh8AFlW6zFpfkmjqf8K45M L8z3vSSqztvv735Pvgi+dXxeyocZNrKdPBTnwoitJn7MdVzxnvcubgr9URBMWvqv/tnG 7giqp35evWNhSZ80aqjy9qM16vZNNjDZs5zLYFt1oT0xkeo8RCXKxH9OHSwyXtD+h00E QqvLe8BTmDY8GEbN8+aFxBbnMYjb5btisYhP7aw4/56wIAyWcGhdkuLkymRYnV9XeF0F mw0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bk19si12299108ejb.338.2020.07.21.00.54.06; Tue, 21 Jul 2020 00:54:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726633AbgGUHvt (ORCPT + 99 others); Tue, 21 Jul 2020 03:51:49 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:45426 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726389AbgGUHvs (ORCPT ); Tue, 21 Jul 2020 03:51:48 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06L72le6146267; Tue, 21 Jul 2020 03:51:26 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 32dn0xu58e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Jul 2020 03:51:26 -0400 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 06L73TAS148956; Tue, 21 Jul 2020 03:51:25 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 32dn0xu57h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Jul 2020 03:51:25 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 06L7okta007505; Tue, 21 Jul 2020 07:51:23 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma04ams.nl.ibm.com with ESMTP id 32brq83m0g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Jul 2020 07:51:23 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 06L7pK5058392634 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Jul 2020 07:51:20 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6009E4C04A; Tue, 21 Jul 2020 07:51:20 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E39D14C046; Tue, 21 Jul 2020 07:51:16 +0000 (GMT) Received: from [9.199.47.202] (unknown [9.199.47.202]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 21 Jul 2020 07:51:16 +0000 (GMT) From: Ravi Bangoria Subject: Re: [PATCH v4 05/10] powerpc/dt_cpu_ftrs: Add feature for 2nd DAWR To: Jordan Niethe Cc: Michael Ellerman , mikey@neuling.org, apopple@linux.ibm.com, Paul Mackerras , Nicholas Piggin , Christophe Leroy , naveen.n.rao@linux.vnet.ibm.com, peterz@infradead.org, jolsa@kernel.org, oleg@redhat.com, fweisbec@gmail.com, mingo@kernel.org, pedromfc@br.ibm.com, miltonm@us.ibm.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Ravi Bangoria References: <20200717040958.70561-1-ravi.bangoria@linux.ibm.com> <20200717040958.70561-6-ravi.bangoria@linux.ibm.com> Message-ID: Date: Tue, 21 Jul 2020 13:21:16 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-21_02:2020-07-21,2020-07-21 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 clxscore=1015 priorityscore=1501 adultscore=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007210048 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/17/20 11:14 AM, Jordan Niethe wrote: > On Fri, Jul 17, 2020 at 2:10 PM Ravi Bangoria > wrote: >> >> Add new device-tree feature for 2nd DAWR. If this feature is present, >> 2nd DAWR is supported, otherwise not. >> >> Signed-off-by: Ravi Bangoria >> --- >> arch/powerpc/include/asm/cputable.h | 7 +++++-- >> arch/powerpc/kernel/dt_cpu_ftrs.c | 7 +++++++ >> 2 files changed, 12 insertions(+), 2 deletions(-) >> >> diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h >> index e506d429b1af..3445c86e1f6f 100644 >> --- a/arch/powerpc/include/asm/cputable.h >> +++ b/arch/powerpc/include/asm/cputable.h >> @@ -214,6 +214,7 @@ static inline void cpu_feature_keys_init(void) { } >> #define CPU_FTR_P9_TLBIE_ERAT_BUG LONG_ASM_CONST(0x0001000000000000) >> #define CPU_FTR_P9_RADIX_PREFETCH_BUG LONG_ASM_CONST(0x0002000000000000) >> #define CPU_FTR_ARCH_31 LONG_ASM_CONST(0x0004000000000000) >> +#define CPU_FTR_DAWR1 LONG_ASM_CONST(0x0008000000000000) >> >> #ifndef __ASSEMBLY__ >> >> @@ -497,14 +498,16 @@ static inline void cpu_feature_keys_init(void) { } >> #define CPU_FTRS_POSSIBLE \ >> (CPU_FTRS_POWER7 | CPU_FTRS_POWER8E | CPU_FTRS_POWER8 | \ >> CPU_FTR_ALTIVEC_COMP | CPU_FTR_VSX_COMP | CPU_FTRS_POWER9 | \ >> - CPU_FTRS_POWER9_DD2_1 | CPU_FTRS_POWER9_DD2_2 | CPU_FTRS_POWER10) >> + CPU_FTRS_POWER9_DD2_1 | CPU_FTRS_POWER9_DD2_2 | CPU_FTRS_POWER10 | \ >> + CPU_FTR_DAWR1) >> #else >> #define CPU_FTRS_POSSIBLE \ >> (CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | \ >> CPU_FTRS_POWER6 | CPU_FTRS_POWER7 | CPU_FTRS_POWER8E | \ >> CPU_FTRS_POWER8 | CPU_FTRS_CELL | CPU_FTRS_PA6T | \ >> CPU_FTR_VSX_COMP | CPU_FTR_ALTIVEC_COMP | CPU_FTRS_POWER9 | \ >> - CPU_FTRS_POWER9_DD2_1 | CPU_FTRS_POWER9_DD2_2 | CPU_FTRS_POWER10) >> + CPU_FTRS_POWER9_DD2_1 | CPU_FTRS_POWER9_DD2_2 | CPU_FTRS_POWER10 | \ >> + CPU_FTR_DAWR1) > Instead of putting CPU_FTR_DAWR1 into CPU_FTRS_POSSIBLE should it go > into CPU_FTRS_POWER10? > Then it will be picked up by CPU_FTRS_POSSIBLE. I remember a discussion about this with Mikey and we decided to do it this way. Obviously, the purpose is to make CPU_FTR_DAWR1 independent of CPU_FTRS_POWER10 because DAWR1 is an optional feature in p10. I fear including CPU_FTR_DAWR1 in CPU_FTRS_POWER10 can make it forcefully enabled even when device-tree property is not present or pa-feature bit it not set, because we do: { /* 3.1-compliant processor, i.e. Power10 "architected" mode */ .pvr_mask = 0xffffffff, .pvr_value = 0x0f000006, .cpu_name = "POWER10 (architected)", .cpu_features = CPU_FTRS_POWER10, >> #endif /* CONFIG_CPU_LITTLE_ENDIAN */ >> #endif >> #else >> diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c b/arch/powerpc/kernel/dt_cpu_ftrs.c >> index ac650c233cd9..c78cd3596ec4 100644 >> --- a/arch/powerpc/kernel/dt_cpu_ftrs.c >> +++ b/arch/powerpc/kernel/dt_cpu_ftrs.c >> @@ -574,6 +574,12 @@ static int __init feat_enable_mma(struct dt_cpu_feature *f) >> return 1; >> } >> >> +static int __init feat_enable_debug_facilities_v31(struct dt_cpu_feature *f) >> +{ >> + cur_cpu_spec->cpu_features |= CPU_FTR_DAWR1; >> + return 1; >> +} >> + >> struct dt_cpu_feature_match { >> const char *name; >> int (*enable)(struct dt_cpu_feature *f); >> @@ -649,6 +655,7 @@ static struct dt_cpu_feature_match __initdata >> {"wait-v3", feat_enable, 0}, >> {"prefix-instructions", feat_enable, 0}, >> {"matrix-multiply-assist", feat_enable_mma, 0}, >> + {"debug-facilities-v31", feat_enable_debug_facilities_v31, 0}, > Since all feat_enable_debug_facilities_v31() does is set > CPU_FTR_DAWR1, if you just have: > {"debug-facilities-v31", feat_enable, CPU_FTR_DAWR1}, > I think cpufeatures_process_feature() should set it in for you at this point: > if (m->enable(f)) { > cur_cpu_spec->cpu_features |= m->cpu_ftr_bit_mask; > break; > } Yes, that seems a better option. Thanks, Ravi