Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4250271iog; Tue, 28 Jun 2022 12:06:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vCuD+wenG+dMJjqAweeQdM/Nt7q7b2UMXL/ButUDVoBzBtkf7Iqm3i+OdA6bSKGjx5dMW/ X-Received: by 2002:a17:90b:3596:b0:1ec:f563:d64c with SMTP id mm22-20020a17090b359600b001ecf563d64cmr1213618pjb.88.1656443204617; Tue, 28 Jun 2022 12:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656443204; cv=none; d=google.com; s=arc-20160816; b=I5c+5n99MNHDx3A7OAKRRpy8dl7KkvnPs0XPHakeBPlDrSoemgubuCng5DMxMMfgDl GsK6EIH01PYRWAde7AcekOkb55b1LNz2niUvWjA2miXf0E0YJkkuuDCEAndE3SvuWpig rc8OOITe+Fdm9qB8RY/8CnIB1YqiTGsEP9zrPgK0zsQ5ZRCLY68R7sMqwa3vMd8DEuuV ptNCbj6edGOmtZlv84jJG8ByFgEvFAgcgQPjS2P+JBLFuOyfy0O/NkE/k5XPrLQEZWsZ S1hr5fzhhgYgbarDX8iiCy6LNsKWB9Q+sZg3KGwMkY3hEQJXQ4sdYgXQ/G2J+RnaNjDm 8CPA== 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=gpRiKxY38033qLU1aVwF1e8IiAKz7V9UArtAJ2GQDWM=; b=gzNVg7FrJhRbWoiwlCK8fJ+GK1DIdR+oniON/VL41SA4lrN6dAb+JCALSa51ZV56G3 1J9rlOwfFi2qhblCH2ccL0b+sbCbPi62ohvd1WuX845ois62K10TEgT52HKpf89oL8d/ VQaq8XXJEGRfLFtP7uQ7cOP94FqsByIJxXExdaek9/KVZZTgFwQCBKwT9Q1u3NfnvfgD fhz766mJCAXb+fTJPjWNBYK4fi+NmugWKglzNdRm9Pa6QczFTwQ+27Ks5+UfSpq0XnGE x+jYPkZiwoDydwtOJK2H3n//EZQX7TfeK3J77NCt3gmrb1frTLEM6NFFeak6rcdo1jly 0+gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VHS+RJwD; 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 h189-20020a6383c6000000b003f6230458ebsi18421556pge.412.2022.06.28.12.06.31; Tue, 28 Jun 2022 12:06:44 -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=VHS+RJwD; 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 S235171AbiF1TFa (ORCPT + 99 others); Tue, 28 Jun 2022 15:05:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235169AbiF1TEq (ORCPT ); Tue, 28 Jun 2022 15:04:46 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0AB829814; Tue, 28 Jun 2022 12:04:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656443084; x=1687979084; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=N1AIQgmubreattzHLRnM0HT3Yc8fAoLHRwgDBlBS8LA=; b=VHS+RJwDI+KcZ9uXXLcKfjF8faaFRG/l0XQvsCaWXKwlW1x5ZaY0iH2v NNh6KGSIr+W7CVP6Fmnx13j4jcHiqkpkv5M6brC2VSNCLYt8CTibCi0x4 CiYiFyJrEhIKy/mhdnt097oeht0B1aMYnewAp7p/fMR59QwOml/YmZdsq VkXAJQR/UrO9KlFEr+qJe7rsreBLBt3iuZltfYq2+xm3rNer4rbsFJ4gZ QV5jJfaO3Op8d2+jCpIJxf7tK+RHyneutpVp0TU77jnC3bA22YDAJnNsj sihrkprmfclvi8V00y20UQ9eaoW9NlGegolkPFJ9miuncpmKIj5UEHSt1 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10392"; a="279369738" X-IronPort-AV: E=Sophos;i="5.92,229,1650956400"; d="scan'208";a="279369738" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2022 12:04:44 -0700 X-IronPort-AV: E=Sophos;i="5.92,229,1650956400"; d="scan'208";a="587977804" Received: from staibmic-mobl1.amr.corp.intel.com (HELO [10.209.67.166]) ([10.209.67.166]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2022 12:04:43 -0700 Message-ID: <33e38ba3-0865-8a9f-0739-af25a63d0beb@intel.com> Date: Tue, 28 Jun 2022 12:03:38 -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 06/49] x86/sev: Add helper functions for RMPUPDATE and PSMASH instruction Content-Language: en-US To: "Kalra, Ashish" , "Dr. David Alan Gilbert" Cc: "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" , "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" , "jarkko@kernel.org" References: From: Dave Hansen In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.5 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/28/22 10:57, Kalra, Ashish wrote: > + /* > + * RMP table entry format is not architectural and it can vary by processor and > + * is defined by the per-processor PPR. Restrict SNP support on the known CPU > + * model and family for which the RMP table entry format is currently defined for. > + */ > + if (family != 0x19 || model > 0xaf) > + goto nosnp; > + > > This way SNP will only be enabled specifically on the platforms for which this RMP entry > format is defined in those processor's PPR. This will work for Milan and Genoa as of now. At some point, it would be really nice if the AMD side of things could work to kick the magic number habit on these things. This: arch/x86/include/asm/intel-family.h has been really handy. It lets you do things like grep INTEL_FAM6_SKYLAKE arch/x86 That's a *LOT* more precise than: egrep -i '0x5E|94' arch/x86