Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1570945pxb; Thu, 16 Sep 2021 10:07:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsUqCOMMarQZA9CejncFa8XI9tv88Kk7T1TiKWGVgVIxWRQy5gaK/l7rPBH9V5ZEOEPRHm X-Received: by 2002:a17:907:7613:: with SMTP id jx19mr7517611ejc.453.1631812066364; Thu, 16 Sep 2021 10:07:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631812066; cv=none; d=google.com; s=arc-20160816; b=m+ijUWpJB0dItxoqKFPzGCSco2Gu9lS5O1Xvg17Ga3QwdtKrDRrUVj7XDM3E89YmTH u5d1W6gdKXoqN9CG4PXcQ+A0PznHzIxHdximK7u0dUtN8FznuJVk69JQ2l8WGfKavCVt MoI7bcIa+B/DXQ33/O3Q2dLhWKbrDcI8i/TqgI8UDmaXhxOBr5dsDi4fwxLmc1qjxcDG mTNcrkNEsNo0Z+SO97Hp60uc1CqVK7nWpV8TU3rDgao/aB8DXo2e/7WblMCPT9IZhkqs hwVMjhgEaV4GKdukAtHXnxhE9cLvO/7WFQQH0/WeJE7sjzh0XFGfw8aCWcPJXXuFsQUt nVBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CsguPVegY1Z3/cHkTvyO5SSM87RXYzv+szSa5MU4dro=; b=LEVPuuCBr4gmtPqlmGGdXYyRFNKK7CfYJfEnxZNRK3x1RavG/hy6z7OMuDrl84hQ+T ICAbK9WZwycVBa6Aef0w2W6WktG1UoXe6VKTUWdloYngZpaTU0Ab6G3fOovJyq+UxD5X ea1/xsvgBw7JE+cO9vLiAaYtf382JmF7ulqIUsBhhmHPS56DTvRRhv3sMcUa5MQGKGMX S02vjbdWO1hUd1gmFgN2F70G5QNC2FnTLp40RvYoa0ZQ4KcSiWnpMzruorTAmGKTHBIY 6/995qgywM3ZcNH1irjz9WiiuN2aRcL27KNoj3sdnMAMImBqwSNgRF2joizfzdYc98T5 oXpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=Y9B3Lju7; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b5si4043750edx.499.2021.09.16.10.07.04; Thu, 16 Sep 2021 10:07:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=Y9B3Lju7; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344577AbhIPRFI (ORCPT + 99 others); Thu, 16 Sep 2021 13:05:08 -0400 Received: from mail.skyhub.de ([5.9.137.197]:37514 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346683AbhIPQ55 (ORCPT ); Thu, 16 Sep 2021 12:57:57 -0400 Received: from zn.tnic (p200300ec2f11c6001e49ea6afe1054f5.dip0.t-ipconnect.de [IPv6:2003:ec:2f11:c600:1e49:ea6a:fe10:54f5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 211431EC0277; Thu, 16 Sep 2021 18:56:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1631811390; h=from:from: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; bh=CsguPVegY1Z3/cHkTvyO5SSM87RXYzv+szSa5MU4dro=; b=Y9B3Lju7uANekQ/vNO1kgsIJoEUoNMktGkOPAuf61gUG3/WfraP1VY1HDl/EF4DE+WMM0G ofFGOckCcDnYYrqRrz50rI90T6nYdB8WXn2m2WPaCJAiVmQZKUs9nmqa7f9Kvafb01t8GQ YNWW7riHkc74G2m2g7g3cj+hKDcPN14= Date: Thu, 16 Sep 2021 18:56:22 +0200 From: Borislav Petkov To: Brijesh Singh 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, Thomas Gleixner , Ingo Molnar , Joerg Roedel , Tom Lendacky , "H. Peter Anvin" , Ard Biesheuvel , Paolo Bonzini , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Andy Lutomirski , Dave Hansen , Sergio Lopez , Peter Gonda , Peter Zijlstra , Srinivas Pandruvada , David Rientjes , Dov Murik , Tobin Feldman-Fitzthum , Michael Roth , Vlastimil Babka , "Kirill A . Shutemov" , Andi Kleen , tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com Subject: Re: [PATCH Part2 v5 01/45] x86/cpufeatures: Add SEV-SNP CPU feature Message-ID: References: <20210820155918.7518-1-brijesh.singh@amd.com> <20210820155918.7518-2-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210820155918.7518-2-brijesh.singh@amd.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, Aug 20, 2021 at 10:58:34AM -0500, Brijesh Singh wrote: > Add CPU feature detection for Secure Encrypted Virtualization with > Secure Nested Paging. This feature adds a strong memory integrity > protection to help prevent malicious hypervisor-based attacks like > data replay, memory re-mapping, and more. > > Signed-off-by: Brijesh Singh > --- > arch/x86/include/asm/cpufeatures.h | 1 + > arch/x86/kernel/cpu/amd.c | 3 ++- > tools/arch/x86/include/asm/cpufeatures.h | 1 + > 3 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h > index d0ce5cfd3ac1..62f458680772 100644 > --- a/arch/x86/include/asm/cpufeatures.h > +++ b/arch/x86/include/asm/cpufeatures.h > @@ -398,6 +398,7 @@ > #define X86_FEATURE_SEV (19*32+ 1) /* AMD Secure Encrypted Virtualization */ > #define X86_FEATURE_VM_PAGE_FLUSH (19*32+ 2) /* "" VM Page Flush MSR is supported */ > #define X86_FEATURE_SEV_ES (19*32+ 3) /* AMD Secure Encrypted Virtualization - Encrypted State */ > +#define X86_FEATURE_SEV_SNP (19*32+4) /* AMD Secure Encrypted Virtualization - Secure Nested Paging */ s/AMD Secure Encrypted Virtualization/AMD SEV/g Bit 1 above already has that string - no need for repeating it everywhere. Also, note the vertical alignment (space after the '+'): (19*32+ 4) -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette