Received: by 10.223.176.5 with SMTP id f5csp3472615wra; Mon, 29 Jan 2018 13:45:15 -0800 (PST) X-Google-Smtp-Source: AH8x2262ZiikYLymQs0gy3EElLbpD664DcVmI8onyfEDYRwU4hCNC2QhDAJCjkzFcvDtuG8gmkCT X-Received: by 10.99.120.8 with SMTP id t8mr13678810pgc.371.1517262315390; Mon, 29 Jan 2018 13:45:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517262315; cv=none; d=google.com; s=arc-20160816; b=D6+IbU6Jlaf5MP/YHbbwXWUErxOm9q9XvdK569KutmD+WtLtrii2g2kpAM8Nbyyrxy UrrhNBqY5YL7hYf/Nj488tJhTqqWaVYsGzhX5FcsPm3BFRvR7NU/5WwS7JIiDcmGANcl I5f4VVlD2VG60wgi9Zq+lvtfDaSIogpZ7HKmYhfDhBTqHDR6wxeKdRUQk537SEl+zRKb B0Ff1Ov5n5cj5GQLHUQSznrVWrf+r1Gt1HujiRTU7QTL3M3zMH9NlrwIU8r4mPnn2T0f SRz1vtp2hh+whkeWirIw9A+MNz9MgzDatfjoZPheFxBwOh0P1NYLifnXYv03YBvAthOD LQdQ== 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 :arc-authentication-results; bh=mThJML5ckjovtTUnLkphEBwujqHWb3xxx+BmqaAuTuQ=; b=ThvE4kixtePX2jk4r2noV8waf4S8is4OilEW6eqLWnLNm+8BEq2JcH1NkBA3yZm/Y3 Vodz1DNVql4+lBmxEmkYcS4zvf0X0M4QxjGCOrmlvq3qL+uquWzpIM0Hz7LpwdVDgwti ixXqf027ghzAQbYDiD3k4ZLtDxgrjuoHzQbfSkgwq3r91apIIJv9Z4DK6s+Gm4ZZAvN5 va8t/uW1unIT4ad26KLmxbPjOSWDEpsE9FEUd6Uo4ShnrPrLGQwi4jJSUnDQVXwIiPQb m4a9TUjgzM75eS8cMHmPmRdpephqqB1nRKurXAVoEUFtNuO0Vldo1VDO37n6pSikTDmo Ullg== 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 d4si1745903pgf.231.2018.01.29.13.45.00; Mon, 29 Jan 2018 13:45:15 -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 S1751903AbeA2Vo0 (ORCPT + 99 others); Mon, 29 Jan 2018 16:44:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52380 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751698AbeA2VoY (ORCPT ); Mon, 29 Jan 2018 16:44:24 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D7A7310C88; Mon, 29 Jan 2018 21:44:23 +0000 (UTC) Received: from localhost (ovpn-116-57.gru2.redhat.com [10.97.116.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id 26BE518AC0; Mon, 29 Jan 2018 21:44:22 +0000 (UTC) Date: Mon, 29 Jan 2018 19:44:21 -0200 From: Eduardo Habkost To: David Woodhouse Cc: Arjan van de Ven , KarimAllah Ahmed , 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" Subject: Re: [RFC,05/10] x86/speculation: Add basic IBRS support infrastructure Message-ID: <20180129214421.GW25150@localhost.localdomain> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1517259759.18619.38.camel@infradead.org> 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 29 Jan 2018 21:44:24 +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 09:02:39PM +0000, David Woodhouse wrote: > > > On Mon, 2018-01-29 at 12:44 -0800, Arjan van de Ven wrote: > > On 1/29/2018 12:42 PM, Eduardo Habkost wrote: > > > > > > The question is how the hypervisor could tell that to the guest. > > > If Intel doesn't give us a CPUID bit that can be used to tell > > > that retpolines are enough, maybe we should use a hypervisor > > > CPUID bit for that? > > > > the objective is to have retpoline be safe everywhere and never use IBRS > > (Linus was also pretty clear about that) so I'm confused by your question > > The question is about all the additional RSB-frobbing and call depth > counting and other bits that don't really even exist for Skylake yet in > a coherent form. > > If a guest doesn't have those, because it's running some future kernel > where they *are* implemented but not enabled because at *boot* time it > discovered it wasn't on Skylake, the question is what happens if that > guest is subsequently migrated to a Skylake-class machine. > > To which the answer is obviously "oops, sucks to be you". So yes, > *maybe* we want a way to advertise "you might be migrated to Skylake" > if you're booted on a pre-SKL box in a migration pool where such is > possible.? > > That question is a reasonable one, and the answer possibly the same, > regardless of whether the plan for Skylake is to use IBRS, or all the > hypothetical other extra stuff. 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