Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2237137ybe; Thu, 12 Sep 2019 06:40:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzInNpoGGJ5MgbZrEMfzhzxQz6kWd8DK9Z1tLNkBp/FsHNMxSGNhBXJhP6Q5QJCPkbL3JL/ X-Received: by 2002:a17:906:4890:: with SMTP id v16mr35025062ejq.3.1568295644222; Thu, 12 Sep 2019 06:40:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568295644; cv=none; d=google.com; s=arc-20160816; b=HehPe0F1yNQcxoavGvjdtcLxKV8X/CUbQdlTe+/uvoe+0CaJyeORd1i+JUBnpB3MT7 UsBFEFXPuB7I+W5D+WVlnPPpuKaiDBebQis9FIudU23w0EiuaLOQsBJ0AXn4u45zCBAs x/lRRxI9iQhAZkhoWT7kG1+W6GrcTT3sw4L/LGuesRLR7fu7qNRCT3Lg5P1HRGjrAEmc WmBo/fPsopAE+w4DmlKwjojXexq/H3AZ3kXkZ/VZRxoIqSdzJkngBkJS4Pjb/30Tzbh8 EYSqpGWd8OuUxBuACUhAHq3zdc9IZNnII3XbGHs9xd3HQBikVT6GF43+EvGa8Or4birh fCOA== 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:from:references:cc:to:subject; bh=yh3pwQQ7n+Zuj2TkfDvTsGbi7C/7z3jgSfLiWdgS/Uk=; b=RAyWBSMe9txmeNii0gWxCL79UbyD/YJT3t2XIZqc23xxMzmxDdJIffRSYe0RYql/k8 b+ElenOOfhx0ZsQsczUvujEtFd4VfPaei417DuaPDaurpEZ4Z+6udo7mU6SOMqr5rlMz cAHSY4Rn9EoV3aacztOZnfNVnh/+6nVzT0kKkwLHcmTi1AhIOmdbwLj6pEVw30l6P0Oq ATvQpYdMHMefVwbZBHDF2fyVjdKIlBXvqGZGpzabS6IQ1FGkzlJMaQiSTgXyPuQIAVGK UUa05QbMTMt4xePKzVt5G7pGOVGSMdGKQIVyODdZfYzfeJFTk3fDjlZJoqMuJNg9DVUE q1wQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w1si12077435edr.68.2019.09.12.06.40.19; Thu, 12 Sep 2019 06:40:44 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732147AbfILNhi (ORCPT + 99 others); Thu, 12 Sep 2019 09:37:38 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:32976 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731283AbfILNhi (ORCPT ); Thu, 12 Sep 2019 09:37:38 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8CDXIuL020722; Thu, 12 Sep 2019 09:37:20 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uyp6qt5vb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Sep 2019 09:37:19 -0400 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x8CDZHn7027303; Thu, 12 Sep 2019 09:37:19 -0400 Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 2uyp6qt5u7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Sep 2019 09:37:19 -0400 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x8CDYS2x024731; Thu, 12 Sep 2019 13:37:17 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma03dal.us.ibm.com with ESMTP id 2uv468xvaw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Sep 2019 13:37:17 +0000 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8CDbGY562128512 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Sep 2019 13:37:16 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 856C2136059; Thu, 12 Sep 2019 13:37:16 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1B4A8136051; Thu, 12 Sep 2019 13:37:14 +0000 (GMT) Received: from [9.199.32.243] (unknown [9.199.32.243]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 12 Sep 2019 13:37:13 +0000 (GMT) Subject: Re: [PATCH 1/3] powerpc/mm: Initialize the HPTE encoding values To: Laurent Dufour , mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, npiggin@gmail.com Cc: linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20190830120712.22971-1-ldufour@linux.ibm.com> <20190830120712.22971-2-ldufour@linux.ibm.com> From: "Aneesh Kumar K.V" Message-ID: <527b1a15-e37f-0d76-b999-e22cf04f9f7e@linux.ibm.com> Date: Thu, 12 Sep 2019 19:07:12 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190830120712.22971-2-ldufour@linux.ibm.com> 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:,, definitions=2019-09-12_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909120143 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/30/19 5:37 PM, Laurent Dufour wrote: > Before reading the HPTE encoding values we initialize all of them to -1 (an > invalid value) to later being able to detect the initialized ones. > > Signed-off-by: Laurent Dufour > --- > arch/powerpc/mm/book3s64/hash_utils.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/mm/book3s64/hash_utils.c b/arch/powerpc/mm/book3s64/hash_utils.c > index c3bfef08dcf8..2039bc315459 100644 > --- a/arch/powerpc/mm/book3s64/hash_utils.c > +++ b/arch/powerpc/mm/book3s64/hash_utils.c > @@ -408,7 +408,7 @@ static int __init htab_dt_scan_page_sizes(unsigned long node, > { > const char *type = of_get_flat_dt_prop(node, "device_type", NULL); > const __be32 *prop; > - int size = 0; > + int size = 0, idx, base_idx; > > /* We are scanning "cpu" nodes only */ > if (type == NULL || strcmp(type, "cpu") != 0) > @@ -418,6 +418,11 @@ static int __init htab_dt_scan_page_sizes(unsigned long node, > if (!prop) > return 0; > > + /* Set all the penc values to invalid */ > + for (base_idx = 0; base_idx < MMU_PAGE_COUNT; base_idx++) > + for (idx = 0; idx < MMU_PAGE_COUNT; idx++) > + mmu_psize_defs[base_idx].penc[idx] = -1; > + > pr_info("Page sizes from device-tree:\n"); > size /= 4; > cur_cpu_spec->mmu_features &= ~(MMU_FTR_16M_PAGE); > @@ -426,7 +431,6 @@ static int __init htab_dt_scan_page_sizes(unsigned long node, > unsigned int slbenc = be32_to_cpu(prop[1]); > unsigned int lpnum = be32_to_cpu(prop[2]); > struct mmu_psize_def *def; > - int idx, base_idx; > > size -= 3; prop += 3; > base_idx = get_idx_from_shift(base_shift); > We already do this in mmu_psize_set_default_penc() ? -aneesh