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 EEA14C43334 for ; Fri, 22 Jul 2022 19:25:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 73D256B0072; Fri, 22 Jul 2022 15:25:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6EC7E6B0073; Fri, 22 Jul 2022 15:25:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5B3FD6B0074; Fri, 22 Jul 2022 15:25:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 4D3866B0072 for ; Fri, 22 Jul 2022 15:25:24 -0400 (EDT) Received: from smtpin31.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 277A5C0D42 for ; Fri, 22 Jul 2022 19:25:24 +0000 (UTC) X-FDA: 79715714568.31.2364045 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by imf12.hostedemail.com (Postfix) with ESMTP id 3510140096 for ; Fri, 22 Jul 2022 19:25:23 +0000 (UTC) Received: from zn.tnic (p200300ea97297665329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9729:7665:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id D2EA11EC0666; Fri, 22 Jul 2022 21:25:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1658517917; h=from:from: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; bh=nT/WxNPGWSJTO6+kQuM3FOwCYg2A+BIY4xCaAU3c0V8=; b=AC06S3LGPe5h73iTbcHpi4ZGg7ColSwTlaajXCs+e2KG0bBZaYA37zBljXeX8xeIuwK+vo N/Dhea004+suCjTz60jAA9AWk2lXFYO7Ag6Vb5jbmotR9u08XqNiDH9vftOXWD/nvlDQtH 9edeomcKPYV/j5sCa5NTw6mjO8PhysQ= Date: Fri, 22 Jul 2022 21:25:17 +0200 From: Borislav Petkov To: Sean Christopherson Cc: "Kalra, Ashish" , Dave Hansen , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "linux-coco@lists.linux.dev" , "linux-mm@kvack.org" , "linux-crypto@vger.kernel.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "jroedel@suse.de" , "Lendacky, Thomas" , "hpa@zytor.com" , "ardb@kernel.org" , "pbonzini@redhat.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" , "dovmurik@linux.ibm.com" , "tobin@ibm.com" , "Roth, Michael" , "vbabka@suse.cz" , "kirill@shutemov.name" , "ak@linux.intel.com" , "tony.luck@intel.com" , "marcorr@google.com" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "alpergun@google.com" , "dgilbert@redhat.com" , "jarkko@kernel.org" Subject: Re: [PATCH Part2 v6 05/49] x86/sev: Add RMP entry lookup helpers Message-ID: References: <681e4e45-eff1-600c-9b81-1fa9bdf24232@intel.com> <99d72d58-a9bb-d75c-93af-79d497dfe176@intel.com> <5db37cc2-4fb1-7a73-c39a-3531260414d0@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658517923; a=rsa-sha256; cv=none; b=Ouk2J95cZsHp0t476TouyrSA65THPaAoCH6CW1d1hEFsJC39LelzUCXIKPBt12bFtA7ZlX WaOMy0yOGMQ1obeq0vAYIhdCUpzExbgHTLuIoNtcRXtNthL0bNdD5OoSZPwj8jTv3HUYFr nDX3z5nUJtqUbu6pIRRqtUbGMSg53Ik= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=alien8.de header.s=dkim header.b=AC06S3LG; dmarc=pass (policy=none) header.from=alien8.de; spf=pass (imf12.hostedemail.com: domain of bp@alien8.de designates 5.9.137.197 as permitted sender) smtp.mailfrom=bp@alien8.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658517923; 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=nT/WxNPGWSJTO6+kQuM3FOwCYg2A+BIY4xCaAU3c0V8=; b=RhtIX3VUM3AHK/qwCZhoEW8tAy+EsQi8QYSdnk5BPiHXs2rifJz0wgUB6CdwI5imSalNCV kjikF9RJvPCLvJmrHKvFCPv1JU5sc+2x8CT9tjRYFIyrVaGV06waLaLH/qkXnY1V7X8bYz rsD1DT2yTxox5UZd9z2FqYGlH6qkUHw= Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=alien8.de header.s=dkim header.b=AC06S3LG; dmarc=pass (policy=none) header.from=alien8.de; spf=pass (imf12.hostedemail.com: domain of bp@alien8.de designates 5.9.137.197 as permitted sender) smtp.mailfrom=bp@alien8.de X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 3510140096 X-Stat-Signature: yx9kotg9xue7nfra19doad74i7fxrzch X-HE-Tag: 1658517923-350285 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 Fri, Jul 22, 2022 at 07:04:23PM +0000, Sean Christopherson wrote: > I disagree. Running an old kernel on new hardware with a different RMP layout > should refuse to use SNP, not read/write garbage and likely corrupt the RMP and/or > host memory. See my example below. > And IMO, hiding the non-architectural RMP format in SNP-specific code so that we > don't have to churn a bunch of call sites that don't _need_ access to the raw RMP > format is a good idea regardless of whether we want to be optimistic or pessimistic > about future formats. I don't think I ever objected to that. > > This is nothing else but normal CPU enablement work - it should be done > > when it is really needed. > > <--- this here. > > Because the opposite can happen: you can add a model check which > > excludes future model X, future model X comes along but does *not* > > change the RMP format and then you're going to have to relax that model > > check again to fix SNP on the new model X. So constantly adding new models to a list which support a certain version of the RMP format doesn't scale either. If you corrupt the RMP because your kernel is old, you'll crash and burn very visibly so that you'll be forced to have to look for an updated kernel regardless. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette