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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 005E9C433EF for ; Thu, 9 Jun 2022 15:24:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fmheWPvVMzJMLP1EA5EHE+594kW6NJyZk13WUBpOPoA=; b=mbjo7Jg/ecHASD Gs3lCRDoNWlICX1mHj5lqYCIUiJ1uAHUNV/nR3tN8BuNewueuU4J1eTsL4RuQMG0fYz7396n1w3DA gQsomiS5hNMu1ncCeiQLGUHNan49MqfYab0aeOAVu4i3ICDuWJpazPwHhlyJA9DCm8Yr8pcqnrCi4 vtbOz4DJRwh40Sau+Mnp+cqgbhdzXF5G3ExeondZtE+pBDh2Tp6ujzgUufC0BqEurwbk9dycrIoH9 rrhFfEG/gEDTIYBDjnLheE0Fp1ZDm7Boqi4bJzXpRJTx73UTK0TbwtrsVq3PqwcI6TQcYqQ81PMJ6 TJisW+z8wp9OkywcUsPA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzK0c-002iGw-Cd; Thu, 09 Jun 2022 15:23:42 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzK0Z-002iFi-G3 for linux-arm-kernel@lists.infradead.org; Thu, 09 Jun 2022 15:23:40 +0000 Received: by mail-pf1-x436.google.com with SMTP id p8so21356655pfh.8 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=n1L5YtlhX5o46+IsglZj6qe3SPqFzdB6mOb+b7aGDr8vFqN+LDY0dfc50J1oO45YYx cFNkpT4nrvs2Sk+WfePAuVL73rLC+E4vAZRCXxVpuOkkJ6aNVX/kO9WM91stmGezDTkw 0fgZVk/vPzo4M0TpAYkUSC3nIVfJBUOLRmg30UMT4cWXqKHiJk8lqFptrrHB941uJCvo 5JoB3c9Jat2EeIVSQsyWdycxgy2UsmdwbmUJAQPKc2OFy2l8es0QEFvCDvIoZAHxh7NM HUAkeen2WDTGLWcazkTIXpCg+UBZpV8FcCBBMkF93i3X2E9Qdl23gQa1sy/0X7FIisRm ZnZg== X-Gm-Message-State: AOAM531kWCKWaWg7vi+1YY5Gw3zt7/RKHmH8xZIGNJf3jeRE1LOjh5km 3PJREqTQBv1LgkFnUS3BKGDXmni4+N8fhInTeIqfvfE88J7xdQ== X-Google-Smtp-Source: ABdhPJy/KwvUBHnh2VRlvCqbK+o5hSwHlwE0i9AJu6gcHX/fyizWfCV7lcs5p6BiMXf7TYQ8FWcrUdEhtuopEnRW2Zg= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220609_082339_593880_03F7957A X-CRM114-Status: GOOD ( 26.09 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel