Received: by 10.223.176.5 with SMTP id f5csp3660445wra; Mon, 29 Jan 2018 17:09:23 -0800 (PST) X-Google-Smtp-Source: AH8x224uqDztAIGE77SjHFK6h6dGfEJeuM88KgBADR1p88OmTWETStJiFP8wwOicyYJ2GpifY4/8 X-Received: by 10.99.185.78 with SMTP id v14mr15750314pgo.112.1517274563520; Mon, 29 Jan 2018 17:09:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517274563; cv=none; d=google.com; s=arc-20160816; b=y/JaL3PCavgir2h7MvuMGzqisj9EPLHFnQKf4uWPFudG3Jw5OySnPd5E/ZskNqCVyr iAJp3vP6UloGXmX6GPP1QifAxkRhMf/9L58dwsqIHw9Fvax2wLnJJF4/E4eolaAMklw7 hiknEbPLsWoCgFOc++j5VuOMuHgJWPXtgAw0cs0kxamwtUhijTUG18umY2js0RZ8y3Br ArvPsJgQx6cm0c4gjWjIRMiQGhOzPoxahrJp+mt3Ra4mrq/UD13O0nVR1U2ILxGpAjIX qLN+MeG0hKBgpI56rr8QU2cfCQixXbLxgDz3fZP6RrXZXIcuCOGZOSHoG0t9aL+y1u9d MwDA== 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:arc-authentication-results; bh=8L9hoJPxLFfmpvaa12NkrnM8vVU3iv2Atc/vJaII2aw=; b=prgEuyc0I+6H3/2/PxK40PIX9Ag3qNCDNAe8vx6bZBFwat3S7F12UbgSsFzhtAMgk8 4eNeiHdBY2v7plok+eeNauZ5wTi3frQaj6awVmNt8HzxqwZUAQ/bx36iDIygHNVEvPTL vFU1sU38wsDCtA+Rw6IdCWihskOgz1rCkWfnuhEujSlRHAfvAeQOnsS8+MIQK5r9dbE0 YRur/x2LRq2Cz+YrNp7npYQLW3Zu8IP7JKiFViXqmb6WeIT0MTNDqomPbpmcodqofitL fHFkKMUBLF4Y4aMUXG6FZo/Z2k9SBhhe64lUpE7UsFnGyDUgKn14YrRELtZFb9pne8+8 AjWw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f71si8249863pgc.477.2018.01.29.17.09.08; Mon, 29 Jan 2018 17:09:23 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752258AbeA3BIn (ORCPT + 99 others); Mon, 29 Jan 2018 20:08:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41568 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751562AbeA3BIl (ORCPT ); Mon, 29 Jan 2018 20:08:41 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 441778553F; Tue, 30 Jan 2018 01:08:41 +0000 (UTC) Received: from localhost (ovpn-116-57.gru2.redhat.com [10.97.116.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E1C25D75D; Tue, 30 Jan 2018 01:08:39 +0000 (UTC) Date: Mon, 29 Jan 2018 23:08:32 -0200 From: Eduardo Habkost To: David Dunn Cc: Arjan van de Ven , KarimAllah Ahmed , "Wilson, Matt" , "linux-kernel@vger.kernel.org" , 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 , Linus Torvalds , Masami Hiramatsu , Paolo Bonzini , Peter Zijlstra , Radim =?utf-8?B?S3LEjW3DocWZ?= , Thomas Gleixner , Tim Chen , Tom Lendacky , "kvm@vger.kernel.org" , "x86@kernel.org" , "Dr. David Alan Gilbert" , Fred Jacobs , Jim Mattson , David Woodhouse Subject: Re: [RFC,05/10] x86/speculation: Add basic IBRS support infrastructure Message-ID: <20180130010832.GA21702@localhost.localdomain> References: <7EB9643C-D2DD-477A-90DE-05DC653D2D4B@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7EB9643C-D2DD-477A-90DE-05DC653D2D4B@vmware.com> X-Fnord: you can see the fnord User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 30 Jan 2018 01:08:41 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 29, 2018 at 10:29:28PM +0000, David Dunn wrote: > On Mon, 2018-01-29 at 13:45:07 -0800, Eduardo Habkost wrote: > > > Maybe a generic "family/model/stepping/microcode really matches > > the CPU you are running on" bit would be useful. The bit could > > be enabled only on host-passthrough (aka "-cpu host") mode. > > > > If we really want to be able to migrate to host with different > > CPU models (except Skylake), we could add a more specific "we > > promise the host CPU is never going to be Skylake" bit. > > > > Now, if the hypervisor is not providing any of those bits, I > > would advise against trusting family/model/stepping/microcode > > under a hypervisor. Using a pre-defined CPU model (that doesn't > > necessarily match the host) is very common when using KVM VM > > management stacks. > > > > Eduardo, > > I don't see how this is possible in a modern virtualization > environment. > > Under VMware, a VM will be migrated to SkyLake if one is in the > cluster and supports the features exposed to the VM. This can > occur for suspend/resume as well. > > The migration pool isn't a constant. Hosts can be added to a > cluster and VMs can be instructed to move across clusters. So > there doesn't need to be a SkyLake around when the VM powers on > in order for it to eventually end up on a SkyLake. If this is the case for your deployment, this means the guest must never assume it won't run on a Skylake host (even if f/m/s is not Skylake), doesn't it? Then the hypervisor won't set the "we promise the host CPU is never going to be Skylake" bit. > > Even if we expose bit to indicate that FMS matches the > underlying host, when does the guest know to query that? The > VM can be moved at any point in time, including after the guest > asks if FMS matches host. If the VM can be moved at any point of time to a different model of host CPU, this means you won't tell the guest it can trust f/m/s because it doesn't represent the underlying host. You won't set the "f/m/s/m really matches the host CPU" bit. On both scenarios you describe above, it sounds like Linux must assume it could migrated to a Skylake host at any moment. This is exactly why I'm proposing those extra bits. -- Eduardo