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 88BCFC43334 for ; Fri, 22 Jul 2022 22:16:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BE9A76B0072; Fri, 22 Jul 2022 18:16:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B98DB6B0073; Fri, 22 Jul 2022 18:16:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A3B1F6B0074; Fri, 22 Jul 2022 18:16:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 924E56B0072 for ; Fri, 22 Jul 2022 18:16:13 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 5914F120DE2 for ; Fri, 22 Jul 2022 22:16:13 +0000 (UTC) X-FDA: 79716145026.02.4F41D7F Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by imf22.hostedemail.com (Postfix) with ESMTP id EFE9CC0008 for ; Fri, 22 Jul 2022 22:16:12 +0000 (UTC) Received: by mail-pf1-f182.google.com with SMTP id g12so5559979pfb.3 for ; Fri, 22 Jul 2022 15:16:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=DvsPToDBCg7LtgfTt0+32mRr4nwV5bDezHW9QGpUdCE=; b=tNKubLYYtWNcTQODGehA0A/1OYnUmUt4THz1nqFtzCXg5NEC1cRRSaX5PgITuSDLU6 G06p3vx+0Zy/5ssCW97K9rUlLfZc5yFeacry9qdLA/ORmYtTsf+hvAjNC/xJhwylqGqF GDCvsMr0WCfkILIrPPqjC2A917wnhXYY6gdaIIh24eyORjdpEc+eFQw4xlXwr0mFGOr8 t0qsu5NCtqCDFbFmwAmnJdfZpcKyrltXlmOvzMeAR2KO9zlFDgaPTuZOo1aTJBLWVqyE ee6wGHg3FjgjATQas4NYJjEgWhWbsJ+6+ttSV6V751uW+K/OWJqRkxFO+p/brT9lNe06 X/yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=DvsPToDBCg7LtgfTt0+32mRr4nwV5bDezHW9QGpUdCE=; b=BaWr1T6q20T5ReiVWiSlC3Us45jOGsIhjpxiadSgMJPE1nH0PQaUMpUN4IKTs7Ngt6 m2+fzFpYFTKE/qv2HlAIkgHrvstE9hAwICJ7gFnJGtCkrr7ZDKHBbZyHRAX6I/KLgX2Z 0xfS9q9rsDqHm9HP03bhdFuDHxdtr7E9XefNZnAblNUuXE69YyWZobWNXhObUOhgYLEK D1wzf8B1kGcAWNlmZlSd0JFbkfU/tY/YRjqhw6mlv+l1Jo4AGwZrvgiOO2bMA6Zbg794 XWDXWOXGdIj55CMczx1jvSlBhY/cXNDl3WD1GO+vXh7RRN7aYP/TcY4Ldmi5o0rrI6Yi A2AQ== X-Gm-Message-State: AJIora9NLggU/EYPrYr5aM9PEV5FJwYxcXPrDJ4gaI+Vy9aWt0QbFW2K oU4nOmBPUQj9jQxHFFGiiFlp2A== X-Google-Smtp-Source: AGRyM1sIc+nLzUHc1jVYbsv19cRcOoKn0TQ6YwR2BWbngZ0ui0Jg+GMpAVTUImqkVk1IcWXRZVwkvQ== X-Received: by 2002:a63:1246:0:b0:41a:58f:9fee with SMTP id 6-20020a631246000000b0041a058f9feemr1538198pgs.413.1658528171605; Fri, 22 Jul 2022 15:16:11 -0700 (PDT) Received: from google.com (123.65.230.35.bc.googleusercontent.com. [35.230.65.123]) by smtp.gmail.com with ESMTPSA id 30-20020a63185e000000b0041296bca2a8sm3769062pgy.12.2022.07.22.15.16.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jul 2022 15:16:10 -0700 (PDT) Date: Fri, 22 Jul 2022 22:16:07 +0000 From: Sean Christopherson To: Borislav Petkov 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: <99d72d58-a9bb-d75c-93af-79d497dfe176@intel.com> <5db37cc2-4fb1-7a73-c39a-3531260414d0@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658528173; 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=DvsPToDBCg7LtgfTt0+32mRr4nwV5bDezHW9QGpUdCE=; b=dZt506IM0n5qWCCs1ZcOEvL//fOOGA7X1jRz+VRyAqpD8QdBlnwmDb+oZtSIyZDy3ce9L8 um0mbBcRlx1rzftcUZSWe+9kSYZOqcOmzEVLY3pjRX6fXkdM3gepagkfqMBX/3V0eP3zK9 Q3TuZoADYLAnCnVO5v42RLUeX7FF5Gc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658528173; a=rsa-sha256; cv=none; b=5OYpEYi9ZSuP+G//h5oxLZy1SdOmcvKpICf+m3RecwlrN16JivSkD9qz0pS9rN9cCZ/9GS pZDykX32ldOKeCWuGlax0QjCIuCULT9jTTHMpspkXehq3D9PLn5PvVd/V4Iu5qZ1gkM7jF Kkj5uZAlheg2W65qqwNNCdQA6l1tKJc= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=tNKubLYY; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf22.hostedemail.com: domain of seanjc@google.com designates 209.85.210.182 as permitted sender) smtp.mailfrom=seanjc@google.com Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=tNKubLYY; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf22.hostedemail.com: domain of seanjc@google.com designates 209.85.210.182 as permitted sender) smtp.mailfrom=seanjc@google.com X-Rspam-User: X-Rspamd-Queue-Id: EFE9CC0008 X-Rspamd-Server: rspam06 X-Stat-Signature: 16aux7om4bp35ug9mmfxq3rg4ggjbmqg X-HE-Tag: 1658528172-787801 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000138, 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, Borislav Petkov wrote: > 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. Yar, just wanted to be make sure we're all on the same page, I wasn't entirely sure what was get nacked :-) > > > 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. Yeah, but either we get AMD to give us an architectural layout or we'll have to eat that cost at some point in the future. > 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. Heh, you're definitely more optimistic than me. I can just see something truly ridiculous happening like moving the page size bit and then getting weird behavior only when KVM happens to need the page size for some edge case. Anyways, it's not a sticking point, and I certainly am not volunteering to maintain the FMS list...