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=-5.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 56463C2B9F8 for ; Tue, 25 May 2021 16:10:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1022A61408 for ; Tue, 25 May 2021 16:10:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1022A61408 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:Subject: From:References:Cc:To:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=KejRe1c7rtI2Cvqo18B422lT1a54Iyhn1Y0rkiKg7Yo=; b=hFFLqaNLvB3/xjqgmHccOn/bdr Rb+hk5LmIx2UrhlB4I/Sk2n3KuASZsYDI1TA6YRuIxPpZo0Jafkz7tJwkaha1Yj9kyXlaHOOjnAnh dlcP7W+gxpPsQa1M6TpoXENlHnu79S8MJosK3Ni7jmHuCjsWB98ggwiTudiqPPuJ2S2NflqmNQ6ak zPoAGNBwkhfGXVMrsLJSNZ+2A42WhvfpTdFo6gCdJR4GJ0ytyefNPVxvH2NOh+P2EJCMs21S4XaiD OndH9qG+Mv0VDoaNzpxLPOvM5lBhbFbPwTrltgh/Va6Tm319qS7Pbk9njdMSl08TuLM4uRssaCWt8 /E3rviiA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1llZaW-006Gb5-Nk; Tue, 25 May 2021 16:07:26 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1llZ7e-0063hV-Uy for linux-arm-kernel@lists.infradead.org; Tue, 25 May 2021 15:37:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621957053; h=from:from: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; bh=/pTfXMHcES0HP1+v2jr/ALeYwe9IxOxXOMr/JTHDhoA=; b=L/vHYZ2LwKDn2Kmo1IcFj+waPxyWMQeerPdr6XMk/7b/dxELbMK8p3PctLlhtow3e/IzRr ZSu1ZfMUrsRQAiiq184jo6xZqOTYzfeS1kseZh0whZut0q5W/xNl6VYp3VIIKARwcsV6VN /R+Lj4d/TbKOJGxhbkcUUlZAlIC7WDg= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-374-csBZH6ZDM5KxQLNV3DNTOA-1; Tue, 25 May 2021 11:37:31 -0400 X-MC-Unique: csBZH6ZDM5KxQLNV3DNTOA-1 Received: by mail-wr1-f72.google.com with SMTP id a9-20020adfc4490000b0290112095ca785so9502584wrg.14 for ; Tue, 25 May 2021 08:37:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:organization:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=/pTfXMHcES0HP1+v2jr/ALeYwe9IxOxXOMr/JTHDhoA=; b=CRT8m1RIBpJZsBVCkWzyNOqEwnwTIak8Uhrk+lzSaMsBKcgUwtCLSL+af5JgBuwR15 VTOpInfl3H7YGGiljpnAWEzmPnKOsIp4/+NGX7S7u8A0yUgAiAe6gE7534fBWHcugU0Y fCJ4MnNuUEKbAsUIQegW4HWLdkevmuKYk/5bQ/vC+//sxPYJGURZzVS1Mv0NxytbvcQk M/xZMWGtSvc5PJZcpyvUYXPoYUJQlz+EJPytuguEhZTb799+hjY1gCnnpkhHE8OdzcJl TYY/S6ezMNNd6zyum1KspStUH910xM+6LcZUoVZwZNO8138sgFG+bKZ38uLfX65OtElD O8/g== X-Gm-Message-State: AOAM531zabRl+oQzX5ojmBx9aR84k1bnhz5hpUet1/oVJPVTzV83Usmw LzKyJ4f6eR9a8T7dO6bcNCDaYeKvXTDz8ArFUb4GcicdszrivNicBCJWQOaJZ3vQxVqqKXTcs/5 hqKOv6ml3DJe8o0zABe5ZfL13whW3Y3gBTYuu6pLWQbua+yQCq7+QNtNm8JtoCHScHIDSmU7E6T 4H78x3u5k= X-Received: by 2002:a05:600c:3510:: with SMTP id h16mr23939839wmq.38.1621957049734; Tue, 25 May 2021 08:37:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+987Gi5+Ao8HMeMYgLg1iRQPtEoehGdM6F2GQdq0/O5MID6l689lcRPzuTI/mRpkYixi0xw== X-Received: by 2002:a05:600c:3510:: with SMTP id h16mr23939807wmq.38.1621957049395; Tue, 25 May 2021 08:37:29 -0700 (PDT) Received: from ?IPv6:2003:d8:2f38:2400:62f4:c5fa:ba13:ac32? (p200300d82f38240062f4c5faba13ac32.dip0.t-ipconnect.de. [2003:d8:2f38:2400:62f4:c5fa:ba13:ac32]) by smtp.gmail.com with ESMTPSA id b10sm19416681wrr.27.2021.05.25.08.37.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 May 2021 08:37:29 -0700 (PDT) To: "Qian Cai (QUIC)" , Mike Rapoport Cc: Andrew Morton , Catalin Marinas , Anshuman Khandual , Ard Biesheuvel , Linux Memory Management List , Will Deacon , Marc Zyngier , Linux Kernel Mailing List , Linux ARM References: From: David Hildenbrand Organization: Red Hat Subject: Re: Arm64 crash while reading memory sysfs Message-ID: <1c81f7d0-06f8-1f4e-c639-4a9878751cb4@redhat.com> Date: Tue, 25 May 2021 17:37:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210525_083735_111257_247D3600 X-CRM114-Status: GOOD ( 13.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 25.05.21 17:25, Qian Cai (QUIC) wrote: > Reverting the patchset "arm64: drop pfn_valid_within() and simplify pfn_valid()" [1] from today's linux-next fixed a crash while reading files under /sys/devices/system/memory. > > [1] https://lore.kernel.org/kvmarm/20210511100550.28178-1-rppt@kernel.org/ > > [ 247.669668][ T1443] kernel BUG at include/linux/mm.h:1383! > [ 247.675987][ T1443] Internal error: Oops - BUG: 0 [#1] SMP > [ 247.681472][ T1443] Modules linked in: loop processor efivarfs ip_tables x_tables ext4 mbcache jbd2 dm_mod igb i2c_algo_bit nvme mlx5_core i2c_core nvme_core firmware_class > [ 247.696894][ T1443] CPU: 15 PID: 1443 Comm: ranbug Not tainted 5.13.0-rc3-next-20210524+ #11 > [ 247.705326][ T1443] Hardware name: MiTAC RAPTOR EV-883832-X3-0001/RAPTOR, BIOS 1.6 06/28/2020 > [ 247.713842][ T1443] pstate: 60000005 (nZCv daif -PAN -UAO -TCO BTYPE=--) > [ 247.720536][ T1443] pc : test_pages_in_a_zone+0x23c/0x300 > [ 247.725935][ T1443] lr : test_pages_in_a_zone+0x23c/0x300 > [ 247.731327][ T1443] sp : ffff800023f8f670 > [ 247.735327][ T1443] x29: ffff800023f8f670 x28: 000000000000a000 x27: 000000000000a000 > [ 247.743156][ T1443] x26: ffffffbfffe00000 x25: ffff800011c6f738 x24: dfff800000000000 > [ 247.750984][ T1443] x23: 0000000000002000 x22: ffff009f7efa29c0 x21: 0000000000000000 > [ 247.758812][ T1443] x20: ffffffffffffffff x19: 0000000000008000 x18: ffff00084f9d3370 > [ 247.766640][ T1443] x17: 0000000000000000 x16: 0000000000000007 x15: 0000000000000078 > [ 247.774467][ T1443] x14: 0000000000000000 x13: ffff800011c6eea4 x12: ffff60136cee0574 > [ 247.782295][ T1443] x11: 1fffe0136cee0573 x10: ffff60136cee0573 x9 : dfff800000000000 > [ 247.790123][ T1443] x8 : ffff009b67702b9b x7 : 0000000000000001 x6 : ffff009b67702b98 > [ 247.797951][ T1443] x5 : 00009fec9311fa8d x4 : ffff009b67702b98 x3 : 1fffe00109f3a529 > [ 247.805778][ T1443] x2 : 0000000000000000 x1 : 0000000000000000 x0 : 0000000000000034 > [ 247.813606][ T1443] Call trace: > [ 247.816738][ T1443] test_pages_in_a_zone+0x23c/0x300 > [ 247.821784][ T1443] valid_zones_show+0x1e0/0x298 > [ 247.826483][ T1443] dev_attr_show+0x50/0xc8 > [ 247.830747][ T1443] sysfs_kf_seq_show+0x164/0x368 > [ 247.835533][ T1443] kernfs_seq_show+0x130/0x198 > [ 247.840143][ T1443] seq_read_iter+0x344/0xd50 > [ 247.844581][ T1443] kernfs_fop_read_iter+0x32c/0x4a8 > [ 247.849625][ T1443] new_sync_read+0x2bc/0x4e8 > [ 247.854063][ T1443] vfs_read+0x18c/0x340 > [ 247.858066][ T1443] ksys_read+0xf8/0x1e0 > [ 247.862068][ T1443] __arm64_sys_read+0x74/0xa8 > [ 247.866591][ T1443] invoke_syscall.constprop.0+0xdc/0x1d8 > [ 247.872072][ T1443] do_el0_svc+0xe4/0x298 > [ 247.876162][ T1443] el0_svc+0x20/0x30 > [ 247.879906][ T1443] el0_sync_handler+0xb0/0xb8 > [ 247.884429][ T1443] el0_sync+0x178/0x180 > [ 247.888435][ T1443] Code: b0005ee1 912b8021 910b0021 97fc57ac (d4210000) > [ 247.895217][ T1443] ---[ end trace 4ff9f5cbe7443f54 ]--- > [ 247.900522][ T1443] Kernel panic - not syncing: Oops - BUG: Fatal exception > [ 247.907501][ T1443] SMP: stopping secondary CPUs > [ 247.912122][ T1443] Kernel Offset: disabled > [ 247.916296][ T1443] CPU features: 0x00000251,20000846 > [ 247.921340][ T1443] Memory Limit: none > [ 247.925100][ T1443] ---[ end Kernel panic - not syncing: Oops - BUG: Fatal exception ]--- That hole test_pages_in_a_zone() cruft has to go sooner or later. I have getting rid of that on my list (simply storing the single zone if any per memory block). We run into an uninitialized memmap, because the poison check in page_zone()->page_to_nid() triggers. I assume the memmap of a memory hole does not get initialized properly? -- Thanks, David / dhildenb _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel