From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from userp2130.oracle.com ([156.151.31.86]) by Galois.linutronix.de with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1f9rWG-0001N3-6E for speck@linutronix.de; Sat, 21 Apr 2018 14:21:33 +0200 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w3LCLO5s189186 for ; Sat, 21 Apr 2018 12:21:24 GMT Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2hfvrbgpxc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 21 Apr 2018 12:21:24 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w3LCLOjN025805 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 21 Apr 2018 12:21:24 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w3LCLO2B024688 for ; Sat, 21 Apr 2018 12:21:24 GMT Date: Sat, 21 Apr 2018 08:21:17 -0400 From: Konrad Rzeszutek Wilk Subject: [MODERATED] Re: [patch 07/11] [PATCH v2 07/10] Linux Patch #7 Message-ID: <20180421122117.GA5337@localhost.localdomain> References: <20180420022613.270943302@localhost.localdomain> <20180420174242.GO13977@pd.tnic> <20180421032701.GA4490@localhost.localdomain> <20180421090345.GA18575@pd.tnic> MIME-Version: 1.0 In-Reply-To: <20180421090345.GA18575@pd.tnic> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To: speck@linutronix.de List-ID: On Sat, Apr 21, 2018 at 11:03:45AM +0200, speck for Borislav Petkov wrote: > On Fri, Apr 20, 2018 at 11:27:07PM -0400, speck for Konrad Rzeszutek Wilk w= rote: > > Adding this: > > diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c > > index e207eb2e8011..6a800a71b6c0 100644 > > --- a/arch/x86/kernel/cpu/amd.c > > +++ b/arch/x86/kernel/cpu/amd.c > > @@ -676,6 +676,15 @@ static void early_init_amd(struct cpuinfo_x86 *c) > > set_cpu_bug(c, X86_BUG_AMD_E400); > > =20 > > early_detect_mem_encrypt(c); > > + > > + switch (c->x86) { > > + case 0x15: > > + case 0x16: > > + case 0x17: > > + if (!rdmsrl_safe(MSR_AMD64_LS_CFG, &msr_MSR_AMD64_LS_CFG_= val)) > > + set_cpu_cap(c, X86_FEATURE_MDD); >=20 > if (c->x86 >=3D 0x15 && c->x86 <=3D 0x17) > set_cpu_cap(c, X86_FEATURE_MDD); Perhaps instead of X86_FEATURE_MDD we should set on AMD only this CPU flag: X86_FEATURE_SSBD And on Intel have both: X86_FEATURE_MDD X86_FEATURE_SSBD As the MDD SPEC_CTRL is not available on AMD, at least now - it may be in the future () >=20 > is enough. >=20 > --=20 > Regards/Gruss, > Boris. >=20 > SUSE Linux GmbH, GF: Felix Imend=C3=B6rffer, Jane Smithard, Graham Norton, = HRB 21284 (AG N=C3=BCrnberg) > --=20