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 B2053C433EF for ; Fri, 22 Jul 2022 19:04:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 44F656B0072; Fri, 22 Jul 2022 15:04:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D7E66B0073; Fri, 22 Jul 2022 15:04:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 22A8C6B0074; Fri, 22 Jul 2022 15:04:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 0B2046B0072 for ; Fri, 22 Jul 2022 15:04:32 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id DAADA1406C8 for ; Fri, 22 Jul 2022 19:04:31 +0000 (UTC) X-FDA: 79715661942.23.63D69EE Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by imf19.hostedemail.com (Postfix) with ESMTP id 6F07E1A0098 for ; Fri, 22 Jul 2022 19:04:31 +0000 (UTC) Received: by mail-pf1-f179.google.com with SMTP id d10so5193497pfd.9 for ; Fri, 22 Jul 2022 12:04:31 -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=PY64yvYmGtR5KBgIEH0kskaa/Mhm9isORQuQT/+qOTg=; b=B2Av3DaoGRaE0kFsKvMfcCX99AkXfypknaWDXFb9SFwhHEv5JLdnDSAkfaX11dJGqo 38jEKQz554GRe3APlFdff074TrX3y2o35LNMi0grD5vMsxZBSdK8XPybeBXqrlkLioaF 6dFZxQQc7eoqXr6kzGWGceR/t4+aNbOPCNPgCd2lRG+Lahkdc1kih3rCqlEs45lXTpOh Z0Cq8DQqwON7l2Qh/AaLS8smpDrui6seUrMpJBw93tUooNboZt18afPmk4fle6cJ+lIW 7UDCjbm12Ec/v9+695QP6sQLn8d6aYLp3cOOPmBGmXKyuKSpihx4qvYz3VBRIr2q1/la F6LQ== 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=PY64yvYmGtR5KBgIEH0kskaa/Mhm9isORQuQT/+qOTg=; b=7mZ9mkvHkQ/uGCKSt/zyLggoCLlj3yTsbwiB2HZjSMKSlP+0Pn1UJdF0IsZCzElveu lrlTpZVJxHiS3yoX6FF8BHf3aTYp5fOnU24UkCo+72yvAaPpoSQkldK45CviIo+fb/hC tpyBsIJ58zYr3WEw+bQn+POLzbuAsl5XRmeEzqQ06DZfs4PFGf9Rt44h8Ph4dR1NtL3C AsxEKQLigeEKk+SlhADCj4PGEwm3OsuWckrRgWq+23fJPOA3rjzFFrVwi34VsE9XcH+U QiN73Xn9Jyh15uip1Ft3+rISZ6eD4XjjX5I5VntO38lXt7H8ngJX/sX6HWbkOtzwk4Uo qaKA== X-Gm-Message-State: AJIora+wX6Yx8URGTYXImIk7naeZ/PUj/zpy+83G89oWP0+5e7S6Qj5o hwB8RYpXG6p2MWLCUUpC210mow== X-Google-Smtp-Source: AGRyM1tXJ6+8d199UVPj6kD7+qncEimaUl/b0ptp5tdmerCUqKDRy2ff6UYP5+QOI8loO5mEiiiOrQ== X-Received: by 2002:a05:6a00:e8f:b0:528:a1c7:3d00 with SMTP id bo15-20020a056a000e8f00b00528a1c73d00mr1329285pfb.25.1658516670031; Fri, 22 Jul 2022 12:04:30 -0700 (PDT) Received: from google.com (123.65.230.35.bc.googleusercontent.com. [35.230.65.123]) by smtp.gmail.com with ESMTPSA id 186-20020a6215c3000000b0052536c695c0sm4365547pfv.170.2022.07.22.12.04.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jul 2022 12:04:28 -0700 (PDT) Date: Fri, 22 Jul 2022 19:04:23 +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: <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=us-ascii Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658516671; a=rsa-sha256; cv=none; b=4oitvLfBC132OoGKTW7f5o7MQ9Yw/AOIvgUOIbfnFxmAyRHxmVkWyqe2RAZdYY/Ely6CJK E5rbYayO+JnFLZzxELL4b/O+iQTAqoPM2uxe3nTxmCKosP2zWtMmFxGzt5nQMyEBg1SGHj eYk2cGe0fin9yy62aNEsnTjA2Vy1BV4= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=B2Av3Dao; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf19.hostedemail.com: domain of seanjc@google.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=seanjc@google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658516671; 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=PY64yvYmGtR5KBgIEH0kskaa/Mhm9isORQuQT/+qOTg=; b=8PvWIRBKBr/LRO9wedLzmb32cCKy25YiQqn8EvawOgYDE9/uKBaG+YWcPq8P/yqZzfX5Zs hpg10dCa0Cs/u7zpHxiigbjLx8/iKFXZyAHqjEmh9smDfWN4Xg3teSYMy/bzn+b+JCMIda 0Ofwoqq4INtbQ0MnYlkB/mt3Ou2HZZ4= X-Rspamd-Queue-Id: 6F07E1A0098 Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=B2Av3Dao; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf19.hostedemail.com: domain of seanjc@google.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=seanjc@google.com X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: 9hfspz9f1qoyn3opxp4dmwfh7e7okska X-HE-Tag: 1658516671-722279 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, Borislav Petkov wrote: > On Thu, Jun 23, 2022 at 10:43:40PM +0000, Kalra, Ashish wrote: > > Yes, that's a nice way to hide it from the rest of the kernel which > > does not require access to this structure anyway, in essence, it > > becomes a private structure. > > So this whole discussion whether there should be a model check or not > in case a new RMP format gets added in the future is moot - when a new > model format comes along, *then* the distinction should be done and > added in code - not earlier. 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. 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. > This is nothing else but normal CPU enablement work - it should be done > when it is really needed. > > 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 pls add the model checks only when really needed. > > Thx. > > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette