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 8CE1DC433FE for ; Thu, 13 Jan 2022 07:42:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F2C636B008A; Thu, 13 Jan 2022 02:42:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EDBFB6B008C; Thu, 13 Jan 2022 02:42:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA40A6B0092; Thu, 13 Jan 2022 02:42:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0242.hostedemail.com [216.40.44.242]) by kanga.kvack.org (Postfix) with ESMTP id C63816B008A for ; Thu, 13 Jan 2022 02:42:18 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7B229181D75B4 for ; Thu, 13 Jan 2022 07:42:18 +0000 (UTC) X-FDA: 79024470756.03.F98804A Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf15.hostedemail.com (Postfix) with ESMTP id F35D6A0003 for ; Thu, 13 Jan 2022 07:42:17 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2E577B82186; Thu, 13 Jan 2022 07:42:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3ED3DC36AE3; Thu, 13 Jan 2022 07:42:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642059735; bh=YhsgT/VGvn7iC/tWrV+hAmkAlLPkGfoehuUgvcT8PxQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=afoWXEa6BISUUp8I9HVzp7qlC7k1nW4vb1wONJSckOZNzpBEk2Oen3EtDwVSw+1El xx/9f2+bKgCToDN1Ictko8OP+u9pyjh/q/zt+zKsQVvdlXPBCDftMBwEwoY8FPrLl+ mqWoagur7cWNCiXf2mElwp9eAucVF9q6l5MR9tFNzKo9blsdwM6pOUsjwOaE9BcUnH k6KMX/cJqDVsW+SjUZPwz/hbJWpiqDejLZ1u+472+BTau+8USPjn7TZYy0xCdpZeBl RjMDP9/liJmWJNYCG6p9FTPgT7dhKIskJ9f0/hvhdygA/icU/xPh7pN+9ce/lyO4zh GeoIpPIGhXuJw== Date: Thu, 13 Jan 2022 09:42:03 +0200 From: Mike Rapoport To: Dave Hansen Cc: "Kirill A. Shutemov" , "Kirill A. Shutemov" , Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , Joerg Roedel , Ard Biesheuvel , Andi Kleen , Kuppuswamy Sathyanarayanan , David Rientjes , Vlastimil Babka , Tom Lendacky , Thomas Gleixner , Peter Zijlstra , Paolo Bonzini , Ingo Molnar , Varad Gautam , Dario Faggioli , x86@kernel.org, linux-mm@kvack.org, linux-coco@lists.linux.dev, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv2 1/7] mm: Add support for unaccepted memory Message-ID: References: <20220111113314.27173-1-kirill.shutemov@linux.intel.com> <20220111113314.27173-2-kirill.shutemov@linux.intel.com> <3a68fabd-eaff-2164-5609-3a71fd4a7257@intel.com> <20220112183054.uedczc4ldntrj25j@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: F35D6A0003 X-Stat-Signature: wrdgwrs9hftbcj8ocen5kk3geqcnwn1r Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=afoWXEa6; spf=pass (imf15.hostedemail.com: domain of rppt@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-HE-Tag: 1642059737-280706 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 Wed, Jan 12, 2022 at 10:40:53AM -0800, Dave Hansen wrote: > On 1/12/22 10:30, Kirill A. Shutemov wrote: > > On Tue, Jan 11, 2022 at 11:46:37AM -0800, Dave Hansen wrote: > > > > diff --git a/mm/memblock.c b/mm/memblock.c > > > > index 1018e50566f3..6dfa594192de 100644 > > > > --- a/mm/memblock.c > > > > +++ b/mm/memblock.c > > > > @@ -1400,6 +1400,7 @@ phys_addr_t __init memblock_alloc_range_nid(phys_addr_t size, > > > > */ > > > > kmemleak_alloc_phys(found, size, 0, 0); > > > > + accept_memory(found, found + size); > > > > return found; > > > > } > > > > > > This could use a comment. > > > > How about this: > > > > /* > > * Some Virtual Machine platforms, such as Intel TDX or AMD SEV-SNP, > > * requiring memory to be accepted before it can be used by the > > * guest. > > * > > * Accept the memory of the allocated buffer. > > */ > > I think a one-liner that might cue the reader to go look at accept_memory() > itself would be fine. Maybe: > > /* Make the memblock usable when running in picky VM guests: */ I'd s/memblock/found range/ or something like that, memblock is too vague IMO > That implies that the memory isn't usable without doing this and also points > out that it's related to running in a guest. -- Sincerely yours, Mike.