Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1248247lfc; Wed, 1 Jun 2022 13:02:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzEtlLQCqG6LNOszIC60nb72Tl/Cr4H4R6BRj0r0TQGKYWudCQXJVvVsyEm3CPgrjXOpk0 X-Received: by 2002:a17:90b:4b8d:b0:1e3:5147:6e63 with SMTP id lr13-20020a17090b4b8d00b001e351476e63mr1121254pjb.162.1654113735145; Wed, 01 Jun 2022 13:02:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654113735; cv=none; d=google.com; s=arc-20160816; b=CpuDz3MtaJzwZhD2mSWo8RkgnMCagoPDf3ednE1ctRACNYVdbF0a3rfObfGLTaLoW8 iW16QEvms7o406cYzNpfYzgKn/wJftPeTxF9NJqsaFHXTtB2m5k5qGyTtJkNUaCTRdIw EzPRD69BCd1OkOvxMeNdMwiow6dNGr3EZqj+viW3E8YaarcE4mxyWekQZVcqCDrvQyXz 9nWq4ruW1eUlEU8fz1nfkUR4vhavWS6NgTHrXo196t0aAAchFyJFWKDQclOY0GyJ9wyw ejNU44YIksVbURPdcK+z23oo684jyYTC7cPArVWPiPmd50CdsjeQrrG70WXaNfqN211e qOIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=inrxYJ9oADTfxusnISoAZh42MNAvWHedV+zGAdma8cI=; b=k2Rw+pUeUCI60OBJBCjOw0OTXxvOT43wFKPirZBJQhVmyl4fGGJqnkTnxIl6HBOCsd OsDY8/lobPH8b1atB3hps7f4jofPRAKIamjPojP/LS7AOFZkaU2IwuqSJhN9S2PS+/eg X1h/BqCBN3IKgB28t9sQZUctdl4k4u16UsiRIblg3+wNbSRMApoJmiZ6QCo2buwE43Sx SGoH77DA0LL4WxHW2KT47yO/2SeA7iSOh1bVN4j7/oh2JcFTNBSQEgjeKwip1mFNmIP3 Rlh8xzT9yvQDzZ3ua55sUuIm6ABqTbpDAZh+SkRayHHie1KVLkzKu4199FWJMLZQ4VPC mbXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Cvz/dwv0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g2-20020a63ad02000000b003c5e8376f56si3273679pgf.630.2022.06.01.13.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 13:02:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Cvz/dwv0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4D90A1ACE77; Wed, 1 Jun 2022 12:20:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243178AbiEaQFi (ORCPT + 99 others); Tue, 31 May 2022 12:05:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234894AbiEaQFh (ORCPT ); Tue, 31 May 2022 12:05:37 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA6D1813D5 for ; Tue, 31 May 2022 09:05:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 37015CE16FD for ; Tue, 31 May 2022 16:05:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1F72C385A9; Tue, 31 May 2022 16:05:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654013132; bh=b9RnbKQcXJrnB1KXhWSO/DdOr7SD54f5RYTo/RuTyvc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Cvz/dwv0V3OHEJhBZprOfvrwyj/3KtDnbbJKdW+0IZW/rpaLqv9e91ijC878ztnPK OEPc1YFzeDiQGH1T4N42tvQQ6cMlvncWnOHbQtW3SXhpF+j5GKJvGAeMQ1iXOLZ67w eNYdfDt1yeyMIQ//4ORm3bR2TMVvglqCv6predvJZOSfe42VOhSI85RAFetSKd8a6r /KMEFNG4PWT2k25Npqwaw7EtHmOMMc+N+09xZKugDbkA9NiRSUESO/6g36xYRiv8DD +Al7EMq3zw1dv0h9WVShe/xwJuLbg6Sa483lwPJ7MjanmNnj2BNjzHR82RW6Lh+E8B 8MMx0MKg9roUw== Date: Tue, 31 May 2022 17:05:24 +0100 From: Will Deacon To: Anders Roxell Cc: Pasha Tatashin , Tong Tiangen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , Anshuman Khandual , Andrew Morton , Catalin Marinas , Paul Walmsley , Palmer Dabbelt , Albert Ou , LKML , linux-mm , Linux ARM , linux-riscv@lists.infradead.org, Kefeng Wang , Guohanjun , Linus Torvalds Subject: Re: [PATCH -next v7 5/6] arm64/mm: Enable ARCH_SUPPORTS_PAGE_TABLE_CHECK Message-ID: <20220531160524.GC25502@willie-the-truck> References: <20220507110114.4128854-1-tongtiangen@huawei.com> <20220507110114.4128854-6-tongtiangen@huawei.com> <20220517135435.GA553@mutt> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 28, 2022 at 06:41:55PM +0200, Anders Roxell wrote: > On Tue, 17 May 2022 at 16:33, Anders Roxell wrote: > > > > On Tue, 17 May 2022 at 16:02, Pasha Tatashin wrote: > > > > > > On Tue, May 17, 2022 at 9:54 AM Anders Roxell wrote: > > > > > > > > On 2022-05-07 11:01, Tong Tiangen wrote: > > > > > From: Kefeng Wang > > > > > > > > > > As commit d283d422c6c4 ("x86: mm: add x86_64 support for page table check") > > > > > , enable ARCH_SUPPORTS_PAGE_TABLE_CHECK on arm64. > > > > > > > > > > Add additional page table check stubs for page table helpers, these stubs > > > > > can be used to check the existing page table entries. > > > > > > > > > > Signed-off-by: Kefeng Wang > > > > > Signed-off-by: Tong Tiangen > > > > > Reviewed-by: Pasha Tatashin > > > > > > > > When building and booting an arm64 allmodconfig kernel on the next tree, branch next-20220516, > > > > see the following kernel oops when booting in QEMU [1]: > > > > > > > > T35] ------------[ cut here ]------------ > > > > [ 578.695796][ T35] kernel BUG at mm/page_table_check.c:82! That seems to be: BUG_ON(atomic_dec_return(&ptc->file_map_count) < 0); > > > > [ 578.697292][ T35] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP > > > > [ 578.704318][ T35] Modules linked in: > > > > [ 578.705907][ T35] CPU: 0 PID: 35 Comm: khugepaged Tainted: G T 5.18.0-rc6-next-20220513 #1 893498a5d8159d9fb26e12492a93c07e83dd4b7f > > > > [ 578.711170][ T35] Hardware name: linux,dummy-virt (DT) > > > > [ 578.713315][ T35] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) > > > > [ 578.716398][ T35] pc : page_table_check_clear.constprop.0+0x1f4/0x280 > > > > [ 578.719107][ T35] lr : page_table_check_clear.constprop.0+0x1cc/0x280 > > > > [ 578.721781][ T35] sp : ffff80000f3778b0 > > > > [ 578.723446][ T35] x29: ffff80000f3778b0 x28: ffff80000b891218 x27: ffff000012dd55f0 > > > > [ 578.726667][ T35] x26: 0000000000000008 x25: ffff80000c38cd80 x24: 0000000000000000 > > > > [ 578.729870][ T35] x23: ffff80000c38c9c0 x22: 0000000000000000 x21: 0000000000000200 > > > > [ 578.733079][ T35] x20: ffff000007bae000 x19: ffff000007bae008 x18: 0000000000000000 > > > > [ 578.736299][ T35] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 > > > > [ 578.739505][ T35] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000 > > > > [ 578.742735][ T35] x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000 > > > > [ 578.745925][ T35] x8 : 0000000000000000 x7 : 0000000000000000 x6 : 0000000000000000 > > > > [ 578.749145][ T35] x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff000007bae00c > > > > [ 578.752348][ T35] x2 : 0000000000000000 x1 : 0000000000000001 x0 : 00000000ffffffff > > > > [ 578.755556][ T35] Call trace: > > > > [ 578.756877][ T35] page_table_check_clear.constprop.0+0x1f4/0x280 > > > > [ 578.759446][ T35] __page_table_check_pmd_clear+0xc4/0x140 > > > > [ 578.761757][ T35] pmdp_collapse_flush+0xa4/0x1c0 > > > > [ 578.763771][ T35] collapse_huge_page+0x4e4/0xb00 > > > > [ 578.765778][ T35] khugepaged_scan_pmd+0xc18/0xd00 > > > > [ 578.767840][ T35] khugepaged_scan_mm_slot+0x580/0x780 > > > > [ 578.770018][ T35] khugepaged+0x2dc/0x400 > > > > [ 578.771786][ T35] kthread+0x164/0x180 > > > > [ 578.773430][ T35] ret_from_fork+0x10/0x20 > > > > [ 578.775253][ T35] Code: 52800021 91001263 14000388 36f80040 (d4210000) > > > > [ 578.777990][ T35] ---[ end trace 0000000000000000 ]--- > > > > [ 578.778021][ T35] Kernel panic - not syncing: Oops - BUG: Fatal exception > > > > [ 578.782934][ T35] Kernel Offset: disabled > > > > [ 578.784642][ T35] CPU features: 0x000,00100010,00001086 > > > > [ 578.786848][ T35] Memory Limit: none > > > > [ 578.788433][ T35] ---[ end Kernel panic - not syncing: Oops - BUG: Fatal exception ]--- > > Now I see this oops on the mainline kernel too when I'm building and booting an > arm64 allmodconfig kernel, sha > 9d004b2f4fea ("Merge tag 'cxl-for-5.19' of > git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl"). > > building and booting an arm64 allmodconfig kernel. > > When I revert 42b2547137f5 ("arm64/mm: enable > ARCH_SUPPORTS_PAGE_TABLE_CHECK") I'm able to boot. > The kernel boots fine. I don't think disabling the check is the right thing to do, and I'm not really seeing anything arm64-specific from the information here either. It's more likely that one of the many other options (or combination of options) enabled in allmodconfig is causing the problem. Are you able to reproduce on x86? Anshuman -- any ideas? Will