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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53785C07E9D for ; Mon, 26 Sep 2022 15:42:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AA3768E0068; Mon, 26 Sep 2022 11:42:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A530A8E0066; Mon, 26 Sep 2022 11:42:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F29E8E0068; Mon, 26 Sep 2022 11:42:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 813778E0066 for ; Mon, 26 Sep 2022 11:42:17 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 47A1EAB062 for ; Mon, 26 Sep 2022 15:42:17 +0000 (UTC) X-FDA: 79954653114.07.0CEBE63 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by imf21.hostedemail.com (Postfix) with ESMTP id 922C01C0005 for ; Mon, 26 Sep 2022 15:42:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664206936; x=1695742936; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=tM/bAWc4lIOzRDGri9usGwnWw/hVhQodCyKKUpoDK+8=; b=UYf/aAvwM0mn2bM1VXRDOo5uARmMAo5s5CU3NrFdGuGjXRZfK6Q3k5RV NDjUkzStBPr3kP7ivPRPYssj7Gqs9/4E+sOBw1kPnyYBPUYVuvVL9h6Ar j1jKnqq7sIXFPdAJ2tcwgIasSp9JhvX2kC7qoxoCWU8jR559H2qaFFBAS 3wi4iwOKYC41Pov2J18ek9Fj29S0YzdZVYFi7avNvyfCaCRBZKaO8J7sb RolPQZKH3gMwATo3AZKeAY7vYBFdsLjNgj+kBe5uc0P4oI0NrXGZIplQt ohvbfXFpOhMDKZwFR5UTUPxnLv5eslEH6zHhHXTog9rQAInjGvmnmxGSG w==; X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="301043489" X-IronPort-AV: E=Sophos;i="5.93,346,1654585200"; d="scan'208";a="301043489" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.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> ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b="UYf/aAvw"; spf=none (imf21.hostedemail.com: domain of kirill.shutemov@linux.intel.com has no SPF policy when checking 192.55.52.115) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=fail reason="No valid SPF" header.from=intel.com (policy=none) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664206937; a=rsa-sha256; cv=none; b=z2f+ZiLWOgqkdSMfRoyg32zwe5jG/cSnF0hBu2v35FOaIPFbz0TIyuPEBOHnZHtw35SKjT RHtGkJPSMdQpznAwP/YFnUSjhqwHfnroQN4kWZSdutbLcREVemBqPOXivDU15baZjc73sW IGod0JgHhqK4MbWSeoyX8iOWAk7Qs1U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664206937; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=2XDaPfMcbD3y2b1AgtP43ZXh6lSnXDX1bZjVeATyoBo=; b=q+oJaXJKvs1nJ1rQnfB24twsqp2O/hHes3PzylOSAxojVCjYEoomJgV2Egkcr5JnpEO+ve a6uDW3CSrrNXhUKXidfR5M5FjVCw2GLszj3HQTdMsPIsvOnVgpJzgoZ/nlIkTEkPf99nnR nZsGcD1GlRxT+OsMyyasuVFagv2g+o8= X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 922C01C0005 X-Rspam-User: Authentication-Results: imf21.hostedemail.com; dkim=none ("invalid DKIM record") header.d=intel.com header.s=Intel header.b="UYf/aAvw"; spf=none (imf21.hostedemail.com: domain of kirill.shutemov@linux.intel.com has no SPF policy when checking 192.55.52.115) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=fail reason="No valid SPF" header.from=intel.com (policy=none) X-Stat-Signature: u1w9iq9xie4sgb7rtphqt39n6jnuen75 X-HE-Tag: 1664206936-348954 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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