Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp291526iol; Thu, 9 Jun 2022 04:05:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrV2Ohfp9oxi5su2v4ARbrEUVLlKsfZvQqhOWMXaq2ANsMQZ6fwmJ4gTY3EGGnRdUxTvgV X-Received: by 2002:a63:f95c:0:b0:3fd:7e21:749e with SMTP id q28-20020a63f95c000000b003fd7e21749emr22495549pgk.49.1654772734917; Thu, 09 Jun 2022 04:05:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654772734; cv=none; d=google.com; s=arc-20160816; b=An9EbSGaqjW3CzyrLA7IJp+5ulahS+mJiCLqodRBefnE/XNbHz54QZpXem7L4sVO5P CFLffFsxxuVDKACfFjimUPbPXbcUrm+uzvfKMMSeTfbnpw5NyHRqoFr5vU5dO6Iul9I5 LLgk2gm+Nrq/Lc8UZj6XJew65dj0o4voLdr72jQbmt7S0+Ii+ZoQ8a7OkqLgkGI8N/O3 kQzDraT6QRwVJf2iOI3efLkY1mshqjcQ5/F7G6G2PC4V1b7ZxYUeAqnYOSYgISPh15Zx sixuowdm55xIKrn9hsDWeGARo4J0+8HYv8pW2RAuiqdy8yE5O8rfu+OZlYT4GFy94OkQ wL+g== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Np7YrPcfLeFAKnwmz1CrcZRCc5QB3obYyAGTIJ556jA=; b=rE/mJ04AWG0OzIOY/N2FUZXOBX93RlsV/pwg9OjYs3QRz5Ir2KkTQzRwpIr9eGMh/K MBt19n1/aUt3r1Wr9Nj1cE3ZwDPA+DfE7oOCFPke2aYwHRVjXYw7S2fvIy2a6opmA/ix Cx7H4naO2+mXjYPj43wfyXUHZNM5RAVbZ4vdXi+q1S7EJ2wfBnim23pmhyvYIB42U1zR f3tEeQVwn1gOS4lb/IfXnnXovJ8H9fMM+YQFN9aaLXWlJX0iXrR0eiGKlAKK4hyiSrEG XFhF9rLcHQxouLd5fg4yOTlUDFryjHUMvgP4BtKu/VTiMp3DEBeWCy7GDrNy1jVV0t6I VRaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HhlUSxnf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j3-20020a056a00174300b0051bcd7f3cd6si30513612pfc.278.2022.06.09.04.05.21; Thu, 09 Jun 2022 04:05:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HhlUSxnf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232917AbiFIKME (ORCPT + 99 others); Thu, 9 Jun 2022 06:12:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbiFIKMD (ORCPT ); Thu, 9 Jun 2022 06:12:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D7391D0BC4; Thu, 9 Jun 2022 03:12:02 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 18AC061D28; Thu, 9 Jun 2022 10:12:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18FBCC34114; Thu, 9 Jun 2022 10:11:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654769521; bh=IVNlOmdDGOUhLFAR3nMIzH30XrHdkBsJEHd4SHkHy+g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HhlUSxnfqr0u9JH7JbuMdZrEG4QsD6BUNaeNixZyQEzJMe3i1KaBrT7YovYLrYDju di83tadCSFZwPXQnB1q+h4vGM2TctQ76ZM1gThy3w8+A1eETccBhkl3Af2POKnmP5P CoO7tIs9BK7N7pbqYiJJGb8gQDM1z9MhHFjslQeRB/i6bGJGlc9bZo1cBq3nyhWw8C bQHBnxH43LxJxyqcrwxEwdhYUUtDorw984yXTKhlWXckHpAfu4fnj7uH0/+GzPw8Sv 2DG1VZ7HJQRYdD/3nCg6gFN9LkpGguOFjg43y0muhNrCXZ9GloCwq44NNlAcsQcAN/ Foiy1l4SyhOmA== Date: Thu, 9 Jun 2022 11:11:54 +0100 From: Will Deacon To: Kefeng Wang Cc: Vasily Averin , Naresh Kamboju , Shakeel Butt , Linux ARM , Stephen Rothwell , Linux-Next Mailing List , open list , regressions@lists.linux.dev, lkft-triage@lists.linaro.org, linux-mm , Andrew Morton , Ard Biesheuvel , Arnd Bergmann , Catalin Marinas , Raghuram Thammiraju , Mark Brown , Roman Gushchin , Qian Cai Subject: Re: [next] arm64: boot failed - next-20220606 Message-ID: <20220609101153.GB2187@willie-the-truck> References: <20220607162504.7fd5a92a@canb.auug.org.au> <2a4cc632-c936-1e42-4fdc-572334c58ee1@openvz.org> <44530040-0384-796e-143f-b7293886753c@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <44530040-0384-796e-143f-b7293886753c@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 Thu, Jun 09, 2022 at 11:44:09AM +0800, Kefeng Wang wrote: > On 2022/6/9 10:49, Vasily Averin wrote: > > mem_cgroup_from_obj(): > > ffff80000836cf40: d503245f bti c > > ffff80000836cf44: d503201f nop > > ffff80000836cf48: d503201f nop > > ffff80000836cf4c: d503233f paciasp > > ffff80000836cf50: d503201f nop > > ffff80000836cf54: d2e00021 mov x1, #0x1000000000000 // #281474976710656 > > ffff80000836cf58: 8b010001 add x1, x0, x1 > > ffff80000836cf5c: b25657e4 mov x4, #0xfffffc0000000000 // #-4398046511104 > > ffff80000836cf60: d34cfc21 lsr x1, x1, #12 > > ffff80000836cf64: d37ae421 lsl x1, x1, #6 > > ffff80000836cf68: 8b040022 add x2, x1, x4 > > ffff80000836cf6c: f9400443 ldr x3, [x2, #8] > > > > x5 : ffff80000a96f000 x4 : fffffc0000000000 x3 : ffff80000ad5e680 > > x2 : fffffe00002bc240 x1 : 00000200002bc240 x0 : ffff80000af09740 > > > > x0 = 0xffff80000af09740 is an argument of mem_cgroup_from_obj() > > according to System.map it is init_net > > > > This issue is caused by calling virt_to_page() on address of static variable init_net. > > Arm64 consider that addresses of static variables are not valid virtual addresses. > > On x86_64 the same API works without any problem. This just depends on whether or not the kernel is running out of the linear mapping or not. On arm64, we use the vmalloc area for the kernel image and so virt_to_page() won't work, just like it won't work for modules on other architectures. How are module addresses handled by mem_cgroup_from_obj()? > > Unfortunately I do not understand the cause of the problem. > > I do not see any bugs in my patch. > > I'm using an existing API, mem_cgroup_from_obj(), to find the memory cgroup used > > to account for the specified object. > > In particular, in the current case, I wanted to get the memory cgroup of the > > specified network namespace by the name taken from for_each_net(). > > The first object in this list is the static structure unit_net > > root@test:~# cat /proc/kallsyms |grep -w _data > ffff80000a110000 D _data > root@test:~# cat /proc/kallsyms |grep -w _end > ffff80000a500000 B _end > root@test:~# cat /proc/kallsyms |grep -w init_net > ffff80000a4eb980 B init_net > > the init_net is located in data section, on arm64, it is allowed by vmalloc, > see > > ??? map_kernel_segment(pgdp, _data, _end, PAGE_KERNEL, &vmlinux_data, 0, 0); > > and the arm has same behavior. > > We could let init_net be allocated dynamically, but I think it could change > a lot. > > Any better sugguestion, Catalin? For this specific issue, can you use lm_alias to get a virtual address suitable for virt_to_page()? My question about modules still applies though. Will