From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B420CA9EB5 for ; Mon, 4 Nov 2019 19:35:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9B1492089C for ; Mon, 4 Nov 2019 19:35:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=lca.pw header.i=@lca.pw header.b="N+dW478f" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B1492089C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lca.pw Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 33E466B0003; Mon, 4 Nov 2019 14:35:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2C7546B0005; Mon, 4 Nov 2019 14:35:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 141556B0006; Mon, 4 Nov 2019 14:35:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0108.hostedemail.com [216.40.44.108]) by kanga.kvack.org (Postfix) with ESMTP id E8AAF6B0003 for ; Mon, 4 Nov 2019 14:35:51 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 9AE80180AD802 for ; Mon, 4 Nov 2019 19:35:51 +0000 (UTC) X-FDA: 76119600102.23.shock61_15fb71d429d48 X-HE-Tag: shock61_15fb71d429d48 X-Filterd-Recvd-Size: 20708 Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Mon, 4 Nov 2019 19:35:50 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id 15so18796464qkh.6 for ; Mon, 04 Nov 2019 11:35:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=s6fHn8D8g/+CM3zb716GGpSYlFO9CSnt8mb/KoMnVMQ=; b=N+dW478fUUkocTg2edz1NYtK1+JvORRQO4A6gw9YQA1UDng0xUm9bPmX2hqyD1Df8H kvLIgvgLbSx1p+MRzGrZ8rCAV8emMQN5qLhF6HuyEVtKtczydYegpcSF5LaEp2jDlxbw EfuWHX9gZIIEFLe8OwxkHmKqNR1xgmGS0dMVnHNE5r77mGMIvQ61raoKiJjU1eCZlcYV EHxyMCwS0ZnZJmanO8Qm3cHkROQQ1RjEH8D9QJguzLcnktIzhDYF66tTxczh9wTIzYDt gzZodG5Fo4GVZNmyE/1sS7WYYPKP11qdgM/KXD7+bkb8r/npwi6z/ThymNy9pqc0V6XQ aKqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=s6fHn8D8g/+CM3zb716GGpSYlFO9CSnt8mb/KoMnVMQ=; b=fQMvR3bmY0O98hkLBsop7HtSsKjCMu/c6nmSzG/wxt4KdTipfnjX7IYlo15kHAVZ3U 0I1O9RH3jYSEPic+YL8+2hf9GpwcPCBmJtYogtXHzXTJnMY5j0nxTNco3KN1v1Ccspmf w2KBJBRZC2md1Gv0f1s6o9jmJEafGzqMvadmxbQjA7hAGJQgqF4WQYI9GDuQPJ+wQCUs Yvh1V1MWL3uNU7Et3/89ex4SiyYD3R66u79V34Q87N8fh5CCeqSgE2BQ7NAs/Plc1YmS mdo3URX4s1isEvGJlk9qTZQJz3rRsa+M+2G8i6dn5X9DP00ewXD5fNPA1WDKg3QOeviy iofg== X-Gm-Message-State: APjAAAVYRoTBsCxFmUIU7W7Wf0xyJueZKspOeu+wkLupPZAJJvR+tHcN AJ/UlhJm+5+qTmAH5b1nJ6l2nQ== X-Google-Smtp-Source: APXvYqyWl0W2ItouBP+V+7dFZf5/qRiM+6pckVZaokjDz5EIw3v5A/LV2FhCMuVaUaOT3utN4VC7oA== X-Received: by 2002:a37:a18d:: with SMTP id k135mr711588qke.342.1572896150079; Mon, 04 Nov 2019 11:35:50 -0800 (PST) Received: from dhcp-41-57.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id k7sm1453061qkf.40.2019.11.04.11.35.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Nov 2019 11:35:49 -0800 (PST) Message-ID: <1572896147.5937.116.camel@lca.pw> Subject: Re: [PATCH v15 00/23] Generic page walk and ptdump From: Qian Cai To: Steven Price , Andrew Morton , linux-mm@kvack.org Cc: Andy Lutomirski , Ard Biesheuvel , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Dave Hansen , Ingo Molnar , James Morse , =?ISO-8859-1?Q?J=E9r=F4me?= Glisse , Peter Zijlstra , Thomas Gleixner , Will Deacon , x86@kernel.org, "H. Peter Anvin" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Rutland , "Liang, Kan" Date: Mon, 04 Nov 2019 14:35:47 -0500 In-Reply-To: <20191101140942.51554-1-steven.price@arm.com> References: <20191101140942.51554-1-steven.price@arm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 (3.22.6-10.el7) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, 2019-11-01 at 14:09 +0000, Steven Price wrote: > Many architectures current have a debugfs file for dumping the kernel > page tables. Currently each architecture has to implement custom > functions for this because the details of walking the page tables used > by the kernel are different between architectures. >=20 > This series extends the capabilities of walk_page_range() so that it ca= n > deal with the page tables of the kernel (which have no VMAs and can > contain larger huge pages than exist for user space). A generic PTDUMP > implementation is the implemented making use of the new functionality o= f > walk_page_range() and finally arm64 and x86 are switch to using it, > removing the custom table walkers. >=20 > To enable a generic page table walker to walk the unusual mappings of > the kernel we need to implement a set of functions which let us know > when the walker has reached the leaf entry. After a suggestion from Wil= l > Deacon I've chosen the name p?d_leaf() as this (hopefully) describes > the purpose (and is a new name so has no historic baggage). Some > architectures have p?d_large macros but this is easily confused with > "large pages". >=20 > This series ends with a generic PTDUMP implemention for arm64 and x86. >=20 > Mostly this is a clean up and there should be very little functional > change. The exceptions are: >=20 > * arm64 PTDUMP debugfs now displays pages which aren't present (patch 2= 2). >=20 > * arm64 has the ability to efficiently process KASAN pages (which > previously only x86 implemented). This means that the combination of > KASAN and DEBUG_WX is now useable. >=20 > Also available as a git tree: > git://linux-arm.org/linux-sp.git walk_page_range/v15 >=20 > Changes since v14: > https://lore.kernel.org/lkml/20191028135910.33253-1-steven.price@arm.co= m/ > * 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? Su= ppose it is now breaking CONFIG_EFI_PGT_DUMP=3Dy? The full config is, https://raw.githubusercontent.com/cailca/linux-mm/master/x86.config [=C2=A0=C2=A0=C2=A010.550313][=C2=A0=C2=A0=C2=A0=C2=A0T0] Switched APIC r= outing to physical flat. [=C2=A0=C2=A0=C2=A010.563899][=C2=A0=C2=A0=C2=A0=C2=A0T0] ..TIMER: vector= =3D0x30 apic1=3D0 pin1=3D2 apic2=3D-1 pin2=3D-1 [=C2=A0=C2=A0=C2=A010.614633][=C2=A0=C2=A0=C2=A0=C2=A0T0] clocksource: ts= c-early: mask: 0xffffffffffffffff max_cycles: 0x1fa6f481074, max_idle_ns: 440795311917 ns [=C2=A0=C2=A0=C2=A010.625979][=C2=A0=C2=A0=C2=A0=C2=A0T0] Calibrating del= ay loop (skipped), value calculated using timer frequency.. 4391.73 BogoMIPS (lpj=3D21958690) [=C2=A0=C2=A0=C2=A010.635990][=C2=A0=C2=A0=C2=A0=C2=A0T0] pid_max: defaul= t: 131072 minimum: 1024 [=C2=A0=C2=A0=C2=A011.259736][=C2=A0=C2=A0=C2=A0=C2=A0T0] ---[ User Space= ]--- [=C2=A0=C2=A0=C2=A011.263737][=C2=A0=C2=A0=C2=A0=C2=A0T0] 0x0000000000000= 000- 0x0000000000001000=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A04K=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0RW=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0x=C2=A0=C2=A0pte [=C2=A0=C2=A0=C2=A011.266028][=C2=A0=C2=A0=C2=A0=C2=A0T0] 0x0000000000001= 000- 0x0000000000200000=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A02044K=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0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0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0pte [=C2=A0=C2=A0=C2=A011.335990][=C2=A0=C2=A0=C2=A0=C2=A0T0] 0x0000000011200= 000- 0x0000000011800000=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A06M=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0pmd [=C2=A0=C2=A0=C2=A011.346054][=C2=A0=C2=A0=C2=A0=C2=A0T0] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [=C2=A0=C2=A0=C2=A011.354074][=C2=A0=C2=A0=C2=A0=C2=A0T0] BUG: KASAN: wil= d-memory-access in ptdump_pte_entry+0x39/0x60 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0] Read of size 8 = at addr 000f887fee5ff000 by task swapper/0/0 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0] CPU: 0 PID: 0 C= omm: swapper/0 Not tainted 5.4.0-rc5-mm1+ #1 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0] Hardware name: = HPE ProLiant DL385 Gen10/ProLiant DL385 Gen10, BIOS A40 07/10/2019 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0] Call Trace: [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0dump= _stack+0xa0/0xea [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0__ka= san_report.cold.7+0xb0/0xc0 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? no= te_page+0x7f8/0xa70 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? pt= dump_pte_entry+0x39/0x60 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? pt= dump_walk_pgd_level_core+0x1b0/0x1b0 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0kasa= n_report+0x12/0x20 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0__as= an_load8+0x71/0xa0 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0ptdu= mp_pte_entry+0x39/0x60 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0walk= _pgd_range+0xb75/0xce0 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0__wa= lk_page_range+0x206/0x230 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? vm= acache_find+0x3a/0x170 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0walk= _page_range+0x136/0x210 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? __= walk_page_range+0x230/0x230 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? fi= nd_held_lock+0xca/0xf0 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0ptdu= mp_walk_pgd+0x76/0xd0 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0ptdu= mp_walk_pgd_level_core+0x13b/0x1b0 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? hu= getlb_get_unmapped_area+0x5b0/0x5b0 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? tr= ace_hardirqs_on+0x3a/0x160 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? pt= dump_walk_pgd_level_core+0x1b0/0x1b0 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? ef= i_delete_dummy_variable+0xa9/0xd0 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? __= enc_copy+0x90/0x90 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0ptdu= mp_walk_pgd_level+0x15/0x20 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0efi_= dump_pagetable+0x35/0x37 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0efi_= enter_virtual_mode+0x72a/0x737 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0star= t_kernel+0x607/0x6a9 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? th= read_stack_cache_init+0xb/0xb [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? id= t_setup_from_table+0xd9/0x130 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0x86_= 64_start_reservations+0x24/0x26 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0x86_= 64_start_kernel+0xf4/0xfb [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0seco= ndary_startup_64+0xb6/0xc0 [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [=C2=A0=C2=A0=C2=A011.355975][=C2=A0=C2=A0=C2=A0=C2=A0T0] Disabling lock = debugging due to kernel taint [=C2=A0=C2=A0=C2=A011.355991][=C2=A0=C2=A0=C2=A0=C2=A0T0] general protect= ion fault: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN NOPTI [=C2=A0=C2=A0=C2=A011.364049][=C2=A0=C2=A0=C2=A0=C2=A0T0] CPU: 0 PID: 0 C= omm: swapper/0 Tainted: G=C2=A0=C2=A0=C2=A0=C2=A0B=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A05.4.0-rc5-mm1+ #1 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0] Hardware name: = HPE ProLiant DL385 Gen10/ProLiant DL385 Gen10, BIOS A40 07/10/2019 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0] RIP: 0010:ptdum= p_pte_entry+0x39/0x60 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0] Code: 55 41 54 = 49 89 fc 48 8d 79 18 53 48 89 cb e8 5e 0e fa ff 48 8b 5b 18 48 89 df e8 52 0e fa ff 4c 89 e7 4c 8b 2b e8 47 0e fa f= f <49> 8b 0c 24 4c 89 f6 48 89 df ba 05 00 00 00 e8 03 1d 9b 00 31 c0 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0] RSP: 0000:fffff= fffaf8079d0 EFLAGS: 00010282 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0] RAX: 0000000000= 000000 RBX: ffffffffaf807cf0 RCX: ffffffffae374306 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0] RDX: 0000000000= 000007 RSI: dffffc0000000000 RDI: ffffffffafef2bf4 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0] RBP: ffffffffaf= 8079f0 R08: fffffbfff5fdbb22 R09: fffffbfff5fdbb22 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0] R10: fffffbfff5= fdbb21 R11: ffffffffafedd90b R12: 000f887fee5ff000 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0] R13: ffffffffae= 2aee40 R14: 0000000011a00000 R15: 0000000011a01000 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0] FS:=C2=A0=C2=A0= 0000000000000000(0000) GS:ffff888843400000(0000) knlGS:0000000000000000 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0] CS:=C2=A0=C2=A0= 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0] CR2: ffff889077= 9ff000 CR3: 0000000baf412000 CR4: 00000000000406b0 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0] Call Trace: [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0walk= _pgd_range+0xb75/0xce0 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0__wa= lk_page_range+0x206/0x230 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? vm= acache_find+0x3a/0x170 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0walk= _page_range+0x136/0x210 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? __= walk_page_range+0x230/0x230 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? fi= nd_held_lock+0xca/0xf0 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0ptdu= mp_walk_pgd+0x76/0xd0 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0ptdu= mp_walk_pgd_level_core+0x13b/0x1b0 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? hu= getlb_get_unmapped_area+0x5b0/0x5b0 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? tr= ace_hardirqs_on+0x3a/0x160 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? pt= dump_walk_pgd_level_core+0x1b0/0x1b0 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? ef= i_delete_dummy_variable+0xa9/0xd0 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? __= enc_copy+0x90/0x90 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0ptdu= mp_walk_pgd_level+0x15/0x20 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0efi_= dump_pagetable+0x35/0x37 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0efi_= enter_virtual_mode+0x72a/0x737 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0star= t_kernel+0x607/0x6a9 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? th= read_stack_cache_init+0xb/0xb [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0? id= t_setup_from_table+0xd9/0x130 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0x86_= 64_start_reservations+0x24/0x26 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0x86_= 64_start_kernel+0xf4/0xfb [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0]=C2=A0=C2=A0seco= ndary_startup_64+0xb6/0xc0 [=C2=A0=C2=A0=C2=A011.365975][=C2=A0=C2=A0=C2=A0=C2=A0T0] Modules linked = in: [=C2=A0=C2=A0=C2=A011.365988][=C2=A0=C2=A0=C2=A0=C2=A0T0] ---[ end trace = 8e90dc89e2468d55 ]--- [=C2=A0=C2=A0=C2=A011.375984][=C2=A0=C2=A0=C2=A0=C2=A0T0] RIP: 0010:ptdum= p_pte_entry+0x39/0x60 [=C2=A0=C2=A0=C2=A011.381335][=C2=A0=C2=A0=C2=A0=C2=A0T0] Code: 55 41 54 = 49 89 fc 48 8d 79 18 53 48 89 cb e8 5e 0e fa ff 48 8b 5b 18 48 89 df e8 52 0e fa ff 4c 89 e7 4c 8b 2b e8 47 0e fa f= f <49> 8b 0c 24 4c 89 f6 48 89 df ba 05 00 00 00 e8 03 1d 9b 00 31 c0 [=C2=A0=C2=A0=C2=A011.385982][=C2=A0=C2=A0=C2=A0=C2=A0T0] RSP: 0000:fffff= fffaf8079d0 EFLAGS: 00010282 [=C2=A0=C2=A0=C2=A011.395982][=C2=A0=C2=A0=C2=A0=C2=A0T0] RAX: 0000000000= 000000 RBX: ffffffffaf807cf0 RCX: ffffffffae374306 [=C2=A0=C2=A0=C2=A011.403864][=C2=A0=C2=A0=C2=A0=C2=A0T0] RDX: 0000000000= 000007 RSI: dffffc0000000000 RDI: ffffffffafef2bf4 [=C2=A0=C2=A0=C2=A011.405982][=C2=A0=C2=A0=C2=A0=C2=A0T0] RBP: ffffffffaf= 8079f0 R08: fffffbfff5fdbb22 R09: fffffbfff5fdbb22 [=C2=A0=C2=A0=C2=A011.415982][=C2=A0=C2=A0=C2=A0=C2=A0T0] R10: fffffbfff5= fdbb21 R11: ffffffffafedd90b R12: 000f887fee5ff000 [=C2=A0=C2=A0=C2=A011.425982][=C2=A0=C2=A0=C2=A0=C2=A0T0] R13: ffffffffae= 2aee40 R14: 0000000011a00000 R15: 0000000011a01000 [=C2=A0=C2=A0=C2=A011.435982][=C2=A0=C2=A0=C2=A0=C2=A0T0] FS:=C2=A0=C2=A0= 0000000000000000(0000) GS:ffff888843400000(0000) knlGS:0000000000000000 [=C2=A0=C2=A0=C2=A011.445982][=C2=A0=C2=A0=C2=A0=C2=A0T0] CS:=C2=A0=C2=A0= 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [=C2=A0=C2=A0=C2=A011.452466][=C2=A0=C2=A0=C2=A0=C2=A0T0] CR2: ffff889077= 9ff000 CR3: 0000000baf412000 CR4: 00000000000406b0 [=C2=A0=C2=A0=C2=A011.455981][=C2=A0=C2=A0=C2=A0=C2=A0T0] Kernel panic - = not syncing: Fatal exception [=C2=A0=C2=A0=C2=A011.462246][=C2=A0=C2=A0=C2=A0=C2=A0T0] ---[ end Kernel= panic - not syncing: Fatal exception ]--- >=20 > Changes since v13: > https://lore.kernel.org/lkml/20191024093716.49420-1-steven.price@arm.co= m/ > * Fixed typo in arc definition of pmd_leaf() spotted by the kbuild tes= t > robot > * Added tags >=20 > Changes since v12: > https://lore.kernel.org/lkml/20191018101248.33727-1-steven.price@arm.co= m/ > * Correct code format in riscv pud_leaf()/pmd_leaf() > * v12 may not have reached everyone because of mail server problems > (which are now hopefully resolved!) >=20 > Changes since v11: > https://lore.kernel.org/lkml/20191007153822.16518-1-steven.price@arm.co= m/ > * Use "-1" as dummy depth parameter in patch 14. >=20 > Changes since v10: > https://lore.kernel.org/lkml/20190731154603.41797-1-steven.price@arm.co= m/ > * Rebased to v5.4-rc1 - mainly various updates to deal with the > splitting out of ops from struct mm_walk. > * Deal with PGD_LEVEL_MULT not always being constant on x86. >=20 > Changes since v9: > https://lore.kernel.org/lkml/20190722154210.42799-1-steven.price@arm.co= m/ > * Moved generic macros to first page in the series and explained the > macro naming in the commit message. > * mips: Moved macros to pgtable.h as they are now valid for both 32 an= d 64 > bit > * x86: Dropped patch which changed the debugfs output for x86, instead > we have... > * new patch adding 'depth' parameter to pte_hole. This is used to > provide the necessary information to output lines for 'holes' in the > debugfs files > * new patch changing arm64 debugfs output to include holes to match x8= 6 > * generic ptdump KASAN handling has been simplified and now works with > CONFIG_DEBUG_VIRTUAL. >=20 > Changes since v8: > https://lore.kernel.org/lkml/20190403141627.11664-1-steven.price@arm.co= m/ > * Rename from p?d_large() to p?d_leaf() > * Dropped patches migrating arm64/x86 custom walkers to > walk_page_range() in favour of adding a generic PTDUMP implementatio= n > and migrating arm64/x86 to that instead. > * Rebased to v5.3-rc1 >=20 > Steven Price (23): > mm: Add generic p?d_leaf() macros > arc: mm: Add p?d_leaf() definitions > arm: mm: Add p?d_leaf() definitions > arm64: mm: Add p?d_leaf() definitions > mips: mm: Add p?d_leaf() definitions > powerpc: mm: Add p?d_leaf() definitions > riscv: mm: Add p?d_leaf() definitions > s390: mm: Add p?d_leaf() definitions > sparc: mm: Add p?d_leaf() definitions > x86: mm: Add p?d_leaf() definitions > mm: pagewalk: Add p4d_entry() and pgd_entry() > mm: pagewalk: Allow walking without vma > mm: pagewalk: Add test_p?d callbacks > mm: pagewalk: Add 'depth' parameter to pte_hole > x86: mm: Point to struct seq_file from struct pg_state > x86: mm+efi: Convert ptdump_walk_pgd_level() to take a mm_struct > x86: mm: Convert ptdump_walk_pgd_level_debugfs() to take an mm_struct > x86: mm: Convert ptdump_walk_pgd_level_core() to take an mm_struct > mm: Add generic ptdump > x86: mm: Convert dump_pagetables to use walk_page_range > arm64: mm: Convert mm/dump.c to use walk_page_range() > arm64: mm: Display non-present entries in ptdump > mm: ptdump: Reduce level numbers by 1 in note_page() >=20 > arch/arc/include/asm/pgtable.h | 1 + > arch/arm/include/asm/pgtable-2level.h | 1 + > arch/arm/include/asm/pgtable-3level.h | 1 + > arch/arm64/Kconfig | 1 + > arch/arm64/Kconfig.debug | 19 +- > arch/arm64/include/asm/pgtable.h | 2 + > arch/arm64/include/asm/ptdump.h | 8 +- > arch/arm64/mm/Makefile | 4 +- > arch/arm64/mm/dump.c | 148 +++----- > arch/arm64/mm/mmu.c | 4 +- > arch/arm64/mm/ptdump_debugfs.c | 2 +- > arch/mips/include/asm/pgtable.h | 5 + > arch/powerpc/include/asm/book3s/64/pgtable.h | 30 +- > arch/riscv/include/asm/pgtable-64.h | 7 + > arch/riscv/include/asm/pgtable.h | 7 + > arch/s390/include/asm/pgtable.h | 2 + > arch/sparc/include/asm/pgtable_64.h | 2 + > arch/x86/Kconfig | 1 + > arch/x86/Kconfig.debug | 20 +- > arch/x86/include/asm/pgtable.h | 10 +- > arch/x86/mm/Makefile | 4 +- > arch/x86/mm/debug_pagetables.c | 8 +- > arch/x86/mm/dump_pagetables.c | 343 +++++-------------- > arch/x86/platform/efi/efi_32.c | 2 +- > arch/x86/platform/efi/efi_64.c | 4 +- > drivers/firmware/efi/arm-runtime.c | 2 +- > fs/proc/task_mmu.c | 4 +- > include/asm-generic/pgtable.h | 20 ++ > include/linux/pagewalk.h | 42 ++- > include/linux/ptdump.h | 22 ++ > mm/Kconfig.debug | 21 ++ > mm/Makefile | 1 + > mm/hmm.c | 8 +- > mm/migrate.c | 5 +- > mm/mincore.c | 1 + > mm/pagewalk.c | 126 +++++-- > mm/ptdump.c | 151 ++++++++ > 37 files changed, 586 insertions(+), 453 deletions(-) > create mode 100644 include/linux/ptdump.h > create mode 100644 mm/ptdump.c >=20