Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp643935ybl; Wed, 4 Dec 2019 08:34:53 -0800 (PST) X-Google-Smtp-Source: APXvYqyzkTXOZrbR1pnTCdw/MTJQq16mP021pa0AEfhKTO6Lc6n/ghq/OoigzASV544Q0IoIqV3Y X-Received: by 2002:aca:52c4:: with SMTP id g187mr3343237oib.76.1575477293698; Wed, 04 Dec 2019 08:34:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575477293; cv=none; d=google.com; s=arc-20160816; b=IlDovu5zlpW/oaSc21FqQWzcFGzubr5VSJ7pzJS4xB9IL0FMe/AWH0duaX/h/pvM+Q oIV3Xs+bp1Fz9HHTaWgTI18lJzKNABncxe4TX4f2QCLtIw2wQ14ZvcBl9mKUeHp5OWDH iiEcDovtSouhNsmF+r8AnRmeTijTL7U6jq7Td1tp4QSQTNc6NfstbcKLVmzy+qNrhXVG AN+iOLsu4A92AiDnaqakJuStYUWy7LThkWxTN6H1yJ0HhhgH0SfusfQbwXNbsXW4zYwA 5ksnysX+RcuS/V40eR3fnMIPW83vAuE/oHPeOMfzDJ+jBjRsiGBbV9BGmQWuB2gtKUn7 PZJg== 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; bh=6VutbRxMDeo7DK0kVET+JRwi0PCKNLpFuUeTlmGmviY=; b=0H1b3TQLzj2F2nIBCJ3MjCj02lh50+ZsXYyg/LEOi85wGKpT2b2P90AcfSkFxOwW4w sKIV+koialcXYC9JbnsM5sRXk8IeSny/SDGZNNR34xBQvlsJWI5YfxTZn8UQDpAcxR2i fj2COmdHIPXw9BV6FV2KJgdubMT+8o0/OnYbgcsATllYGhDkp1qOGtiRJ8rWlY92SvDB 2qBPWzBUCb8qHYQ1+5zwSLb7WqNVJrftMa1Qsbyc253KzM4JC/uQe2v785F4B0FEWbkh 9M1CqrnCUvAQkBPQB9W9oGVarzT3TjLMbw8Nu62Tx5nLfFYAZhafXyNTmJ4yMmuVIls0 L4gQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z62si3304592oiz.206.2019.12.04.08.34.41; Wed, 04 Dec 2019 08:34:53 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728712AbfLDQco (ORCPT + 99 others); Wed, 4 Dec 2019 11:32:44 -0500 Received: from foss.arm.com ([217.140.110.172]:58606 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728203AbfLDQco (ORCPT ); Wed, 4 Dec 2019 11:32:44 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3168F31B; Wed, 4 Dec 2019 08:32:43 -0800 (PST) Received: from arm.com (e112269-lin.cambridge.arm.com [10.1.194.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6B6333F52E; Wed, 4 Dec 2019 08:32:40 -0800 (PST) Date: Wed, 4 Dec 2019 16:32:35 +0000 From: Steven Price To: David Hildenbrand Cc: Qian Cai , Andrew Morton , Linux-MM , Mark Rutland , the arch/x86 maintainers , Arnd Bergmann , Ard Biesheuvel , Peter Zijlstra , Catalin Marinas , Dave Hansen , "linux-kernel@vger.kernel.org" , =?iso-8859-1?B?Suly9G1l?= Glisse , Ingo Molnar , Borislav Petkov , Andy Lutomirski , "H. Peter Anvin" , James Morse , Thomas Gleixner , Will Deacon , "linux-arm-kernel@lists.infradead.org" , "Liang, Kan" , Thomas Hellstrom Subject: Re: [PATCH v15 00/23] Generic page walk and ptdump Message-ID: <20191204163235.GA1597@arm.com> References: <20191101140942.51554-1-steven.price@arm.com> <1572896147.5937.116.camel@lca.pw> <7B040741-EC8A-4CC0-964B-4046AE2E617A@lca.pw> <16da6118-ac4d-a165-6202-0731a776ac72@arm.com> <911fac4a-2204-f994-a101-16a60fba12e8@redhat.com> <0FA196FD-3FCD-431A-AA3E-21BF00EA07DC@lca.pw> <9d5f1689-db82-a6da-d51d-08070aa4bad5@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9d5f1689-db82-a6da-d51d-08070aa4bad5@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 04, 2019 at 02:56:58PM +0000, David Hildenbrand wrote: > On 04.12.19 15:54, Qian Cai wrote: > > > > > >> On Dec 3, 2019, at 6:02 AM, David Hildenbrand wrote: > >> > >> On 06.11.19 16:05, Steven Price wrote: > >>> On 06/11/2019 13:31, Qian Cai wrote: > >>>> > >>>> > >>>>> On Nov 4, 2019, at 2:35 PM, Qian Cai wrote: > >>>>> > >>>>> On Fri, 2019-11-01 at 14:09 +0000, Steven Price wrote: > >>> [...] > >>>>>> Changes since v14: > >>>>>> https://lore.kernel.org/lkml/20191028135910.33253-1-steven.price@arm.com/ > >>>>>> * Switch walk_page_range() into two functions, the existing > >>>>>> walk_page_range() now still requires VMAs (and treats areas without a > >>>>>> VMA as a 'hole'). The new walk_page_range_novma() ignores VMAs and > >>>>>> will report the actual page table layout. This fixes the previous > >>>>>> breakage of /proc//pagemap > >>>>>> * New patch at the end of the series which reduces the 'level' numbers > >>>>>> by 1 to simplify the code slightly > >>>>>> * Added tags > >>>>> > >>>>> Does this new version also take care of this boot crash seen with v14? Suppose > >>>>> it is now breaking CONFIG_EFI_PGT_DUMP=y? The full config is, > >>>>> > >>>>> https://raw.githubusercontent.com/cailca/linux-mm/master/x86.config > >>>>> > >>>> > >>>> V15 is indeed DOA here. > >>> > >>> Thanks for finding this, it looks like EFI causes issues here. The below fixes > >>> this for me (booting in QEMU). > >>> > >>> Andrew: do you want me to send out the entire series again for this fix, or > >>> can you squash this into mm-pagewalk-allow-walking-without-vma.patch? > >>> > >>> Thanks, > >>> > >>> Steve > >>> > >>> ---8<--- > >>> diff --git a/mm/pagewalk.c b/mm/pagewalk.c > >>> index c7529dc4f82b..70dcaa23598f 100644 > >>> --- a/mm/pagewalk.c > >>> +++ b/mm/pagewalk.c > >>> @@ -90,7 +90,7 @@ static int walk_pmd_range(pud_t *pud, unsigned long addr, unsigned long end, > >>> split_huge_pmd(walk->vma, pmd, addr); > >>> if (pmd_trans_unstable(pmd)) > >>> goto again; > >>> - } else if (pmd_leaf(*pmd)) { > >>> + } else if (pmd_leaf(*pmd) || !pmd_present(*pmd)) { > >>> continue; > >>> } > >>> > >>> @@ -141,7 +141,7 @@ static int walk_pud_range(p4d_t *p4d, unsigned long addr, unsigned long end, > >>> split_huge_pud(walk->vma, pud, addr); > >>> if (pud_none(*pud)) > >>> goto again; > >>> - } else if (pud_leaf(*pud)) { > >>> + } else if (pud_leaf(*pud) || !pud_present(*pud)) { > >>> continue; > >>> } > >>> > >>> > >> > >> Even with this fix, booting for me under QEMU fails. See > >> > >> https://lore.kernel.org/linux-mm/b7ce62f2-9a48-6e48-6685-003431e521aa@redhat.com/ > >> > > > > Yes, for some reasons, this starts to crash on almost all arches here, so it might be worth > > for Andrew to revert those in the meantime while allowing Steven to rework. > > I agree, this produces too much noise. I've bisected this problem and it's a merge conflict with: ace88f1018b8 ("mm: pagewalk: Take the pagetable lock in walk_pte_range()") Reverting that commit "fixes" the problem. That commit adds a call to pte_offset_map_lock(), however that isn't necessarily safe when considering an "unusual" mapping in the kernel. Combined with my patch set this leads to the BUG when walking the kernel's page tables. At this stage I think it's best if Andrew drops my series and I'll try to rework it on top -rc1 fixing up this conflict and the other x86 32-bit issue that has cropped up. Steve