Received: by 10.223.176.5 with SMTP id f5csp2877117wra; Mon, 5 Feb 2018 11:25:40 -0800 (PST) X-Google-Smtp-Source: AH8x225UdXCF5+J5NF47++dI/jhe0ksacUhOUqB1ZPZMgsphSqeOZ2pcd+kq9PRNsAo7GIVlizU9 X-Received: by 10.98.11.201 with SMTP id 70mr11925326pfl.16.1517858740377; Mon, 05 Feb 2018 11:25:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517858740; cv=none; d=google.com; s=arc-20160816; b=twuk2vPVxBagqBsXkesmdY0Ip3MSee0OiiVgeQIQvgGJfR0bMauwiB7xMn4uaqzjF6 eogi0ZFAA6SrbHijlpiUqe6pUOceqQwsRWCMWX5nf8TRnby45uKVOBk0AgPPMV4ZVKY/ MYhhxvN8UF3jfTcfMr68R5+nMMd62Y4K6Sns+dqPuAkZfZ3t6y0Tr96rr39zT4gFAarJ oWIEYCWUMYFwV/vJAKaD+FJ1vE4kyBwF95aCXYzXnsn8iXhe8b4ShIratDcwVivec2Uz 95E4PnL2jBQz7ecBGKkoyTMO5lAPfIYsx4mW17NZQDI8z9lzcs/LG7w7WDqfQ1H567mR 3v/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=Pe67joqCRwya6ffB/y0vZrQbjn/tlxMI6QQYrN6s5N4=; b=RczvDvmKkf2BnxoK/TMGizJZqPYN+EHzZoInuJuSduEy31+EGUIejEM05Yz7Nzvxti NUQ50qzFfj4x8SoZwou73ryA0m87JUVv+YaLxherEL8DjWqXnV9ykz6/iX/6cZRD0L8A nhczEoxaE4XxvRUvE+IIPeHYIdveN+qjjDUKPGdN5rzeFARL+xzBR6XSdhLDqx8PdlRh UQxIpaaJX3rKe1uEv72DOiuClxX013Yeuz9DiyzZMwkiL+DnC9SCdtovz6MP1dbwgf3e Rmmqggem/vmjl5RF8K9n1n2SrV2ng9S/cTzStFEL1mjm1OryRe76HvUIs05dSdpZnqzh AHcA== 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 n6-v6si7413486plp.562.2018.02.05.11.25.25; Mon, 05 Feb 2018 11:25:40 -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 S1751857AbeBETYP (ORCPT + 99 others); Mon, 5 Feb 2018 14:24:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59428 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751544AbeBETYI (ORCPT ); Mon, 5 Feb 2018 14:24:08 -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 2FD4D78523; Mon, 5 Feb 2018 19:24:08 +0000 (UTC) Received: from [10.36.116.201] (ovpn-116-201.ams2.redhat.com [10.36.116.201]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 689D5600C8; Mon, 5 Feb 2018 19:24:03 +0000 (UTC) Subject: Re: [PATCH v6 2/5] KVM: x86: Add IBPB support To: Konrad Rzeszutek Wilk , David Woodhouse Cc: KarimAllah Ahmed , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Ashok Raj , Asit Mallick , Dave Hansen , Arjan Van De Ven , Tim Chen , Linus Torvalds , Andrea Arcangeli , Andi Kleen , Thomas Gleixner , Dan Williams , Jun Nakajima , Andy Lutomirski , Greg KH , Peter Zijlstra References: <1517522386-18410-1-git-send-email-karahmed@amazon.de> <1517522386-18410-3-git-send-email-karahmed@amazon.de> <20180202174932.GR28192@char.us.oracle.com> <1517594544.31953.62.camel@infradead.org> <20180202195601.GD28192@char.us.oracle.com> <1517602575.31953.74.camel@infradead.org> <20180202202857.GI28192@char.us.oracle.com> From: Paolo Bonzini Message-ID: <5fae597b-c70e-1610-165e-5afc3ec996a9@redhat.com> Date: Mon, 5 Feb 2018 20:24:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180202202857.GI28192@char.us.oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit 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.28]); Mon, 05 Feb 2018 19:24:08 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/02/2018 21:28, Konrad Rzeszutek Wilk wrote: >>>> Nothing would *set* the IBPB bit though, since that's a "virtual" bit >>>> on Intel hardware. The comment explains why we have that |= F(IBPB), >>>> and if the comment wasn't true, we wouldn't need that code either. >>> But this seems wrong. That is on Intel CPUs we will advertise on >>> AMD leaf that the IBPB feature is available. >>> >>> Shouldn't we just check to see if the machine is AMD before advertising >>> this bit? >> No. The AMD feature bits give us more fine-grained support for exposing >> IBPB or IBRS alone, so we expose those bits on Intel too. > But but.. that runs smack against the idea of exposing a platform that > is as close to emulating the real hardware as possible. > > As in I would never expect an Intel CPU to expose the IBPB on the 0x8000_0008 > leaf. Hence KVM (nor any hypervisor) should not do it either. This is KVM_GET_*SUPPORTED*_CPUID. The actual CPUID bits that are exposed (and also which CPUID leafs are there, even though this one is present in both Intel and AMD) are determined by userspace. Paolo