Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5152084iog; Wed, 22 Jun 2022 13:10:20 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s5Rd9qy0nNqdtNjOiEbGpTbL5NdapTCxaKp56NxsAEcwJqn9zcyRPmJebFLCeMlCkAz5U0 X-Received: by 2002:a17:907:16ab:b0:711:f0dd:91c with SMTP id hc43-20020a17090716ab00b00711f0dd091cmr4644567ejc.575.1655928620681; Wed, 22 Jun 2022 13:10:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655928620; cv=none; d=google.com; s=arc-20160816; b=utJiMqlP2+V+va9dvtyMZMjrV85CLOus6Y8PfFbEd1OaHxv2lpvhGcDq+A3hBAaOrG bJfovA8pZiy89wm5LTb0lVoZI+enJ7OC1A/a00G3pVokeC0gavWx64mnGbLQxCiwVaPy wQF7eKuHlYmbaNfFh6Z4MBnrIYELGMC5ZGUtteoyH9jCwejPJk1ePmCrYSx9GLRocUc2 XtHBypeTCSt/Og4ICL8flN7OcbaMk66rkBaqMRt5zSJSBEbWxdWiKkAdCR9lXZh/r7b7 DsuW4Fmj9fpvVITYfrgYjNfvW5jwTFadNK1k0OPF0Zf27Oh8B9enN3N6IVs6UCIXL9kn Y6Pw== 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=1J4t68R9wm9IAHpBSUioIMmYatlc8Gl9nRLppxGLhDg=; b=GtC4bLt56E5I7F+CmNoIhNjS4IIsqOoZ56XTe+4PyRHyE5AufO0kXUiNg9RGuhbb3l kHdBpmC/JkldUM/cyKWbV6Xhnbvjrlh5VZI8lgOBlUK23/94cq4wBaY7Rn4eUjMv7mhA 3YnstYGDbZNqMnmdnaQqyuE57ap06Kf9XcyN6U+9BGfoaNWHIRH0OzpxxCXiIg81F+DL j3DvedUywm31jlYqWezvSu1p7Y/WiMkRqiaXn2FZ975dzNSFppr8qAJTzJf+G35s6f9g TA93tK5u2bQb2MsSoNJjwQ7QSXi3FziGPtfDekiDEvkOTDAfrGI+nUtoK55u8q6aKRi+ ZqjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AzRM+lW1; 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 q3-20020a17090676c300b0070d08e9f4fbsi20212922ejn.615.2022.06.22.13.09.47; Wed, 22 Jun 2022 13:10:20 -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=AzRM+lW1; 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 S1376835AbiFVTuQ (ORCPT + 99 others); Wed, 22 Jun 2022 15:50:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376812AbiFVTuO (ORCPT ); Wed, 22 Jun 2022 15:50:14 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEBDA40A1B; Wed, 22 Jun 2022 12:50:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655927413; x=1687463413; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=jK+Ip8TKjyJwk/sGYsCBvnwDGqA6k0xPk+0Grxe5TNg=; b=AzRM+lW1vSgSDKYqlWgBDP1lvHBoQcbJaSvfwEQPttkhO3c6gtB87PRs zpUW3ZfuzpNjJjmT0AUxv83MDTcVd+Jip0Q5AUsgagJtyg3WVNcswTcFR RbrptCYzPRiE1mzy9PanXblclzJdH7k2R8a9JU6R9pcxDm9kR3UvHDc0V gCYgOXza5SKC44XeEm0oMXnJIUfk1UEVPiQpbc6ZOiuoroyGTMtDKngsQ zj3XteXfjQfZaxk9ohCOzsxM2tNDzWsG+J224AVrxtFQlJg2Cm67UDCO9 9esRzFohY4nLL3enarajt8VhWxYCFlETZaRNWNiLg3PTJPWaUivF+YWiq Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10386"; a="280576076" X-IronPort-AV: E=Sophos;i="5.92,212,1650956400"; d="scan'208";a="280576076" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2022 12:50:13 -0700 X-IronPort-AV: E=Sophos;i="5.92,212,1650956400"; d="scan'208";a="677720725" 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 12:50:11 -0700 Message-ID: <5db37cc2-4fb1-7a73-c39a-3531260414d0@intel.com> Date: Wed, 22 Jun 2022 12:49:52 -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> <99d72d58-a9bb-d75c-93af-79d497dfe176@intel.com> From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,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 12:43, Kalra, Ashish wrote: >> 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. > More specifically I am thinking of adding RMP entry field accessors > so that they can do this cpu model/family check and return the > correct field as per processor architecture. That will be helpful down the road when there's more than one format. But, the real issue is that the kernel doesn't *support* a different RMP format. So, the SNP support should be disabled when encountering a model/family other than the known good one.