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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C85FC0015E for ; Sun, 16 Jul 2023 02:42:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 987B46B0071; Sat, 15 Jul 2023 22:42:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 937CB6B0074; Sat, 15 Jul 2023 22:42:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7FEF76B0075; Sat, 15 Jul 2023 22:42:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 6C8C26B0071 for ; Sat, 15 Jul 2023 22:42:06 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 3B2F2802CE for ; Sun, 16 Jul 2023 02:42:06 +0000 (UTC) X-FDA: 81015925452.20.8DFBA8E Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) by imf23.hostedemail.com (Postfix) with ESMTP id 5D6FD14000B for ; Sun, 16 Jul 2023 02:42:04 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=a2KWfcx0; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf23.hostedemail.com: domain of hughd@google.com designates 209.85.219.178 as permitted sender) smtp.mailfrom=hughd@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689475324; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=BBCMVJPU/Zt2Fyzdjtg0pHSQITw+twghbG+ABS33Zns=; b=FHu34tQ0eAAL0raLz8/nbAsX01fTpKtrwnqGvb82ybkhD6oofiouSs/lwuMxvpnF0sporu V1BB2gv6FxbIN2Bq5XBh9uYwJB6I466iJbnNTkoNDLiCS/qKHCjTrUuD13ZLnKkrs2LX4l /H12f3q+BGAY50fpeggDDxjnBWBJ54o= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=a2KWfcx0; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf23.hostedemail.com: domain of hughd@google.com designates 209.85.219.178 as permitted sender) smtp.mailfrom=hughd@google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689475324; a=rsa-sha256; cv=none; b=j+sNuHTIqneH9KfFR81jmpRe9n4Wbbnuhuun/N9fVzXt+u7OV0S0B6TRohpHfc+nj0wcAf wv6JwT5lsQwF6lJRyicz5QNcMAA25SPsya3DJl3sZaH04J0HWM+0EGxEHeeB1iBcV3JHHJ ZzRs9q2Nqrgt2Ap4+XBake1HDjeu9TA= Received: by mail-yb1-f178.google.com with SMTP id 3f1490d57ef6-cada5e4e3f6so3317676276.3 for ; Sat, 15 Jul 2023 19:42:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689475323; x=1692067323; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=BBCMVJPU/Zt2Fyzdjtg0pHSQITw+twghbG+ABS33Zns=; b=a2KWfcx0LGQ7ckLjKEdbxt2nMyV4rcIfPnqoyvw9sRER/ITd7/hkEzmxiU4s5Sc7ze Q0kLRIxgKGvzP7d/ueISDkEY2+9p3pXhI9cCwmKiG45SsFn9PUUSPTTuxGL2ER+mXDzP IdaD8dNSJZ/+qh4Ieph/P4Zy1AhgZLVujhhXuVTsPKYkuUW60doVmntU3Ln8WdcYlJau TmNkdXw3kB7Tw+iVklQb+VpXewFq7x5rU0qvXpm0Ea3+eyQKGOjhtNZyNBd0IKSQIvw0 5bBz4dAA9BOppH12RRBCUZTFRhrYE/SHqVlSkpiRo6PvoyaIDs8eE+QX+jnSfMgzsfoI 4rSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689475323; x=1692067323; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BBCMVJPU/Zt2Fyzdjtg0pHSQITw+twghbG+ABS33Zns=; b=IzwzwxNhPABmcFfSGdnkCRtH8BNsFjy/kfDFFLFz6b+hoXBhjKynjwIpP+oIfyHt/v NVY8mTroWjyaDj76HG1/J873RDDVgGxdGe6h8O70OnQ/VB9F1SyoNIF2bSk9l6vilBkl Wz9Jtqj0ZEh3nJxigpyCHZX/sWDdKA4aLD1bvQ2xESxRfU6nFbGVzOBJtQaoRgiKkOIZ JPcEc3kH7RASEKsUaH42j9J87cssbb1Xssc7SAWJgdrnTxdEQBEfslfbiUVvIFwM5cwt oHQrc037YIbsf7OKLlVDdWtWC1wOx/TWPAODkiWtDobp8jReRBTZ29rGeHRn+JJzc+cj MZMA== X-Gm-Message-State: ABy/qLYYH1iZ+S01Ag9NoWI1+i+/Groq1TLjlm0PGGef1LIdtIs/0e80 Mg+HBQlNg3cS8dgkM9mWDR1PwQ== X-Google-Smtp-Source: APBJJlE0beKyrlN6/zbOkQuDmqcNOdQE90DxNqh0mpYM3xyVueqJ621Uj5TMdlTj5tr6egv33kWotA== X-Received: by 2002:a25:b31d:0:b0:c60:982f:680c with SMTP id l29-20020a25b31d000000b00c60982f680cmr8034493ybj.63.1689475323336; Sat, 15 Jul 2023 19:42:03 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id r14-20020a255d0e000000b00c602b4b7226sm2381363ybb.25.2023.07.15.19.42.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jul 2023 19:42:02 -0700 (PDT) Date: Sat, 15 Jul 2023 19:41:48 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Mikhail Gavrilov cc: Linux Memory Management List , Linux List Kernel Mailing , hughd@google.com Subject: Re: [bug/bisected] I see "mm/pgtable-generic.c:53: bad pmd (____ptrval____)(8000000100077061)" every boot time In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 5D6FD14000B X-Stat-Signature: 1nazhp6qyd59sy5m4ap7e6q6uz8bzgxj X-Rspam-User: X-HE-Tag: 1689475324-316155 X-HE-Meta: U2FsdGVkX1/m8BssqVttY93K3r5Ih7lz3eBp/6ocA+C5tocGwSbz+xYNwgpkxfQvdVSPoBrL51dgziKGoyMylnkxXK3GMjBDHDYmLLa+sHzFRqTMHMHr8zKe5EKfYngIaZd+o09pvPJ+Q/imPjHUl990OGWZFBJxUlubWGQkC49Be9q7qjpf4+V1hq+gTzvc6ytMFheiVNkGL7b9WBdwFPxy5oRFeEiFKbyO5qWRLV3sYj8RK0Nh49b/ri6M958gczNcPBj6+/hA03o7GiroEsOE9JhmJBMRmGB96cHA3HE504hT1Ig1oW1ATEof+F3iKogrv+LzUHRKjQi4lMzsXVfskMc4f8XKapxW/ZmlKC4MPRb6bK6E+JGImjAU5Wus4jT8cZhag1W2sNCg4SskuR6Id0RAyxuhpAbdopTO0C+fciHPVImnztiHX5q4vlN97oqAa8L9R7Qtk2adaxVbdj/P1T9skVe5Na4EJBw44NEInvdTnELuWa17dUdw3Dq3VaWGoguu5J+BVSxSrFEj1dDl5pznfpIuhxai28OOuNUUad6p38lkiJ0+GJxxo0qLp6lMKeWi/womN74Njsf+F++FKhBMO+lioo53na8o1MkKsTIHoLs3kt+QiYtdxmFE5eWT0R1TrMs6OK/b9/14zMavvcn811oH7I0g+3mULxQEZQBE2kpv7Z2VSdSWwBIrUfP2O+SHkwDncJlTW81L+S0w8YB9h2nuerkGGEcTvtj7w3fYBkyJ0TgpGLxCcrSDoElgo7hjlw+YGwJR8LiZGRva8H1SOjK855UIQDTKJBsTPM0SYGY+NPS9KQtEFNmct1J9Wcan8kELQOSniqNtoV//SkhaCeOxMnvZxQLPvuvc2xh6g2ZFR6HOpg4r9TP6nxXuxr2AFs+ON21xmSTA4GvmR4PUfSiNfP21AywKeIL5Iw2pAE6jdzE4NyXuE7p7BL3CQzYKxkJhXaNDNaH vV7HAS76 I5RnwdxlerALtNMgZJZHmvQVqgffH/tRHb6/APAMMtXvbdPMqmivGy9UaPx4vg59FK80CKRgNM4c28yi1Ox2PFqDFmx0fm0VDNoenfsJsc4cFih00YQMdG8VisZR0j05ucqa3RVTb0UhGd234xXCzaxcLLDHNe7O+hjMhw6HpwApGdTPaZeBH5TTm3SeEa7GSixEKeHnG6ICxapXxsGCcpfrSNpbcMW9nyZVqTG98iof5S9X0EkHkc8UO0bjDAkZKab3FY9IqXArE8mxBO3cNUuMjUImbMrBRfADWucLh8KYwOkX3CABCyEixlgdLU0WB+n6bI/Adohdf6f/VxgT0Whm+Ju0qyQc7BBOHJv6yBO4Kj+TlQNW6GYjFfE3KTmtyHybGMdXtJH43dLUJSJJiPZ51pMhNfcBTGeY96qYkv4Z+MTL5Sf2E1f5rC8dP+7XuQgqkUb30O4OoMursbEYeXZqXgLCb4CbvMD0G 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 Sat, 15 Jul 2023, Mikhail Gavrilov wrote: > Hi, > It's ok that I see "mm/pgtable-generic.c:53: bad pmd > (____ptrval____)(8000000100077061)" every boot time? Many thanks for reporting, Mike. No, I wouldn't call that ok at all. Though I've more research to do before I can tell how much it matters. > Unfortunately bisect couldn't say which of commits > # possible first bad commit: > [be872f83bf571f4f9a0ac25e2c9c36e905a36619] mm/pagewalk: > walk_pte_range() allow for pte_offset_map() > # possible first bad commit: > [7780d04046a2288ab85d88bedacc60fa4fad9971] mm/pagewalkers: > ACTION_AGAIN if pte_offset_map_lock() fails > # possible first bad commit: > [2798bbe75b9c2752b46d292e5c2a49f49da36418] mm/page_vma_mapped: > pte_offset_map_nolock() not pte_lockptr() > # possible first bad commit: > [90f43b0a13cddb09e2686f4d976751c0a9b8b197] mm/page_vma_mapped: > reformat map_pte() with less indentation > # possible first bad commit: > [45fe85e9811ede2d65b21724cae50d6a0563e452] mm/page_vma_mapped: delete > bogosity in page_vma_mapped_walk() > # possible first bad commit: > [65747aaf42b7db6acb8e57a2b8e9959928f404dd] mm/filemap: allow > pte_offset_map_lock() to fail > # possible first bad commit: > [0d940a9b270b9220dcff74d8e9123c9788365751] mm/pgtable: allow > pte_offset_map[_lock]() to fail > definitely first bad because my machine on which I am was doing > bisection is unbootable on these commits. > I hope Hugh Dickins can figure out what's going on here. He is the > author of these commits. And thanks for the patient bisecting. Yes, it will be 0d940a9b270b which introduced the unexpected problem, then be872f83bf5 which fixed the unbootability aspect (that's right, isn't it? with be872f83bf5 in, your machine booted ok? but in between it was unbootable). Very useful info, since it narrowed the symptom down to users of that pagewalker, before it was allowing for NULL from pte_offset_map() (we were not expecting ever to hit a bad pmd in normal circumstances). I have now been able to reproduce such a message, by setting CONFIG_EFI_PGT_DUMP=y - am I guessing correctly that you have that? For now, I recommend that you leave CONFIG_EFI_PGT_DUMP unset. I wonder how many other people have it set, but have not yet noticed this "bad pmd" message you are reporting. The problem comes from a confluence of surprises: the pagewalker now makes an exception for init_mm, but efi_mm is another odd case; and espfix sets up pmd entries in an unconventional way, which happens to fit the "bad pmd" criterion; then the efi_mm pgt dump discovers them. I'm not rushing to judgment on where and what the right fix will be, that needs some reflection. And perhaps more urgent than that, is that I got not one but 12 such messages (with 4 processors): that's another surprise, I would have expected the condition to be cleared after the first message (but that clearing to ruin the running of Win16 binaries). More will follow, at lower priority; but if I'm wrong about you having CONFIG_EFI_PGT_DUMP=y, and unsetting it hiding the issue, please speak up. Thanks, Hugh > > All mine machines are based on the AMD platform two 7950X and one 5900HX. > > It seems that this message is harmless for the system in any way, but > I can't judge it is a bug or not. > From the user side it looks like regression because on commit > 46c475bd676bb05077c8a38b37f175552f035406 this message was absent. > > -- > Best Regards, > Mike Gavrilov.