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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 756E6C07E9D for ; Sat, 24 Sep 2022 01:03:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232814AbiIXBDQ (ORCPT ); Fri, 23 Sep 2022 21:03:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230363AbiIXBDN (ORCPT ); Fri, 23 Sep 2022 21:03:13 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C6EA124C0B; Fri, 23 Sep 2022 18:03:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663981392; x=1695517392; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=OBLqHu4HrfxZrshSMCaixAcofJF9yzq0ARl2qAoeSc8=; b=IaK6lJuBlyv1yFE6WKSNewwcNklMZOU+dDbn+dyJsIze8u33GW0q3cnt 44yGqHSrd2FlotsJ8glsAE1aFPzAmMH7PijkOXC+4VH9EUtiXQe2FHFJi d7NitaJ4nkDzv8yfTQxAOBatp3Ek1oIIJietz8qtIY2tbBS+2arZJM1cB TnNpN9syFusVk9SlZZicvUNU5p5U5DZpr6oHleX6xq23ywyX/P7RjH1q0 HeLIOxIqB205ycw4zwYTu/8flQgiN82Y6y8jrlGqMNRT9wIScuARTqBKD A/PFCIGx5XYOI++QxU/sjcdcInC6Ut9IiWmMGLnu8xHhHtCrB8iqsEc7B Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10479"; a="301620728" X-IronPort-AV: E=Sophos;i="5.93,340,1654585200"; d="scan'208";a="301620728" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2022 18:03:11 -0700 X-IronPort-AV: E=Sophos;i="5.93,340,1654585200"; d="scan'208";a="724350159" Received: from pameiner-mobl2.amr.corp.intel.com (HELO box.shutemov.name) ([10.252.58.236]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2022 18:03:05 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id D7FE51028F1; Sat, 24 Sep 2022 04:03:02 +0300 (+03) Date: Sat, 24 Sep 2022 04:03:02 +0300 From: "Kirill A. Shutemov" To: Tom Lendacky Cc: Dionna Amalie Glaze , Dave Hansen , Mel Gorman , Vlastimil Babka , Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , Joerg Roedel , Ard Biesheuvel , Andi Kleen , Kuppuswamy Sathyanarayanan , David Rientjes , Thomas Gleixner , Peter Zijlstra , Paolo Bonzini , Ingo Molnar , Dario Faggioli , Mike Rapoport , David Hildenbrand , Marcelo Cerri , tim.gardner@canonical.com, Khalid ElMously , philip.cox@canonical.com, the arch/x86 maintainers , Linux Memory Management List , linux-coco@lists.linux.dev, linux-efi , LKML , Mike Rapoport Subject: Re: [PATCHv7 02/14] mm: Add support for unaccepted memory Message-ID: <20220924010302.bwas4zbro37rrxai@box.shutemov.name> References: <20220810141959.ictqchz7josyd7pt@techsingularity.net> <2981e25e-9cda-518a-9750-b8694f2356b5@amd.com> <984e07ed-914f-93ca-a141-3fc8677878e0@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 22, 2022 at 09:31:12AM -0500, Tom Lendacky wrote: > On 9/8/22 14:28, Mike Rapoport wrote: > > On Thu, Sep 08, 2022 at 09:23:07AM -0700, Dionna Amalie Glaze wrote: > > > > > > > > Looks like the first access to the memory map fails, although I think > > > > it's not in INIT_LIST_HEAD() but rather in init_page_count(). > > > > > > > > I'd start with making sure that page_alloc::memmap_alloc() actually returns > > > > accepted memory. If you build kernel with CONFIG_DEBUG_VM=y the memory map > > > > will poisoned in this function, so my guess is it'd crash there. > > > > > > > > > > That's a wonderful hint, thank you! I did not run this test > > > CONFIG_DEBUG_VM set, but you think it's possible it could still be > > > here? > > > > It depends on how you configured your kernel. Say, defconfig does not set > > it. > > > > I also hit the issue at 256GB. My config is using CONFIG_SPARSEMEM_VMEMMAP > and fails in memmap_init_range() when attempting to add the first PFN. It > looks like the underlying page that is backing the vmemmap has not been > accepted (I receive a #VC 0x404 => page not validated). > > Kirill, is this a path that you've looked at? It would appear that somewhere > in the vmemmap_populate_hugepages() path, some memory acceptance needs to be > done for the pages that are used to back vmemmap. I'm not very familiar with > this code, so I'm not sure why everything works for a guest with 255GB of > memory, but then fails for a guest with 256GB of memory. Hm. I don't have machine that large at hands at the moment. And I have not looked at the codepath before. I will try to look into the issue. -- Kiryl Shutsemau / Kirill A. Shutemov