Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4192914pxk; Tue, 8 Sep 2020 13:09:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBbPv4YC9QcxWrVuzjzORR1OYJRm3HQ+Bw/Z2wFJpmuvoJT0H1HEOzCgadXIx4w5ju2rpd X-Received: by 2002:a17:906:2686:: with SMTP id t6mr153038ejc.406.1599595749994; Tue, 08 Sep 2020 13:09:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599595749; cv=none; d=google.com; s=arc-20160816; b=n2EokHRiY/85rOzDCS065D06qye5KdmJ9xF63Hy67R+e7TLs963e7Bh7+c+UwlYcax lnE1F/kMvuvmmcO/Z7Cqf+bLqajLIqN5HOerTRWoq2uK0ZCWjZ9P7dxCHPgaFl6wpHat eRLoYPylTh3h09mPu0voZY+Hq7ZDVvDG8vOykZO576QLq4VOFhaFUEnTz+0B3zo1Iaxo RrvwW2DHBuzHlYdGnivDyZIMyYh711zB9PfwIuSNMYXhdQ47fi6ouM6NA4cbk8rkiCd0 n8yfwCaoMGczzSVmTepsgQEqsrpFnawOGbEOs7/sFP1D5urSdTfbgc59a68xWxg74AeK Gq1g== 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:dkim-signature; bh=x4Jffv0uhOxMnzQ2dJkXMe8lryLf2Vv6NR5aexBXTbM=; b=LYF7gM6JgdW4/Qxmk7Bf5nldqBGSk6Rji3QV8XbQXHO5VkAk1IlW15UbktkcfFxQYI m9GxFnrG8CHN2HHdILjqmzV698oh+fm+wlgtVQg48+S3/Fd/HRjP/wKrPypPrsu86ife NYb3rKXaaEzy8oH+bAoLmBZ6emi0LyghkDkN1vaWbd2K974WT4fdIpuanXzt0hkVEe9L vC31OcOX9p0hA9QaynArAwC4Pg4ZuM+8a3EuBig9BmvQfdiaBnDDf2O5FWaHxlliV9UL SN/e4Hx1DGaffBul4Sn6oHamVg1PV7eP2WydIRtE2Hons8T/WLOC68Ci2mbv69i51cbG Vyww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=J7C9HIbs; 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=pass (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 u2si75091edy.251.2020.09.08.13.08.47; Tue, 08 Sep 2020 13:09:09 -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; dkim=pass header.i=@ibm.com header.s=pp1 header.b=J7C9HIbs; 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=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730174AbgIHUGS (ORCPT + 99 others); Tue, 8 Sep 2020 16:06:18 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:28832 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730302AbgIHPVk (ORCPT ); Tue, 8 Sep 2020 11:21:40 -0400 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 088E2kAB193410; Tue, 8 Sep 2020 10:25:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=x4Jffv0uhOxMnzQ2dJkXMe8lryLf2Vv6NR5aexBXTbM=; b=J7C9HIbsK9YGAOgACeooFH+UVe1aBgntuVegvy+W6cSnCeKK40/okhY6953A0WKMa2sZ lt2aIcurXIbtf3oxmKVDAZ/vBtwjjFE17E/v+fhZ+kStYXO6uAMz3hfkRsvq2JyaD+6a ONkP2+eK2PEba3urt5mzNWHUjT93A/EVyypf96uH5RPbJjWGKUFif5DuAG0YW/efMYVt apTJRC8h5k/l64tiI8OmZ/zVnwkdYwAwfqfOSsDXkOG7nMOQq8XV5KlZu5pgRNYiM/TH gTfjiwpdez5W24QPH3SvVYU2DPKK/n8Q9COlkZMKkt0UkKnbADxbJxmmUs3DxUD/wFJU 6Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 33e9ma4fff-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Sep 2020 10:25:41 -0400 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 088E3g1E196268; Tue, 8 Sep 2020 10:25:40 -0400 Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com with ESMTP id 33e9ma4fbx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Sep 2020 10:25:40 -0400 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 088EPaNB024340; Tue, 8 Sep 2020 14:25:36 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma06fra.de.ibm.com with ESMTP id 33e5gmr7g6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Sep 2020 14:25:36 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 088EO0HG21889504 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 8 Sep 2020 14:24:00 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 69ADBAE053; Tue, 8 Sep 2020 14:25:33 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CC167AE04D; Tue, 8 Sep 2020 14:25:31 +0000 (GMT) Received: from oc3871087118.ibm.com (unknown [9.145.58.21]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 8 Sep 2020 14:25:31 +0000 (GMT) Date: Tue, 8 Sep 2020 16:25:30 +0200 From: Alexander Gordeev To: Christophe Leroy , Michael Ellerman Cc: Gerald Schaefer , Jason Gunthorpe , John Hubbard , Peter Zijlstra , Dave Hansen , linux-mm , Paul Mackerras , linux-sparc , Claudio Imbrenda , Will Deacon , linux-arch , linux-s390 , Vasily Gorbik , Richard Weinberger , linux-x86 , Russell King , Christian Borntraeger , Ingo Molnar , Catalin Marinas , Andrey Ryabinin , Heiko Carstens , Arnd Bergmann , Jeff Dike , linux-um , Borislav Petkov , Andy Lutomirski , Thomas Gleixner , linux-arm , linux-power , LKML , Andrew Morton , Linus Torvalds , Mike Rapoport Subject: Re: [RFC PATCH v2 2/3] mm: make pXd_addr_end() functions page-table entry aware Message-ID: <20200908142529.GB20558@oc3871087118.ibm.com> References: <20200907180058.64880-1-gerald.schaefer@linux.ibm.com> <20200907180058.64880-3-gerald.schaefer@linux.ibm.com> <31dfb3ed-a0cc-3024-d389-ab9bd19e881f@csgroup.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <31dfb3ed-a0cc-3024-d389-ab9bd19e881f@csgroup.eu> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-09-08_07:2020-09-08,2020-09-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 bulkscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 impostorscore=0 clxscore=1015 phishscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009080133 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 08, 2020 at 07:14:38AM +0200, Christophe Leroy wrote: [...] > You forgot arch/powerpc/mm/book3s64/subpage_prot.c it seems. If this one would be okay? diff --git a/arch/powerpc/mm/book3s64/subpage_prot.c b/arch/powerpc/mm/book3s64/subpage_prot.c index 60c6ea16..3690d22 100644 --- a/arch/powerpc/mm/book3s64/subpage_prot.c +++ b/arch/powerpc/mm/book3s64/subpage_prot.c @@ -88,6 +88,7 @@ static void hpte_flush_range(struct mm_struct *mm, unsigned long addr, static void subpage_prot_clear(unsigned long addr, unsigned long len) { struct mm_struct *mm = current->mm; + pmd_t *pmd = pmd_off(mm, addr); struct subpage_prot_table *spt; u32 **spm, *spp; unsigned long i; @@ -103,8 +104,8 @@ static void subpage_prot_clear(unsigned long addr, unsigned long len) limit = addr + len; if (limit > spt->maxaddr) limit = spt->maxaddr; - for (; addr < limit; addr = next) { - next = pmd_addr_end(addr, limit); + for (; addr < limit; addr = next, pmd++) { + next = pmd_addr_end(*pmd, addr, limit); if (addr < 0x100000000UL) { spm = spt->low_prot; } else { @@ -191,6 +192,7 @@ static void subpage_mark_vma_nohuge(struct mm_struct *mm, unsigned long addr, unsigned long, len, u32 __user *, map) { struct mm_struct *mm = current->mm; + pmd_t *pmd = pmd_off(mm, addr); struct subpage_prot_table *spt; u32 **spm, *spp; unsigned long i; @@ -236,8 +238,8 @@ static void subpage_mark_vma_nohuge(struct mm_struct *mm, unsigned long addr, } subpage_mark_vma_nohuge(mm, addr, len); - for (limit = addr + len; addr < limit; addr = next) { - next = pmd_addr_end(addr, limit); + for (limit = addr + len; addr < limit; addr = next, pmd++) { + next = pmd_addr_end(*pmd, addr, limit); err = -ENOMEM; if (addr < 0x100000000UL) { spm = spt->low_prot; Thanks! > Christophe