Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5093667iog; Wed, 22 Jun 2022 11:49:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uEWJL5REMm1SRK3tDmESMWPpldlTRpSCA+I8BnlARnfHq6DxnDfSjk2SAtpPMvf1MML6e7 X-Received: by 2002:a17:902:8e8b:b0:168:a135:d636 with SMTP id bg11-20020a1709028e8b00b00168a135d636mr33947404plb.140.1655923761046; Wed, 22 Jun 2022 11:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655923761; cv=none; d=google.com; s=arc-20160816; b=cSIGOAFdan8gM/oSVyV4K+GCPwl7zx2aRo0ulTBjIOTnMDyKS830vgOZoi8qNlgvQL /QJd/yAgM52UrTuAKWNxHkhO0XC3yoBQgiFbPkn9+IeTR8f5h+wdhYWU3qzaKgDIM392 ZXg1W7e/gl5f8pS4ZNKdayFEw/sVxQtwmH4t6MC1Tk8gaYpcNF/A2ulNSh30FshSGefB Jnr95hBZpgN0mHl9KZUJaWAtAPKP8DyfqBE8FLDZn+NX1NQ4s5ECihNPpwctDBF0LYla eEPgTOMyGCbQ6Vb8Ry93JkDKKTskU/nlZaG8BJQc7qfD3LAlVUFkl2QQrE/9Y4ShYD6v tHcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=pNJ7Bi5VqSs0Db5zy+iDcfnNXbh7MgaWpQNHqodOhf4=; b=B2ygtcmUKvpHbU/5PXBaU9nywS4JTC9vBwmDn5jDz9hBBt3nhhjJhwqM2L9XGdymMb ETOG/+WfQ+9WDRWFHfyOFm6z2DkXLKqk6Ze7Otr/KiQUEusM+yR5EarzsaZR4IT9RhBo i48wMFBUzufNez3qfSeCTbucClbbsunUD7Q0sIbOKWTuRW/GsGZTIAljPVUOlqS5j+Ws EL5gnTFQP7ZW81QO5yGz5J8RSNwnPYokUmRW9A0o8KTvuq0SMdOz4pbJMiLXYMk1t8Oi jsTYec/bk8cq5pdeQ4ScpCjVY+53hXAH5yA5/RYZR6YLbJ36qJv8NtAyj/9jzICscOrI /PIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cRrpQJbD; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i27-20020a63131b000000b003fe22d73829si22984462pgl.186.2022.06.22.11.49.08; Wed, 22 Jun 2022 11:49:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cRrpQJbD; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231224AbiFVSnJ (ORCPT + 99 others); Wed, 22 Jun 2022 14:43:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230122AbiFVSnI (ORCPT ); Wed, 22 Jun 2022 14:43:08 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B1C595B2; Wed, 22 Jun 2022 11:43:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655923387; x=1687459387; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=vLhzMi2QzzK4JidKA8EX0YX95XP0Zt+Cm+d/NMCKTa8=; b=cRrpQJbDCIAiOurfHHNVOVFnui/lDCkecrxJ+MMK+RxRfPeuybe4FM8u Sqhlgeh2tM6P5ZCGyv+Gg12+lRQkSqM0i5E1DYh256gqvk5rqJ9EsOr63 r11qlccXPkay4cwD9amf/40NDUhIj1LpcOvS9nQIUZGVL23pY3EGbmyae zKO/a407RL+vVIx49IPi276CtjPXNGJWQ/hfaEpi8run84JF3B/OrL4g5 uDTy4DwUWQBNzGxvP+tIyrsGcqveoGF9zNF6eiP1fF+N+wFXlaUOAU2EQ Tgqn+WTcxizqsCe1G/feei7EL6FRyXDTec+Cq8H3dMm/dB6xtjk+RD+vC g==; X-IronPort-AV: E=McAfee;i="6400,9594,10386"; a="263545743" X-IronPort-AV: E=Sophos;i="5.92,212,1650956400"; d="scan'208";a="263545743" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2022 11:43:07 -0700 X-IronPort-AV: E=Sophos;i="5.92,212,1650956400"; d="scan'208";a="677695719" Received: from bshakya-mobl.amr.corp.intel.com (HELO [10.212.188.76]) ([10.212.188.76]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2022 11:43:05 -0700 Message-ID: <99d72d58-a9bb-d75c-93af-79d497dfe176@intel.com> Date: Wed, 22 Jun 2022 11:42:46 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH Part2 v6 05/49] x86/sev: Add RMP entry lookup helpers Content-Language: en-US To: "Kalra, Ashish" , "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" Cc: "tglx@linutronix.de" , "mingo@redhat.com" , "jroedel@suse.de" , "Lendacky, Thomas" , "hpa@zytor.com" , "ardb@kernel.org" , "pbonzini@redhat.com" , "seanjc@google.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" , "bp@alien8.de" , "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" References: <8f63961f00fd170ba0e561f499292175f3155d26.1655761627.git.ashish.kalra@amd.com> <25be3068-be13-a451-86d4-ff4cc12ddb23@intel.com> <681e4e45-eff1-600c-9b81-1fa9bdf24232@intel.com> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 6/22/22 11:34, Kalra, Ashish wrote: >> So, if the RMP entry format changes in future processors, how do we >> make sure that the kernel does not try to use *this* code on those >> processors? > Functions snp_lookup_rmpentry() and dump_rmpentry() which rely on > this structure definition will need to handle it accordingly. In other words, old kernels will break on new hardware? I think that needs to be fixed. It should be as simple as a model/family check, though. If someone (for example) attempts to use SNP (and thus snp_lookup_rmpentry() and dump_rmpentry()) code on a newer CPU, the kernel should refuse.