Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp782697imu; Fri, 7 Dec 2018 08:49:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/V46KejxkKiiI5Nvo2Sq7kRfteexOmHum0TCy3N/9TWPrmVKax9HNA3g3UyZOEcunZ1DPDS X-Received: by 2002:a63:7b06:: with SMTP id w6mr2606042pgc.288.1544201384315; Fri, 07 Dec 2018 08:49:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544201384; cv=none; d=google.com; s=arc-20160816; b=deLXss3/vIe+Gml2ctlJSJEPMUnxLz2ujhzIDIA7QLCkWQTpSqbHLZ4h2KnpNIOw4h NE4miioOoI4HsX+pxdgbLMO/Hp5T6XcCNtw4BCY3PYMYzjUWtYfxMuxhqyGnUtwe5tBR apzKEnwYPwlVDnZvD9cuOLDuCLKq5fL7S4fnklBmPYSrMs0NJ4RmrVVzMwlJ96lo+fv7 vYHyYyu6IxVvr7yLIOtKWeH025MkcQmPyf+/do9+jP69BVCWmSDm7mrDNOkajMRxSq2R sGkeGh8fK/Iqk1iT2DKgbV3sT3t3jwJ4zH6dRIiKE+2/cZ3xAKuDe0LCbwQF85l9BZ3R d9dA== 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; bh=dPY3K/Acm9nxIAePiyb0ehFdGb2n7UfNffz++FHLga8=; b=X7V7ABFxOs6OgVil/iF1dgBkkKdBNu28dYDoJjRa8Ywi0CffMksIZTVxzuw4LSqCgB nlUBe/nUloum0Ol2I5sQzBj4zzzrBVx45aZmWPdp1e6RySwEtvJ5xc9aBom6ZatO1/m7 DLs3kLGuwiXoQ5XCGZW0jRrOfslKTk4w9A1hrTjrUmp6Hpmpb2nJ/vU0IW7jmLOqBSoy DCjrIMO82KdYu7Cvfm+ANuTJcEZ0L7rtZg5Z8XQzHrz5mpHjbStDCFHzTTwXJYgyQsq7 fa8toyjmS3ZWm5GBMyF4Y6jwNo2hCfpZHCAMyq2Dfm5dKAA534/cn7iLnxqOYeRYEmRc 1B2A== 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 o22si2947786pgb.584.2018.12.07.08.49.28; Fri, 07 Dec 2018 08:49:44 -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 S1726129AbeLGQso (ORCPT + 99 others); Fri, 7 Dec 2018 11:48:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34960 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726034AbeLGQsn (ORCPT ); Fri, 7 Dec 2018 11:48:43 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CF71430DDBD1; Fri, 7 Dec 2018 16:48:43 +0000 (UTC) Received: from localhost (ovpn-116-57.gru2.redhat.com [10.97.116.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id 699EF7D962; Fri, 7 Dec 2018 16:48:39 +0000 (UTC) Date: Fri, 7 Dec 2018 14:48:37 -0200 From: Eduardo Habkost To: Konrad Rzeszutek Wilk Cc: Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , kvm@vger.kernel.org, Jim Mattson , x86@kernel.org, linux-kernel@vger.kernel.org, KarimAllah Ahmed , David Woodhouse Subject: Re: [PATCH] kvm: x86: Report STIBP on GET_SUPPORTED_CPUID Message-ID: <20181207164837.GE7395@habkost.net> References: <20181205191956.31480-1-ehabkost@redhat.com> <20181205220206.GA16013@char.us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181205220206.GA16013@char.us.oracle.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 07 Dec 2018 16:48:43 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 05, 2018 at 05:02:06PM -0500, Konrad Rzeszutek Wilk wrote: > On Wed, Dec 05, 2018 at 05:19:56PM -0200, Eduardo Habkost wrote: > > Months ago, we have added code to allow direct access to MSR_IA32_SPEC_CTRL > > to the guest, which makes STIBP available to guests. This was implemented > > by commits d28b387fb74d ("KVM/VMX: Allow direct access to > > MSR_IA32_SPEC_CTRL") and b2ac58f90540 ("KVM/SVM: Allow direct access to > > MSR_IA32_SPEC_CTRL"). > > > > However, we never updated GET_SUPPORTED_CPUID to let userspace know that > > STIBP can be enabled in CPUID. Fix that by updating > > Ooops! > > kvm_cpuid_8000_0008_ebx_x86_features and kvm_cpuid_7_0_edx_x86_features. > > Shouldn't there also be a patch in QEMU to use it? (aka, +stibp). I will submit the QEMU patch soon. A patch exists on some downstream QEMU distributions, already, but it was never merged upstream because GET_SUPPORTED_CPUID never supported STIBP in the upstream kernel. (And because in the end it was not used for mitigating Spectre) > > Reviewed-by: Konrad Rzeszutek Wilk Thanks! -- Eduardo