From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 517EC5C88 for ; Fri, 22 Jul 2022 22:16:12 +0000 (UTC) Received: by mail-pf1-f169.google.com with SMTP id w205so2208656pfc.8 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=kiZ0QeOsj+RmM9+CA+iDO27gbNqOIS3lQkaS3WUBQONw480QgwyDgwP+odH9vldGnW y+gd6e9HQYAr3YdJPh7AEtgxeK2WalJTjIBE2Yxw/fhdlDp9lzA9bemc2mex3oH8prKC rUeBRzkW0HsrNcx8XGNLwSTRJFL9DTHsIALTM0ibYdUkZkJdF/F6uJMPKUny6ui8uzdm BESGzlqVB0MO71tmjlCmpjTD1nFf62KPrguXNtooeN6buIJsGhs8Ye8v1FuKTjtjWYVV tebCGKsOdndzUfQdLS1w4eXnEXg3dgO4ITDqzbZxCsjOLsyz/8mjZsO81BTYUupbECKW USYQ== X-Gm-Message-State: AJIora9z4toiNWshj+RJW6UMW5Y4qDZI3pFnEmziWa1gqCapFbOyVAhy /wWjYLidUtGia9PFi93AIm5hCg== 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> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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...