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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01C58C43334 for ; Fri, 22 Jul 2022 22:16:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236441AbiGVWQQ (ORCPT ); Fri, 22 Jul 2022 18:16:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231478AbiGVWQN (ORCPT ); Fri, 22 Jul 2022 18:16:13 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 628808B4BB for ; Fri, 22 Jul 2022 15:16:12 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id 23so5431249pgc.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=VwUDU5trfpvMoP2yKbt4SZuL2/cTwBL4PPH5mU17F2YUGV/18zArzNHv2+gTOvTqqs VwV2Ot9t8WZo4QIzXZfALg+Ms3VlhGza3l7fRiY8150tA6NvYq8AMXzOvyG8NzJFWNaI x8B+crQkIjVcNTE2Ub+Wewt0rQxTZcxSlcNBPD3I5NLxY/NwuYVK9F7C+lWW5oeKBsiY Wz1kQzTVdotvRpnYKXdhe1wR6flsdg1BsiRnjNeXzdKVqwt2rbmJeRETZ6h8nTOGvrvG 6z5Jl9d3oxcVG0sD4XpLupa6lbKRk23Ps5Rf0wCjWBtkO/DLdHtuN/0Qm69bZgw3SXel qZFQ== X-Gm-Message-State: AJIora8o4q3ermNgPtzVjVRZ5y4DKf+AHz7ImLRpelku8fteCTqI5mWc 0BDiJ11VHY9NvLYpJAdM2ODd2A== 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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...