Received: by 10.223.176.46 with SMTP id f43csp512906wra; Wed, 24 Jan 2018 01:35:43 -0800 (PST) X-Google-Smtp-Source: AH8x22704o0PRghu/bX8y7x13th3mQot4pupfRI4bn28PPyZUxBohjpDn/iClehf7XBFo8zw64Ya X-Received: by 10.98.35.14 with SMTP id j14mr12498214pfj.62.1516786543731; Wed, 24 Jan 2018 01:35:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516786543; cv=none; d=google.com; s=arc-20160816; b=gqQDK0R/ciUebsZxGjTs4i/wfj8ItDWbkbGoZ1tDePrcOurG0+6rHN7kJdrtbYHPoF 89Lw8wUFgIf4Dl3leu7QR47fs0w5aTPTrXQGf8TQxQstTknb9f/q4ftK1bNw+WLN2PKB +OXxCymKQfrytAhKM+wle1zt/mh31KESHYRbReeLAe5ykPiFRQlY3IYs6ORepiYem0VT hMKLiV+PBdqIl8k8ZroxP1aZpubGQunhaA5MaBRtBI34Nrq/BKQlgba+HglpbZqoAN45 xCMXLqP6IStsIpx91DicM/xUv59UknheadCLZsyavHzfj/kzMn4W0zC6ADC8QPUsOcQr kurw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=2lZIZo7xMeNFyoJCCoCuaJJg8I3MNnuHsqAc2Q1TQjk=; b=UVZRZQwmBvhKxwISRQogYh1T7/lPb6CrjBgsd8LsU92mZXsg6B98MW4PXGD6bHmUmx MAub1eB+8c4XN+A4hPVWYYFSiei0AEzWttGaxHh0zc8u9U5Dl8yy4jmFL6aNFdUzqLQp tAu9dRKSvf/3Yzro8QHxjDkMmK4VzZ7UL2e2Oxf8VVn5f6Ucvw3j2yH7k6FhlEu6h3T3 hVZXQa7HcY9cyObsx1mWw50gxY9mmeJlrEF5hUaNjl3jF97+CXoBxmHiFK8o6iTMbVVg I7c1eFinxRFImSJwke5sS++SUHpshY1iKu6HeiGAkr3iKy8i2B3hykZUx7XXc2dtnD33 8Bmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=PvYa2gl5; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o13-v6si5885509pli.279.2018.01.24.01.35.29; Wed, 24 Jan 2018 01:35:43 -0800 (PST) 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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=PvYa2gl5; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932883AbeAXJea (ORCPT + 99 others); Wed, 24 Jan 2018 04:34:30 -0500 Received: from merlin.infradead.org ([205.233.59.134]:52208 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932739AbeAXJe1 (ORCPT ); Wed, 24 Jan 2018 04:34:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=2lZIZo7xMeNFyoJCCoCuaJJg8I3MNnuHsqAc2Q1TQjk=; b=PvYa2gl593WYZHLAlg8h5RZYL4 SEFVBTya1GwXbgBDM4U0GrqqhYUSkCeBGNGakuX5/DVxVGEkuh4wvvT2r09a9HZocowMCIFKCGHjP e/hE/ImjN6BvWwxJ6GkhlmCLBMXKvnllDwpyj+PF13NaLjGnTa7WYmdiyDuSNYW8HFu5F5qpiQ6tX KHelYK9tV0ddS4JeH21ankGa7OJDXtXzDd1OP1rS5ridrOBXZQohpJ5G/Tao4vCswhyg+fNm0/GGY U6IMmRHFEmIh6c3P8C8249pOOQlDS5bbaOJ4bVf7P8ao5WZxZ8uvdLAQjPnbxd4NWAb+10Fs9FyQ2 il2izJ/g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1eeHRU-000325-UP; Wed, 24 Jan 2018 09:34:05 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id C9A5120207CA8; Wed, 24 Jan 2018 10:34:01 +0100 (CET) Date: Wed, 24 Jan 2018 10:34:01 +0100 From: Peter Zijlstra To: David Woodhouse Cc: Thomas Gleixner , KarimAllah Ahmed , linux-kernel@vger.kernel.org, Andi Kleen , Andrea Arcangeli , Andy Lutomirski , Arjan van de Ven , Ashok Raj , Asit Mallick , Borislav Petkov , Dan Williams , Dave Hansen , Greg Kroah-Hartman , "H . Peter Anvin" , Ingo Molnar , Janakarajan Natarajan , Joerg Roedel , Jun Nakajima , Laura Abbott , Linus Torvalds , Masami Hiramatsu , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Tim Chen , Tom Lendacky , kvm@vger.kernel.org, x86@kernel.org Subject: Re: [RFC 05/10] x86/speculation: Add basic IBRS support infrastructure Message-ID: <20180124093401.GO2228@hirez.programming.kicks-ass.net> References: <1516476182-5153-1-git-send-email-karahmed@amazon.de> <1516476182-5153-6-git-send-email-karahmed@amazon.de> <1516741116.13558.11.camel@infradead.org> <20180124084735.GM2228@hirez.programming.kicks-ass.net> <1516784541.13558.90.camel@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1516784541.13558.90.camel@infradead.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > + for (i = 0; i < ARRAY_SIZE(spectre_bad_microcodes); i++) { > > > + if (c->x86_model == spectre_bad_microcodes[i].model && > > > + ????c->x86_mask == spectre_bad_microcodes[i].stepping) > > > + return (c->microcode <= spectre_bad_microcodes[i].microcode); > > > + } > > > + return 0; > > > +} > > The above is Intel only, you should check vendor too I think. > > It's in intel.c, called from early_init_intel(). Isn't that sufficient? Duh, so much for reading skillz on my end ;-) > > > + pr_warn("Intel Spectre v2 broken microcode detected; disabling SPEC_CTRL\n"); > > > + clear_cpu_cap(c, X86_FEATURE_SPEC_CTRL); > > > + clear_cpu_cap(c, X86_FEATURE_STIBP); > > > + clear_cpu_cap(c, X86_FEATURE_AMD_SPEC_CTRL); > > > + clear_cpu_cap(c, X86_FEATURE_AMD_PRED_CMD); > > > + clear_cpu_cap(c, X86_FEATURE_AMD_STIBP); > > > + } > > And since its Intel only, what are those AMD features doing there? > > Hypervisors which only want to expose PRED_CMD may do so using the AMD > feature bit. SPEC_CTRL requires save/restore and live migration > support, and isn't needed with retpoline anyway (since guests won't be > calling directly into firmware). Egads, I suppose that makes some sense, but it does make a horrible muddle of things.