Received: by 10.223.176.5 with SMTP id f5csp1179707wra; Wed, 31 Jan 2018 02:29:54 -0800 (PST) X-Google-Smtp-Source: AH8x224pF1biMgEhw5Fcj22gDAUyUgodkXaJJ/FCtjpdRKkYKdOGj9p0EkbYIXRvBhxgoKEBPsl/ X-Received: by 10.99.122.15 with SMTP id v15mr25683051pgc.175.1517394594539; Wed, 31 Jan 2018 02:29:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517394594; cv=none; d=google.com; s=arc-20160816; b=J0p0CRjMAy0t08RjP3wcus1dzV1XHexp/o5kGg2RLhhYuRiFgZMOuvb5e9FxdGn3Lg CrZUDmc724Ez5K6bn2f3jSYP1aHFRqBve6PR5ciHoFGjPqvkk7y4dMU4Kh0ksZScuCWS dLGhOgXG79K87k9b0BBnsUqM/zMdNO5OC93AhEhMpJZc2aQ/s1otS9oH1/wPfDEQZnC5 fylwrPDgoqjtu1YnlkfaMcwkSWoLS9FBXunCKJOfZMNL7ceZ6NkrhZAMQ4CNyIqmDgy2 UEOwmKOhtzndwY25tvAfjKGMbH3sLHM6xthq2iTRwgSRfj8Jp299xz/2tLHpjjQjQzlH iA6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=0HL7c7021s51M+7JtpHjZ6uJ4f2RwSxy0Y2eHahPjgM=; b=056W0sIDnxHL9sVECDZgbqGIoO7NuhagZ6xtyV43XRTgl635VPjYm3jCt2/D7dexx5 d+LXVcx/buSCKQsPgh4nqe2ns8r/KwlNBA5OD4Pn/4Kq797n4hyQvrod3LWtbxe752/Q WQpF0WuqWLvE0IlTAgjd8maWNIOznVrbmMZUs+oDE2RfwUMVnF7rKly0+ycIdp2Mrocc cHdZs8hw6Hv9XxvRzQODb6wDHSN03L02Y6nQ/aJ0aJeGLuXTj+JI2QfjKh+DypcQ9aVE rukqcRJiS45MiERToh1rW36Eyl3CsZY/vGyuxHiAAVysk7Ftse5OsJKZFvECtEdohYRw 7R9g== ARC-Authentication-Results: i=1; mx.google.com; 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 w61-v6si13724733plb.412.2018.01.31.02.29.40; Wed, 31 Jan 2018 02:29:54 -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; 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 S1752997AbeAaKRB (ORCPT + 99 others); Wed, 31 Jan 2018 05:17:01 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:45939 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752051AbeAaKQ5 (ORCPT ); Wed, 31 Jan 2018 05:16:57 -0500 Received: from p4fea5f09.dip0.t-ipconnect.de ([79.234.95.9] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1egpNz-0001Z3-MB; Wed, 31 Jan 2018 11:12:59 +0100 Date: Wed, 31 Jan 2018 11:15:50 +0100 (CET) From: Thomas Gleixner To: Christophe de Dinechin cc: Alan Cox , Linus Torvalds , David Woodhouse , Arjan van de Ven , Eduardo Habkost , KarimAllah Ahmed , Linux Kernel Mailing List , Andi Kleen , Andrea Arcangeli , Andy Lutomirski , 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 , Masami Hiramatsu , Paolo Bonzini , Peter Zijlstra , =?ISO-8859-2?Q?Radim_Kr=E8m=E1=F8?= , Tim Chen , Tom Lendacky , KVM list , the arch/x86 maintainers , "Dr. David Alan Gilbert" Subject: Re: [RFC,05/10] x86/speculation: Add basic IBRS support infrastructure In-Reply-To: <200C59E8-80F3-4FEC-BA3B-E6A56FA12C74@dinechin.org> Message-ID: References: <1516476182-5153-6-git-send-email-karahmed@amazon.de> <20180129201404.GA1588@localhost.localdomain> <1517257022.18619.30.camel@infradead.org> <20180129204256.GV25150@localhost.localdomain> <31415b7f-9c76-c102-86cd-6bf4e23e3aee@linux.intel.com> <1517259759.18619.38.camel@infradead.org> <20180130204623.583b1a7a@alans-desktop> <200C59E8-80F3-4FEC-BA3B-E6A56FA12C74@dinechin.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323329-714891976-1517393750=:2293" X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-714891976-1517393750=:2293 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Wed, 31 Jan 2018, Christophe de Dinechin wrote: > > On 30 Jan 2018, at 21:46, Alan Cox wrote: > > > >> If you are ever going to migrate to Skylake, I think you should just > >> always tell the guests that you're running on Skylake. That way the > >> guests will always assume the worst case situation wrt Specte. > > > > Unfortunately if you do that then guest may also decide to use other > > Skylake hardware features and pop its clogs when it finds out its actually > > running on Westmere or SandyBridge. > > > > So you need to be able to both lie to the OS and user space via cpuid and > > also have a second 'but do skylake protections' that only mitigation > > aware software knows about. > > Yes. The most desirable lie is different depending on whether you want to > allow virtualization features such as migration (where you’d gravitate > towards a CPU with less features) or whether you want to allow mitigation > (where you’d rather present the most fragile CPUID, probably Skylake). > > Looking at some recent patches, I’m concerned that the code being added > often assumes that the CPUID is the correct way to get that info. > I do not think this is correct. You really want specific information about > the host CPUID, not whatever KVM CPUID emulation makes up. That wont cut it. If you have a heterogenous farm of systems, then you need: - All CPUs have to support IBRS/IBPB or at least hte hypervisor has to pretend they do by providing fake MRS for that - Have a 'force IBRS/IBPB' mechanism so the guests don't discard it due to missing CPU feature bits. Though this gets worse. You have to make sure that the guest keeps _ALL_ sorts of mitigation mechanisms enabled and does not decide to disable retpolines because IBRS/IBPB are "available". Good luck with making all that work. Thanks, tglx --8323329-714891976-1517393750=:2293--