Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6084098ybx; Mon, 11 Nov 2019 03:37:33 -0800 (PST) X-Google-Smtp-Source: APXvYqzbD45di2W+GmubzmdVVY0n3JUuQS010bqJ7l/Ul//rJg49PZ7SyJxyojxm0UVvy5aZ37sK X-Received: by 2002:a50:f096:: with SMTP id v22mr26245843edl.149.1573472253574; Mon, 11 Nov 2019 03:37:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573472253; cv=none; d=google.com; s=arc-20160816; b=js1o7NqPrzHQWU2Oc1k7KtjsBlDLS0y4L+V5Nv7GhRrx8uPEFq0m6V88nDHWbyyXWs JdOvgsDAK//DWxfTcvxL8F4B8OHf8QeTunfDwQ3R3n787yYkIGoiQ9ab/9vjhOWkDXUa lmwlF177/RxJ8nYozoWPZttKNCpX/UPMPnfSsGRwpuXXjxOD94TX+FYyk+ZzvBLCTb8u wKvA6D2grKnb5sCXetzTQWsFG8AVa85I4SW/dUwiI2I1y12mdSug0m68HG3y/75bkf/7 S5Bcz1ZZg2yuGkwjj6cbw95nRlm75hWaY4fIFacW0IGKViOUWg7/5olm1SFMWHHzxqQ7 /L/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=xwQclRlJJ+y/iT/MzVw4rUj6wNxudSlEPyIchJ7+Lj4=; b=1BvSOEbC3b8ibbVO5TeDmkXlL0dLopjE6Rmv5JCqbqcfnr/23wZGPd2wq9irvfsKqA yTdN/VGTRanp/4PWqE/vkmsORtMW3FJI1IJjvx0ZnRWFhbL9XQbTwPPpt72kKNoUkT2V VvVNZcUySI0+r+dKd1YKHHQ2YMslGponId+88TxTczOCfEz46xSRS+W2gzBxxiaYVVZj kwxB5YIyg4+14o+boj/3YhKyYiSO/H+vEvOviSxvBNXO8CS9EsxkQskT05nvYk80Ftr7 DBxW362I6qFkNyy16nC/xC1mwB8vZidxf78lcaxPoX2MeqmrZIHgvfAifxlsRj1rf/ya zrjg== 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 f31si10070447edf.75.2019.11.11.03.37.09; Mon, 11 Nov 2019 03:37:33 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726932AbfKKLds (ORCPT + 99 others); Mon, 11 Nov 2019 06:33:48 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:44400 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726843AbfKKLds (ORCPT ); Mon, 11 Nov 2019 06:33:48 -0500 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id xABBXKFC036678; Mon, 11 Nov 2019 06:33:26 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2w76aq9hhs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 11 Nov 2019 06:33:26 -0500 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id xABBXP3F037122; Mon, 11 Nov 2019 06:33:25 -0500 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 2w76aq9h51-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 11 Nov 2019 06:33:25 -0500 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id xABBUr2o002969; Mon, 11 Nov 2019 11:32:56 GMT Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by ppma04dal.us.ibm.com with ESMTP id 2w5n361psm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 11 Nov 2019 11:32:56 +0000 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xABBWtD454788524 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Nov 2019 11:32:55 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 871B928059; Mon, 11 Nov 2019 11:32:55 +0000 (GMT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 547E028058; Mon, 11 Nov 2019 11:32:50 +0000 (GMT) Received: from skywalker.linux.ibm.com (unknown [9.199.36.163]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 11 Nov 2019 11:32:49 +0000 (GMT) X-Mailer: emacs 26.2 (via feedmail 11-beta-1 Q) From: "Aneesh Kumar K.V" 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 Subject: Re: [PATCH 1/3] powerpc/mm: Initialize the HPTE encoding values In-Reply-To: <20190830120712.22971-2-ldufour@linux.ibm.com> References: <20190830120712.22971-1-ldufour@linux.ibm.com> <20190830120712.22971-2-ldufour@linux.ibm.com> Date: Thu, 12 Sep 2019 19:02:40 +0530 Message-ID: <87v9txzll3.fsf@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-11-11_03:,, 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=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1910280000 definitions=main-1911110109 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Laurent Dufour writes: > 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 We already do this in mmu_psize_set_default_penc() ? > --- > 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); > -- > 2.23.0