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 A9C03EB64DA for ; Sun, 16 Jul 2023 09:54:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AE18B6B0071; Sun, 16 Jul 2023 05:54:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A92566B0074; Sun, 16 Jul 2023 05:54:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9A83B6B0075; Sun, 16 Jul 2023 05:54:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 899DF6B0071 for ; Sun, 16 Jul 2023 05:54:12 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 24B8E40160 for ; Sun, 16 Jul 2023 09:54:12 +0000 (UTC) X-FDA: 81017014344.01.5F0C773 Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) by imf26.hostedemail.com (Postfix) with ESMTP id 6732D14000F for ; Sun, 16 Jul 2023 09:54:10 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=UrzEKoEC; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of mikhail.v.gavrilov@gmail.com designates 209.85.219.54 as permitted sender) smtp.mailfrom=mikhail.v.gavrilov@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689501250; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=UuZSHeCu4KqE0b9tPVjiUw2JtLp/pUndGexcbDWarPk=; b=SXnIr1BOuQ1TKeqWIucaXxUtIgpVOn8TvTzMLC7G7fVqzllxQkon2F5Lsk5ZePTliDnKdl HkVJMqjgzaSV6xPDTzVe6q/KDNkEwZxU+du5fqh/8NuDJI3ezOkZJOUXBKw0oxOnb+jgeQ YEcawsVglU/5qp5GzrwKd54uUYNt7GM= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=UrzEKoEC; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of mikhail.v.gavrilov@gmail.com designates 209.85.219.54 as permitted sender) smtp.mailfrom=mikhail.v.gavrilov@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689501250; a=rsa-sha256; cv=none; b=MB/QcoGALb/P/pfgTylXxCulPyVwqtzsXXiAZcZD44rx2zCVjIIGGWSDLe8vwaoLBJGvTh dHR34ZnUYmW9aEOlIgZ5k+efdSuItV/jnD014DpD2ZG/55geG9XZg70vAahXaShWt8uXWn n15i8s+w9RLMeGzDKApsaSWudsz9WQ8= Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-6358a43d045so5424646d6.1 for ; Sun, 16 Jul 2023 02:54:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689501249; x=1690106049; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=UuZSHeCu4KqE0b9tPVjiUw2JtLp/pUndGexcbDWarPk=; b=UrzEKoECC1d+KLjCr/lwD5eCn5Oi0RLv6IfOfCkJmauMf+fw2I5HrRDTLbUkvKcwNd XdUZM2UPW2gxBZ420NUDlauFRvx6ZTdzhKb02qv3aAHJJcrMM/GKZ5HppkEL1mzNdUb1 aiwM/aEStayXG5EVNyApST8LXXZxYK95ewBqVATHlVT6JBPP/mhmlh+J4qC2Oh9zWoTx Oxa9LjLxHSZGfgnQGQHm6y3lK/YWj/WrBM5Agtovod6XBZ5hZhDGWPPpLRypYQmjSPp6 hSBQ2PvNhb3ILBhbqYF0XyjmjZBTkXkas3tgrWHG8WjiIFqTxN3iKJpszrFERBiNRNEs z8pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689501249; x=1690106049; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UuZSHeCu4KqE0b9tPVjiUw2JtLp/pUndGexcbDWarPk=; b=IRHJnkN/PFaBPWFNUtfYio/gN6U3WLWWo6+Wo9e4gRhMzSyyv4Jieh54t4zRwRpPwS FYANv8d0Souhrh6/rxE/I+3I21vKtpWjQgoDUgFjumzXUrPALf1dvXuMk22LyMq7Th4O clCVIDAEBIvM1HrUNKKsWebwW/7laok9vC5c/5RBJKeRPKQzCXsuYEXTmorRT2H7NAar 0QmgocOSxPl9rDyTg9dNdW/2kVA0A8jIXoewSGxyk9C5JtwrW1DLIMfxwuI91Huza5/+ uGqUW0Of8Y75PDqDvZEHEmZg5wX2DwaX38jvrc3TK9cs3ze4nqNDYEWn0V77ZXL3JGM4 D1mQ== X-Gm-Message-State: ABy/qLbnWL7mnaF0XqoTygOPf01FKLcnlPH/W3VVlQL9QvyyvcbjEbBN qUlLKqb+hLspzZd2uaA3plW3t8XaeHe53RGlT3Q= X-Google-Smtp-Source: APBJJlG3b2n1Cleoh1rXOeLJbbCGQk7EzlaEvvsuju5VYXuWLDyO0YFdK2d9cfiU/ukMr6Pv18nYWlEf6I7Vyon2n54= X-Received: by 2002:a05:6214:d0b:b0:61b:2111:c2e2 with SMTP id 11-20020a0562140d0b00b0061b2111c2e2mr4978364qvh.2.1689501249386; Sun, 16 Jul 2023 02:54:09 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Mikhail Gavrilov Date: Sun, 16 Jul 2023 14:53:58 +0500 Message-ID: Subject: Re: [bug/bisected] I see "mm/pgtable-generic.c:53: bad pmd (____ptrval____)(8000000100077061)" every boot time To: Hugh Dickins Cc: Linux Memory Management List , Linux List Kernel Mailing Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 6732D14000F X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: w6jhqp855ejwoq1bx1u8zdbzjz7ex45q X-HE-Tag: 1689501250-867118 X-HE-Meta: U2FsdGVkX1+ptGIcwjvEYtiws/b8z0UBRpNK2RHSHBDQ/9owAxVEK0uProUD5UziTyb38lETg6tViIu3JwZNbNvf9DoA3xSn4JRTu5XweRgSjWCVsFDulp2yepIk4VHqhtP724wG+KhtWIYKzxiBwsbX4a+4bCNvfzPZxaBwvR4tyKoBjXTqHkZToB7CciCx/cj56mJunwfHHfCuXSRYiSKokaa2dbgyS8bOZYyMFGqlz2TVh6DYE//iH9XL31t7KH855oJQ4NPkR+zGFGd1t8CaHV/3o7WQtUUCkZeGfuRTgZi23THuS0+8gLwOYuuKEPSm8KU5m6c7R0a7XS+P1UToBMJRK4WMaZ+lRMjjfcT5hAF55SZgnNhHAeHNG4YXj8X79WWVoauiuCScTOJqXNV5FanBwApuvvqE+oKmwlg611qLof1XiilrA7N23y9Tyt4MZv1FVvDj2FOtgALSNY9Dd14/bGwYwVZBAaaRh7+af+MMOINIPiGSfWQJV+NiaAYRtwQ9b0RhowawTfO/SwIeLIjM8cB5wsYi6RBSatSqcreheobPvq1c5LfR+cHBsQA7QHYFsdtOGoeWhukyxw0bcyzpq7eTJqooJnIfAKSkaysY6jcsc3jgmB2XNyEZLP9DrENKTvutXm4la8eJgGb0QaGxHpby5bPAkSslVsKpVKcuZqWXUVE+J8Z23SnzwptWPhUqPyB+DoAemmQIW5YuCRyTDy4xqTRo5ITMpd4c+UgBbC7/eY91umK6qMlNQ2ALc2b6Qf+OJ2By1As2utRCA37K8TYltCXBTMZ9dxB3my7eTYN6WtMaxAe8Hcwdo8V2zvQBXgVWskVa3Y8qxvwgCRUkH7TrieFM5Eo7U0GMRADvPW5+iai5dwMjovtdF77JHZq8lo6MnqJS5+x+IyiYSOqEOPAjpEmcf9v2yxC8Rfdwx+juhOPn/tRGrnZSGGV3tUABPfHgVkywP7H p/kIMHeN ODSoFen8JxePqNwUNCnIAjoNeqJ25jnYrks9gzSlIiIg60+lEWyleauCa7S7kVyTcSMpw2zXimB0bALZnuz6v6KhCOjLgZXoHjj/fR0ysXl4L1AxTNUhqB9Hm96Tjxc0dsGKBumaaWSVwY1orkSbceuC8uBR0Ia8phbQd74feZJiT8QTwHmf+UODbX1OQPJEo0IK/sqpqqBNbVErbsS4M5/+tqV/ytUn0sba1yTR/Ok/Z8GgjieAWM/yBA6Tlh2KjnkuI540jJqGAoHNxsvL19dHULfiTS9TTsYOuoegh7lXAcm1mqzkCLNRRKhXIvTlvxc1qz3zSelocVgsTr11SqIkZRW5IwqHd0rPa3Y6JIWRaNZ9hXTfjN7JEj+eriaKJeB1NxgbPHCZGwPgaRFFgKgLCriqZpM0gKmwVK5EPE8wBJ6cJQiIISbUL4s53+oSRNGU0nOyZWQexLj7WVxY5I+7b3O0Hv4p2m22n9Kz6MquQ5ucSXmk5lRbBZ+iqrsVEc3Wg 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 Sun, Jul 16, 2023 at 7:42=E2=80=AFAM Hugh Dickins wro= te: > > 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). Absolutely right. > 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=3Dy - am I guessing correctly that you have that? Yes. $ cat .config | grep CONFIG_EFI_PGT_DUMP CONFIG_EFI_PGT_DUMP=3Dy But distro Fedora has been set this setting to "Y" since 2016. https://src.fedoraproject.org/rpms/kernel/blob/1b7eeb80190501aaf226e90e8f58= f994cfc3efe0/f/kernel-x86_64-debug.config#_1293 commit 1b7eeb80190501aaf226e90e8f58f994cfc3efe0 Author: Laura Abbott Date: Thu Nov 10 10:16:25 2016 -0800 Change method of configuration generation The existing method of managing configuration files gets unweildy. Changing individual lines in text files gets difficult without manual organization. Switch to a method of configuration generation that's inspired from the method used inside Red Hat. Each configuration option gets its own file which are then combined to form the configuration files. This makes confirming what's actually enabled much easier. > 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=3Dy, and unsetting it hiding the issue, please speak = up. I confirm after unsetting CONFIG_EFI_PGT_DUMP the "bad pmd" message didn't appear any more. --=20 Best Regards, Mike Gavrilov.