Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp193073rwb; Mon, 26 Sep 2022 11:00:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7W8RQAh5JT+BXAA5fNwJda6uzHbHRFVhTvJxY2Qux1JdYsJOM+iSKLrGD38doBXibMtUzU X-Received: by 2002:a17:902:7082:b0:177:f7fc:5290 with SMTP id z2-20020a170902708200b00177f7fc5290mr22374875plk.143.1664215232641; Mon, 26 Sep 2022 11:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664215232; cv=none; d=google.com; s=arc-20160816; b=dz9WtW5MsoInn7o/NpE1PE+imtX6XwGUNky0fVifGnAnn+mdWRFhuxDbATqhP0RpjG 2EeADnMMXLcspuFrsxXXorl2kY4fsFbrC9WLp6SCBATpdwtOD6D5rBfTFuk8jxUZbSF1 u82DklHBZ34nGuBcK9Ox6OMdKRbwFizSzDA9352hWxg+1NFe+zFNwWwM24J5Z5Jke+GN cyO9o5yji4szipBSUbCjkwxDBtylsVpI5olDlOsbMEkHWSge+5KMor6RcXcvGNzcDKby mJi68QdqqoDBwDqGFLwkY6qNCn7B9FewJY8Wey2xWiinApTgZw3Tac4SXnlCdBf26Ilw lZHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2XDaPfMcbD3y2b1AgtP43ZXh6lSnXDX1bZjVeATyoBo=; b=WXlfFBSPd4kIsivnGcGkMSM0bp9Brajx8o/JDNOXKikZPI5hg3+239n9pKcDypzmzE fwrysXllXI9Bpgt7V3IyOs4P5pazYGKWpIoFyxuOpWtddDocWv49jdryuoaBRrCRhI3T pcVd9cq2oI6byh3Vro6E4TqqePHw1cdX+vyorAc9AaOO2q7rz9UOKK0Nqjg7txzkXtrk TMwcyhsWIMcVr3v71GAHyn5d3iV9car2j+yW+5tbdTFOABveCk6q8+teebGMq/gu08pE 6sOyUMFkThA15rWA1+apxhaFnCZ+qG8WQXlO1dfLBlorQIpFm9VmxFySQkQHK3hOPVqS 3IOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jmNwy5Dp; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id be13-20020a056a001f0d00b005283d3bb832si17024475pfb.193.2022.09.26.11.00.20; Mon, 26 Sep 2022 11:00:32 -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=@intel.com header.s=Intel header.b=jmNwy5Dp; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230002AbiIZQtY (ORCPT + 99 others); Mon, 26 Sep 2022 12:49:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229790AbiIZQsL (ORCPT ); Mon, 26 Sep 2022 12:48:11 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D2BC13F9A; Mon, 26 Sep 2022 08:42:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664206935; x=1695742935; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=tM/bAWc4lIOzRDGri9usGwnWw/hVhQodCyKKUpoDK+8=; b=jmNwy5DpPJXLlqBrxmv8a7UDyiLrrk+HKInodQ+cOUpBMD1+kIlfMsi+ VHXRj3I3IX+19gSMh1tlxfWnLQpfRcOX3HcL3rjEtSNQlbPGxwYNMp+9J wZuOtc6orcd0ChOFUHpSAAgJ0o6huVmuIl0zmC2dhrKa77LKBxd6S6Nhz tzN8XNXpw52NtQ5lrtk2gpJjC9gpm7xLlZFR+L3daN539+9cVh1E5ReC+ VR/gbLWxhemwbpmzMEhpcb14I+y3YyKDxy18v+YhIlQFJBMO9lBGZxqcn 3OFwr0nZm2tDxDZvTa3R9BOilrMswH9eA9oxDJsAtc9fR87K89lmNEwm1 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="298661884" X-IronPort-AV: E=Sophos;i="5.93,346,1654585200"; d="scan'208";a="298661884" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2022 08:42:15 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="710164368" X-IronPort-AV: E=Sophos;i="5.93,346,1654585200"; d="scan'208";a="710164368" Received: from hluxenbu-mobl1.ger.corp.intel.com (HELO box.shutemov.name) ([10.249.32.142]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2022 08:42:08 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id 64280104928; Mon, 26 Sep 2022 18:42:06 +0300 (+03) Date: Mon, 26 Sep 2022 18:42:06 +0300 From: "Kirill A. Shutemov" To: Tom Lendacky Cc: "Kirill A. Shutemov" , 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: <20220926154206.skzqxhw23wuaegtk@box.shutemov.name> References: <984e07ed-914f-93ca-a141-3fc8677878e0@intel.com> <20220924010302.bwas4zbro37rrxai@box.shutemov.name> <20220926121027.xc2cgzuiafcssmea@box.shutemov.name> <6a38e382-b9d6-98a1-d2ca-cd92fdfd8ecd@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6a38e382-b9d6-98a1-d2ca-cd92fdfd8ecd@amd.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_NONE 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 Mon, Sep 26, 2022 at 08:38:34AM -0500, Tom Lendacky wrote: > On 9/26/22 07:10, Kirill A. Shutemov wrote: > > On Sat, Sep 24, 2022 at 04:03:02AM +0300, Kirill A. Shutemov wrote: > > > 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. > > > > I'm not able to trigger the bug. > > > > With help of vm.overcommit_memory=1, I was managed boot TDX guest to shell > > with 256G and 1T of guest memory just fine. > > > > Any chance it is SEV-SNP specific? > > There's always a chance. I'll do some more tracing and see what I can find > to try and be certain. > > > > > Or maybe there some difference in kernel config? Could you share yours? > > Yes, I'll send that to you off-list. Still nothing with your config :/ -- Kiryl Shutsemau / Kirill A. Shutemov