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 2C906C48BC1 for ; Wed, 14 Feb 2024 16:57:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AF3256B009D; Wed, 14 Feb 2024 11:57:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AA28C6B009E; Wed, 14 Feb 2024 11:57:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 943556B009F; Wed, 14 Feb 2024 11:57:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 808106B009D for ; Wed, 14 Feb 2024 11:57:12 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 46254C0DEA for ; Wed, 14 Feb 2024 16:57:12 +0000 (UTC) X-FDA: 81791014704.12.6A0D287 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by imf10.hostedemail.com (Postfix) with ESMTP id 13216C001E for ; Wed, 14 Feb 2024 16:57:08 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=linux.microsoft.com header.s=default header.b=bcp4Da1B; dmarc=pass (policy=none) header.from=linux.microsoft.com; spf=pass (imf10.hostedemail.com: domain of jpiotrowski@linux.microsoft.com designates 13.77.154.182 as permitted sender) smtp.mailfrom=jpiotrowski@linux.microsoft.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1707929829; a=rsa-sha256; cv=none; b=yEECFAthF8FJDRaPgJYYPizvULpQj+BoIBuB/Jp8jM9ODzrbjTJGP5YZHD2xsud9sumQCm cFXo6qGEYfRiMNLXTZ+G8076CO/JBQlmLZxTPzJbj/sUAzki10gO/n/e/g4GD/XwmciIrw rBeY29Lk+3/Bf/B7AYY4qkYUI5NccEs= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=linux.microsoft.com header.s=default header.b=bcp4Da1B; dmarc=pass (policy=none) header.from=linux.microsoft.com; spf=pass (imf10.hostedemail.com: domain of jpiotrowski@linux.microsoft.com designates 13.77.154.182 as permitted sender) smtp.mailfrom=jpiotrowski@linux.microsoft.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1707929829; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ckiTjQJyYMqOqp6nmIcopayJUmMXUp+ALCH4tNreFgA=; b=hfDbzRudiCJ0qG8JVnnS3BmoTmsvdXPqet6yVjkx/RRQ0KONH4QCNjiwi6cCsUYmONqEat /G34F/9MCAhqPSr0SFdUDpCTUQECyD4joiP65vlBKEGIzt8OvW/8x9fWXaoN7F3U+a3zfY HlXAlHuyPvpxsetsq08afcOb71k+XOE= Received: from [100.66.32.72] (unknown [108.143.43.187]) by linux.microsoft.com (Postfix) with ESMTPSA id 4C6E120B2000; Wed, 14 Feb 2024 08:56:59 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4C6E120B2000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1707929827; bh=ckiTjQJyYMqOqp6nmIcopayJUmMXUp+ALCH4tNreFgA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=bcp4Da1BitmockWhF96LYrtqTtYF1wsfqg1TsvWy2uwN7ngUJtjxpHOsFsOFkYRJo Oc1JJKqKMD6tBVucLCv3I/J+wJYE56PeZVCCO7qQ3ND3CBRPqEuGxsTyjNc2QPe9EQ 6yEqS9dEv9MTe2x16MuoGJbktHyukuLjD1rAvyRk= Message-ID: Date: Wed, 14 Feb 2024 17:56:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 04/26] x86/sev: Add the host SEV-SNP initialization support To: Borislav Petkov , Michael Roth Cc: x86@kernel.org, kvm@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, jroedel@suse.de, thomas.lendacky@amd.com, hpa@zytor.com, ardb@kernel.org, pbonzini@redhat.com, seanjc@google.com, vkuznets@redhat.com, jmattson@google.com, luto@kernel.org, dave.hansen@linux.intel.com, slp@redhat.com, pgonda@google.com, peterz@infradead.org, srinivas.pandruvada@linux.intel.com, rientjes@google.com, tobin@ibm.com, vbabka@suse.cz, kirill@shutemov.name, ak@linux.intel.com, tony.luck@intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, alpergun@google.com, jarkko@kernel.org, ashish.kalra@amd.com, nikunj.dadhania@amd.com, pankaj.gupta@amd.com, "liam.merwick@oracle.com Brijesh Singh" References: <20231230161954.569267-1-michael.roth@amd.com> <20231230161954.569267-5-michael.roth@amd.com> <20240105160916.GDZZgprE8T6xbbHJ9E@fat_crate.local> <20240105162142.GEZZgslgQCQYI7twat@fat_crate.local> <0c4aac73-10d8-4e47-b6a8-f0c180ba1900@linux.microsoft.com> <20240108170418.GDZZwrEiIaGuMpV0B0@fat_crate.local> <20240109122906.GCZZ08Esh86vhGwVx1@fat_crate.local> <20240109124440.GDZZ0/uDY9RRPIOxOB@fat_crate.local> Content-Language: en-US From: Jeremi Piotrowski In-Reply-To: <20240109124440.GDZZ0/uDY9RRPIOxOB@fat_crate.local> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 13216C001E X-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TOmKTaESQRiafSsLHVzR6zU6scFdpKrrPs4s/CzYFhfjj+jpxoIh3bCYIvCxA9u+Avoq54fif5b40u9K20CpkSq3HkfmAQ9Be8jt10YtRfY/pKu0RKBohmb5ba0zCFyEYKy3fon6uit1WpVlCaJdHIf9tfadvPOFHB/mQJOdLSVTTQuJwv/RA2W9uCFcmdtbLx+5Zw4ertp3SpJwja8aamdCmAlcEbk 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: List-Subscribe: List-Unsubscribe: On 09/01/2024 13:44, Borislav Petkov wrote: > On Tue, Jan 09, 2024 at 01:29:06PM +0100, Borislav Petkov wrote: >> At least three issues I see with that: >> >> - the allocation can fail so it is a lot more convenient when the >> firmware prepares it >> >> - the RMP_BASE and RMP_END writes need to be verified they actially did >> set up the RMP range because if they haven't, you might as well >> throw SNP security out of the window. In general, letting the kernel >> do the RMP allocation needs to be verified very very thoroughly. >> >> - a future feature might make this more complicated > > - What do you do if you boot on a system which has the RMP already > allocated in the BIOS? > > - How do you detect that it is the L1 kernel that must allocate the RMP? > > - Why can't you use the BIOS allocated RMP in your scenario too instead > of the L1 kernel allocating it? > > - ... > > I might think of more. > Sorry for not replying back sooner. I agree, lets get the base SNP stuff in and then talk about extensions. I want to sync up with Michael to make sure he's onboard with what I'm proposing. I'll add more design/documentation/usecase descriptions with the next submission and will make sure to address all the issues you brought up. Jeremi