Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp567374iol; Thu, 9 Jun 2022 09:12:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNkNlREnRPqZ4/AdJIudOk2akOkNhWdSt07KiPAt8aP045sKCdRIokthQuXK1283cUi8Xt X-Received: by 2002:a17:90a:448c:b0:1ea:653c:282a with SMTP id t12-20020a17090a448c00b001ea653c282amr2700353pjg.15.1654791127903; Thu, 09 Jun 2022 09:12:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654791127; cv=none; d=google.com; s=arc-20160816; b=v7odoAy54Fcsfcb/4WhTo/1ipdVoAucOWqXS0MLxQZACu23VZD/cV6QtFv5S8ebb/9 oSdsqONjTTGvm9pGY0Zma3Ln+3J/tMvUgnGrKakrdW+k8eWbJ7FS8+GTMlfgu3kDjdCF rzoMgoJAKHb9E9PJMGwIarVMJEfgtKQ+2CJ6V1gDXk4RiwO3DWVAPvGe/suXvnkhoQEk keRbaPWUMwAeIZVOnkJpi0VVoQ7tdzt1bUa7XEF+jOCYxKQF3hsKMRIL3MZbZnqSbfzF xqNpR3+JhOgVBjCavd5Vn1vKL/HrsJOb3OqY3oOTqmubRHT8S6VVOYd1UAKxSQsUC8oB zbHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=YV7RC7djtxI0kHw5S5FDRQb2joRqGeuY1mF5zw0phKk=; b=DpMv8Sj4gSOUCBTn0nI2y0NoI37dSlyYOCdzV1OK86HZcztQjrSg1ymiUtjZQJGMNE lw7zecBFoRJN5KTUsmxJSyLpjqRaoOVFS50RFZ7TUTad4UlS5ZDjMFSgYqt3cf7pxyDH 9Y5zdNi1f/bvt1rU3WoH16xEUlSuk2vyx2ZgNQGFO8rhorlfUK2YtUMCR7Iv9zlo+dm+ jT4w9GaRWLlrrLa/dAb4+tuzUPXBce0jj3HA0Bnzzku00KVcxHbQwRoy6yIaOCWHoQux 53FF8YjI4VYJXZdYjcob5iPWfs7Iavmp4hkiXTd1ddzEiyoXqfZ0EPkn/BrN+VTJkZ6U Biuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=lSf0tQld; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t7-20020a170902e84700b00153b2d165c6si34952123plg.462.2022.06.09.09.11.40; Thu, 09 Jun 2022 09:12:07 -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=@google.com header.s=20210112 header.b=lSf0tQld; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344456AbiFIPXt (ORCPT + 99 others); Thu, 9 Jun 2022 11:23:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243952AbiFIPXi (ORCPT ); Thu, 9 Jun 2022 11:23:38 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A17CF1D for ; Thu, 9 Jun 2022 08:23:37 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id w21so21404666pfc.0 for ; Thu, 09 Jun 2022 08:23:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YV7RC7djtxI0kHw5S5FDRQb2joRqGeuY1mF5zw0phKk=; b=lSf0tQldx/w/ULdeiOjWFksRRZOHkwFQ+zi7S6eUMpPE+euTNq3HfakFsiKn+akZgA BYsNOZN6AKF8VG7tGzdoYC3XsUS9zpNzK4OTBz8SkU/vOjzA6DCrzImFZh8K5L5045nO gtaGCeNE0sEYaJtDzQI5dYct1BCJ/LUA0kDrZ29TbBynMGr3m+1dUjIO/8+rinAeI8Ge ZM4yM/D1Q/S8svh4b8VSGnrbrPC6w7hLXcJ2xNJO9bZ0AbME7FRMvC58Wsw5XYedMd43 VYw31UYqRn0Gr/rFapRiPydIJmWwSdOVdFFbZ/5OT8ysrKDH3W9qbrHeYJTS7UfCRGnm J0ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YV7RC7djtxI0kHw5S5FDRQb2joRqGeuY1mF5zw0phKk=; b=ri5AEYXhDyVEcknPKs+OvaCVQx95XEZCnd7nxGgb/HhAc4immX4kQTPDLAhe5oYya/ Nh/1IEyAe0dRQRM/fUVj2xXEhFzgczdz8UgR59Eq21U0Xz2+tK6uS/TWUKCiSVb0WBcV VVSrwz6ITDNO7w4rF6XRGx5KNwRhAGS2J+jpwDQS3TSDt8Xr8RAQihDVnVVYOmbVDbrp sookMM5Qvm2LgoR0KgZaaskCtMLsDlX+AlYxNIHf3YeJtbheF48uvU8X7fFb6Xghn5if wLmp1s1yW1HQ9GhF6c2QpONL4gAnsPpP8g30XWkCC4dct2cE9RI4WUBZFinoIKZpH/Pq z1og== X-Gm-Message-State: AOAM5335FBgeDuSZsbPKaK7pTMQ4mEm0ejG4fa41kyuwJgka/Ljsc27h JK/1CFuGaTTCjAn8F+P42vVHIFCseCZfFh6E2aIuJg== X-Received: by 2002:a05:6a00:889:b0:510:91e6:6463 with SMTP id q9-20020a056a00088900b0051091e66463mr40895230pfj.58.1654788216841; Thu, 09 Jun 2022 08:23:36 -0700 (PDT) MIME-Version: 1.0 References: <20220607162504.7fd5a92a@canb.auug.org.au> <2a4cc632-c936-1e42-4fdc-572334c58ee1@openvz.org> <44530040-0384-796e-143f-b7293886753c@huawei.com> <20220609101153.GB2187@willie-the-truck> In-Reply-To: From: Shakeel Butt Date: Thu, 9 Jun 2022 08:23:25 -0700 Message-ID: Subject: Re: [next] arm64: boot failed - next-20220606 To: Catalin Marinas Cc: Will Deacon , Kefeng Wang , Vasily Averin , Naresh Kamboju , 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 , Raghuram Thammiraju , Mark Brown , Roman Gushchin , Qian Cai Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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 Thu, Jun 9, 2022 at 3:26 AM Catalin Marinas wrote: > > On Thu, Jun 09, 2022 at 11:11:54AM +0100, Will Deacon wrote: > > 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()? > > It doesn't look like they are handled in any way. It just expects the > pointer to be a linear map one. Yes, that is correct. > Something like below: > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 27cebaa53472..795bf3673fa7 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -2860,6 +2860,11 @@ struct mem_cgroup *mem_cgroup_from_obj(void *p) > if (mem_cgroup_disabled()) > return NULL; > > + if (is_module_address((unsigned long)p)) > + return NULL; > + else if (is_kernel((unsigned long)p)) > + return NULL; > + How about just is_vmalloc_addr(p) check? It should cover modules and also arm64 using vmalloc for kernel image cases. > folio = virt_to_folio(p); > > /* > > -- > Catalin