Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp644350ybl; Wed, 21 Aug 2019 03:24:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKdVJAAF/Vo2FR9X39W2Hf+fJSTi513z52n0oHO/FlLZ646tjIzdaBTHGXyjCf2wbLSYOF X-Received: by 2002:a17:90a:734a:: with SMTP id j10mr4497894pjs.63.1566383067560; Wed, 21 Aug 2019 03:24:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566383067; cv=none; d=google.com; s=arc-20160816; b=yJvXF2KX+rEsUVs80Ua5ZygoKoLjuAiuxMPe8cWNUgUT/LTcM2dTz/FH8lY1sA0xS+ EGndhbDzlugstL3G95doCrPM8qYOEEf6dpE3z5lFcFksv2UzDPWi4sHNIYFjmcgl66Za fHuvw5HI95ZL72IK8Vdpbc0xwe82AIxaoFJaGf/wRnabu3tlW4lmeoujNH260ro6wLUI q5yo5ETRC8nvrA3pMYBaOpGxJyfFUUnVX2snUqVhiIQCcub+ycngI/4feNItNqtIF4RO tWov3V+dHdW7DcWRupsY1FbiBcssjfRt8h4wCFH24wJjZTJCgWFCKzTHnAknwzFJI9ck b1VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5HldHmjPtVDsjJt+73zl6zmVCWyCnVG8ascf+hIMWGg=; b=sUSzrZ/cgR6PigR1IlsbP4dX4y0+JdiwwPbKfHOmVZzVKHlwhtTBUn2hxySekGxtuI qmDF6C/PmgtAA7Xq2P8y7puE2J7Z8vGnPg+Fp0W1ywhpEK3OlSPNFwvjBniIPrmuYCZ1 dTjsRSZNfExnMlKv2BBlZRnqPf4qQjjOG02LQmisfLq3WAvhKmOsNYlKOf7Kc1mvEIOY uG6H+6bP3tSeOcwSK9YtWAemzX0XRuZg+/vQIhWVPPrNFsr8x2MMx/+842C29ggXQ/zP paJ6RPVuJsEE1zS3a7Re1SHmZp1GmzMiJVnsFXcuszoIuPMvsODgOO/N6ZPcECbv40UP zMvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=JXBIHsFi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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. [209.132.180.67]) by mx.google.com with ESMTP id o3si14601006plb.238.2019.08.21.03.24.11; Wed, 21 Aug 2019 03:24:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=JXBIHsFi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1728210AbfHUKVA (ORCPT + 99 others); Wed, 21 Aug 2019 06:21:00 -0400 Received: from mail.skyhub.de ([5.9.137.197]:47128 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727669AbfHUKU7 (ORCPT ); Wed, 21 Aug 2019 06:20:59 -0400 Received: from zn.tnic (p200300EC2F0A6300A5E08EBEFD6E27E2.dip0.t-ipconnect.de [IPv6:2003:ec:2f0a:6300:a5e0:8ebe:fd6e:27e2]) (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 98A141EC0391; Wed, 21 Aug 2019 12:20:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1566382857; 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=5HldHmjPtVDsjJt+73zl6zmVCWyCnVG8ascf+hIMWGg=; b=JXBIHsFigf7rf/+opBf5Rm5Ekjif6uD6SYKry/tXM+paMrS7u1OT6MDNykHTeDtw3w4T52 /9jl1C9BKsaRZUQLAG7PcRSTF5dnSSfdKFJCAibbfRt+91K6pBpvmPI2CjfeCy6tEAebCH axlDog6P1OYaf3Z4gMdyoY7QGY034Vs= Date: Wed, 21 Aug 2019 12:20:52 +0200 From: Borislav Petkov To: Yu-cheng Yu Cc: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin Subject: Re: [PATCH v8 02/27] x86/cpufeatures: Add CET CPU feature flags for Control-flow Enforcement Technology (CET) Message-ID: <20190821102052.GD6752@zn.tnic> References: <20190813205225.12032-1-yu-cheng.yu@intel.com> <20190813205225.12032-3-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190813205225.12032-3-yu-cheng.yu@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 13, 2019 at 01:52:00PM -0700, Yu-cheng Yu wrote: > Add CPU feature flags for Control-flow Enforcement Technology (CET). > > CPUID.(EAX=7,ECX=0):ECX[bit 7] Shadow stack > CPUID.(EAX=7,ECX=0):EDX[bit 20] Indirect branch tracking > > Reviewed-by: Borislav Petkov > Signed-off-by: Yu-cheng Yu > --- > arch/x86/include/asm/cpufeatures.h | 2 ++ > arch/x86/kernel/cpu/cpuid-deps.c | 2 ++ > 2 files changed, 4 insertions(+) > > diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufeatures.h > index e880f2408e29..122265ab46c1 100644 > --- a/arch/x86/include/asm/cpufeatures.h > +++ b/arch/x86/include/asm/cpufeatures.h > @@ -334,6 +334,7 @@ > #define X86_FEATURE_OSPKE (16*32+ 4) /* OS Protection Keys Enable */ > #define X86_FEATURE_WAITPKG (16*32+ 5) /* UMONITOR/UMWAIT/TPAUSE Instructions */ > #define X86_FEATURE_AVX512_VBMI2 (16*32+ 6) /* Additional AVX512 Vector Bit Manipulation Instructions */ > +#define X86_FEATURE_SHSTK (16*32+ 7) /* Shadow Stack */ > #define X86_FEATURE_GFNI (16*32+ 8) /* Galois Field New Instructions */ > #define X86_FEATURE_VAES (16*32+ 9) /* Vector AES */ > #define X86_FEATURE_VPCLMULQDQ (16*32+10) /* Carry-Less Multiplication Double Quadword */ > @@ -358,6 +359,7 @@ > #define X86_FEATURE_MD_CLEAR (18*32+10) /* VERW clears CPU buffers */ > #define X86_FEATURE_TSX_FORCE_ABORT (18*32+13) /* "" TSX_FORCE_ABORT */ > #define X86_FEATURE_PCONFIG (18*32+18) /* Intel PCONFIG */ > +#define X86_FEATURE_IBT (18*32+20) /* Indirect Branch Tracking */ > #define X86_FEATURE_SPEC_CTRL (18*32+26) /* "" Speculation Control (IBRS + IBPB) */ > #define X86_FEATURE_INTEL_STIBP (18*32+27) /* "" Single Thread Indirect Branch Predictors */ > #define X86_FEATURE_FLUSH_L1D (18*32+28) /* Flush L1D cache */ > diff --git a/arch/x86/kernel/cpu/cpuid-deps.c b/arch/x86/kernel/cpu/cpuid-deps.c > index b5353244749b..9bf35f081080 100644 > --- a/arch/x86/kernel/cpu/cpuid-deps.c > +++ b/arch/x86/kernel/cpu/cpuid-deps.c > @@ -68,6 +68,8 @@ static const struct cpuid_dep cpuid_deps[] = { > { X86_FEATURE_CQM_MBM_TOTAL, X86_FEATURE_CQM_LLC }, > { X86_FEATURE_CQM_MBM_LOCAL, X86_FEATURE_CQM_LLC }, > { X86_FEATURE_AVX512_BF16, X86_FEATURE_AVX512VL }, > + { X86_FEATURE_SHSTK, X86_FEATURE_XSAVES }, > + { X86_FEATURE_IBT, X86_FEATURE_XSAVES }, This hunk needs re-tabbing after: 1e0c08e3034d ("cpu/cpuid-deps: Add a tab to cpuid dependent features") Thx. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.