Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3220015pxv; Sun, 27 Jun 2021 22:57:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSb3gmVNo44s5pldoFrubF6SSW9BVX3EiRnJnhXXxTEvM1UO38u3M9CpqnsjO1zPdoZIOh X-Received: by 2002:a17:907:6e7:: with SMTP id yh7mr23212609ejb.352.1624859879383; Sun, 27 Jun 2021 22:57:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624859879; cv=none; d=google.com; s=arc-20160816; b=YWMHCBLrKUSdkTazQnEvxR6ck/jcjVO7cnHdELxMW5Giy0jcLvEVT4rUxq5KGBgCYZ vo6kz7OQh1aT4RMUjCl0gCCM3PQ/9EauF+ajHTEXlMJctKBUwvCdirhWS+zauZlcCfyH A70Awc18adva+4Rjt97/q55/UehbgrVx/SocM11da8QigOLOa8m6iOiaietGLmX5PoWl M1cvRTr1lSXeHIgNKPMupnqGI5YLczG7YW0FGu8LKDYgSXYXySGCp6qgJfnYH2aA7viI Um7A4sON8S+Of4+II2lbU7tWATVu2iWaCiBRhwuOmuOdu5XJV1IKitkri0K4Wpt+thnd BjTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=mpavws7t+z+qKrSEXXHp9gkFrFCetkMIeN7/kB5+eDQ=; b=Lrfo/C/MOY3NmOf9a0K/2JQCMCMiBCt6WV82eoYeiFgx13mIihaWB2Jf7owHg2j+sx 5BuQiLF1mU3DQXLbai+hLlDPBKuToVcZ2Cq8TfAxWAZZtpnzi622pND+qlupWBZJOfAV wKd1LoL+uwSYu3v8zZFb6rc4s1m4ry4eRHi/cPcKJ9sX9stMaAUrhn0l0TxVo423UuVF TWom+2P7q56BrCF2qJ08hHleQfTfUu0sI8aiql7sgoD7rGxNE+3yuBfApyATkVMkqbRj JS6wlhNXIwptgPLrqPKW9tc3/qSUoNZKBMEp31NHv7WgnyJypo/NpyAxjCUc8uMJ0KdU /iig== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eo21si12861877ejc.359.2021.06.27.22.57.34; Sun, 27 Jun 2021 22:57:59 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232160AbhF1F6x (ORCPT + 99 others); Mon, 28 Jun 2021 01:58:53 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:60420 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232172AbhF1F6w (ORCPT ); Mon, 28 Jun 2021 01:58:52 -0400 Received: from localhost (mailhub3.si.c-s.fr [192.168.12.233]) by localhost (Postfix) with ESMTP id 4GCxgV1Yc3zBBlp; Mon, 28 Jun 2021 07:56:22 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XDK_m3pCk78b; Mon, 28 Jun 2021 07:56:22 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4GCxgV0d9PzBBgx; Mon, 28 Jun 2021 07:56:22 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id ECF008B776; Mon, 28 Jun 2021 07:56:21 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id QcdPGwq5KisL; Mon, 28 Jun 2021 07:56:21 +0200 (CEST) Received: from [172.25.230.102] (po15451.idsi0.si.c-s.fr [172.25.230.102]) by messagerie.si.c-s.fr (Postfix) with ESMTP id B1C728B763; Mon, 28 Jun 2021 07:56:21 +0200 (CEST) Subject: Re: [PATCH v3] mm: pagewalk: Fix walk for hugepage tables To: Andrew Morton Cc: Steven Price , linux-mm@kvack.org, Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , dja@axtens.net, Oliver O'Halloran , linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <38d04410700c8d02f28ba37e020b62c55d6f3d2c.1624597695.git.christophe.leroy@csgroup.eu> <20210627181226.983d899cc30c02420e1a6af5@linux-foundation.org> From: Christophe Leroy Message-ID: Date: Mon, 28 Jun 2021 07:56:20 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210627181226.983d899cc30c02420e1a6af5@linux-foundation.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 28/06/2021 à 03:12, Andrew Morton a écrit : > On Fri, 25 Jun 2021 05:10:12 +0000 (UTC) Christophe Leroy wrote: > >> Pagewalk ignores hugepd entries and walk down the tables >> as if it was traditionnal entries, leading to crazy result. >> >> Add walk_hugepd_range() and use it to walk hugepage tables. > > More details, please? I assume "crazy result" is userspace visible? > For how long has this bug existed? Is a -stable backport needed? Has > a Fixes: commit been identified? etcetera! > I discovered the problem while porting powerpc to generic page table dump. The generic page table dump uses walk_page_range_novma() . Yes, "crazy result" is that when dumping /sys/kernel/debug/kernel_page_tables, you get random entries because at the time being the pagewalk code sees huge page directories as standard page tables. The bug has always existed as far as I can see, but as no other architectures than powerpc use huge page directories, it only pops up now when powerpc is trying to use that generic page walking code. So I don't think it is worth a backport to -stable, and about a Fixes: tag I don't know. IIUC, hugepd was introduced for the first time in mm by commit cbd34da7dc9a ("mm: move the powerpc hugepd code to mm/gup.c") Before that, hugepd was internal to powerpc. I guess you are asking about Fixes: tag and backporting because of the patch subject. Should I reword the page subject to something like "mm: enable the generic page walk code to walk huge page directories" ?