Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1008668pxk; Fri, 18 Sep 2020 01:01:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7zSABOXYbd5PHuH6f3x3quGEPU5DMvLV0wzbPpbO3ufmTICuJ529cCy0TVYmPmyVqzZmS X-Received: by 2002:aa7:da10:: with SMTP id r16mr38217870eds.333.1600416079826; Fri, 18 Sep 2020 01:01:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600416079; cv=none; d=google.com; s=arc-20160816; b=DZwc3HX2fMjTBhh0vxpUlZo0LKRLQmzSNIbNjrF7zlTOi5vAruRuQjAaPgKKaWel8c pHsdkY02sjHG3Q2ChXTxvfB1/QcnYe9I3eeNWFxwEse6KX6RN5gClmGjRuJCmrcOL49T ngP6OUN5MA8BP5m8DoOzpp1cTyg5uM0vQxX8j3OnFw3eV4eFbXicgoSj8WDT6nXD01jH iRns4ee7J3RDnhPWUyYUOCFkhnxPM0bJNqesMmOitJ81bgm9VRYHGpm4MckckdTzL2OX SprXgN1z2I3oN9DLzIu61PaOXFiBYkTqgF62xU4aXeg738y7Ypueeq3cNaHEFvyhqEpB p/Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:from:dkim-signature:dkim-signature:date; bh=IJ3nkibF2B/vDoniHLfD0X7Q3rUEgY+JQJTaY4UTSvU=; b=MNOlHwrUm+kDmBMhAd7uLqFQMUEixeB9eNeleRV/GaX+YE+6fKLHbUIEzZ/rlRlxvg 2ZfkXzPpKKUa75qairxtjwj3FAlap6dwck9vv8UlxexNAoF/OuELSU4n3IbU4Jl9wlb3 eTG70vhbc86LX51+hzxeIfarVS6+kBeq4wqThC0hLUzrmVUZazb4JcA/eM+uPhUhdZcN kIjyMuHHJzVL9MabaRp0snUa4ZlyXXFefw9Lw6BLZs2+UHe36GDdvufwsqDHMQmPDFxK /xp0cJB9NOW34jopZYRU4EsyNP4du6oEyr3LCT/JPPsNvbgjf/3pnUrw/BUyIpts683c lrCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=TQyvDH0T; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r28si1738236edi.80.2020.09.18.01.00.56; Fri, 18 Sep 2020 01:01:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=TQyvDH0T; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726730AbgIRH6l (ORCPT + 99 others); Fri, 18 Sep 2020 03:58:41 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:60816 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726599AbgIRH6j (ORCPT ); Fri, 18 Sep 2020 03:58:39 -0400 Date: Fri, 18 Sep 2020 07:58:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1600415916; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IJ3nkibF2B/vDoniHLfD0X7Q3rUEgY+JQJTaY4UTSvU=; b=TQyvDH0TvTknSOKF93Lnz3y0SKGrY++I8dKHQfJN6OJeHhEBNuDTS9y0PoeI9AxIJhYPIi wDMStqfmoujIPYbWm+nNwLJa507mWPUv1UuqsDwI2J6UZoar+lEngmH18YiFA5XdJQo6kZ E6286Ypzjmri7DUNfrMiM7ymM8EM+yo6C6RWQTJKIe+0DMdDmaM0M77ev7yJzd733FUMVd HcU/e+b76wiZDxtXlT9Sl5mfJBP6Daxlly4+NQnElXwmBeYjhwbkm95COEHXRQQDwodtiM kyusFMNSe+2DmaTmueXvOut9h+fl4gJf+mJq1uS4qxttNhoPF8FliHDl+oDfXg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1600415916; h=from:from:sender:sender:reply-to: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IJ3nkibF2B/vDoniHLfD0X7Q3rUEgY+JQJTaY4UTSvU=; b=ThhpyMk/2BNb5/YV/BUYoL5sGtOb0aHx9onbVhudAf4ZZ4UOARPoPJkHWjEXHaRt1M0Kkn sg3KhYMn9uCNAKCA== From: "tip-bot2 for Krish Sadhukhan" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cpu] x86/cpu: Add hardware-enforced cache coherency as a CPUID feature Cc: Tom Lendacky , Krish Sadhukhan , Borislav Petkov , x86 , LKML In-Reply-To: <20200917212038.5090-2-krish.sadhukhan@oracle.com> References: <20200917212038.5090-2-krish.sadhukhan@oracle.com> MIME-Version: 1.0 Message-ID: <160041591536.15536.9107710778522234278.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/cpu branch of tip: Commit-ID: f1f325183519ba25370765607e2732d6edf53de1 Gitweb: https://git.kernel.org/tip/f1f325183519ba25370765607e2732d6edf53de1 Author: Krish Sadhukhan AuthorDate: Thu, 17 Sep 2020 21:20:36 Committer: Borislav Petkov CommitterDate: Fri, 18 Sep 2020 09:46:06 +02:00 x86/cpu: Add hardware-enforced cache coherency as a CPUID feature In some hardware implementations, coherency between the encrypted and unencrypted mappings of the same physical page is enforced. In such a system, it is not required for software to flush the page from all CPU caches in the system prior to changing the value of the C-bit for a page. This hardware- enforced cache coherency is indicated by EAX[10] in CPUID leaf 0x8000001f. Suggested-by: Tom Lendacky Signed-off-by: Krish Sadhukhan Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20200917212038.5090-2-krish.sadhukhan@oracle.com --- arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/kernel/cpu/scattered.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h index 83fc9d3..ba6e8f4 100644 --- a/arch/x86/include/asm/cpufeatures.h +++ b/arch/x86/include/asm/cpufeatures.h @@ -288,6 +288,7 @@ #define X86_FEATURE_FENCE_SWAPGS_USER (11*32+ 4) /* "" LFENCE in user entry SWAPGS path */ #define X86_FEATURE_FENCE_SWAPGS_KERNEL (11*32+ 5) /* "" LFENCE in kernel entry SWAPGS path */ #define X86_FEATURE_SPLIT_LOCK_DETECT (11*32+ 6) /* #AC for split lock */ +#define X86_FEATURE_SME_COHERENT (11*32+ 7) /* "" AMD hardware-enforced cache coherency */ /* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */ #define X86_FEATURE_AVX512_BF16 (12*32+ 5) /* AVX512 BFLOAT16 instructions */ diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c index 62b137c..3221b71 100644 --- a/arch/x86/kernel/cpu/scattered.c +++ b/arch/x86/kernel/cpu/scattered.c @@ -41,6 +41,7 @@ static const struct cpuid_bit cpuid_bits[] = { { X86_FEATURE_MBA, CPUID_EBX, 6, 0x80000008, 0 }, { X86_FEATURE_SME, CPUID_EAX, 0, 0x8000001f, 0 }, { X86_FEATURE_SEV, CPUID_EAX, 1, 0x8000001f, 0 }, + { X86_FEATURE_SME_COHERENT, CPUID_EAX, 10, 0x8000001f, 0 }, { 0, 0, 0, 0, 0 } };