Received: by 10.223.185.116 with SMTP id b49csp988401wrg; Fri, 23 Feb 2018 09:56:54 -0800 (PST) X-Google-Smtp-Source: AH8x225MDLdtKayxdEl+A3eEL1auw3iKM+Lr/QHBYKlBRX4Gj0/yXnyv+G+SjVfW7jAF8U9SxVeq X-Received: by 10.101.76.143 with SMTP id m15mr2092074pgt.445.1519408614556; Fri, 23 Feb 2018 09:56:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519408614; cv=none; d=google.com; s=arc-20160816; b=bVGTD6pMC5ENQFx01CKEugq/Y2n7EbV9K9mODMXfUvl0BpoSgtLDyBvVOPR1R6t5Zv E/A0RoUrXk4+gI9F2755hD8yCfwj55eb4kRmWWvD9y/jYplAdAurtJJvW4mU1esygXJ/ aIEgoXMQxXK6Ktg0t6pylOeCeg7fHb39UX9zTnU+jGGE6WROo4mweOY5mxx1RchCe+G5 ZRk2yjTyTd4OAsWLkMOwynxbBt8rESo6AA/yP/9IJPZKC+1YEB3lh0/q+2WlDtQkNSPC /zSHzyywgrdQHOwa4vg38uDhG8hGIn7Du8uX0abGACEMzflZHXUb37EWYbMU5QGpC6Y4 U3TQ== 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:dkim-signature:arc-authentication-results; bh=wbz7c00OjrHCPWRaf2gkkn6g8vquIXDxl0dOcCFiOxs=; b=ny70UAMmjG9KatvNk0monWx2j08jF7NWCoQucx6mgVmKMNTOQ/iDeEL53jCCyJ4cxD we/L5IVB2rwBz5emHD9vJCxX8QqwcVFL5ZqUgYyCmT5ScQZ2kUlOqrHta4eME7prQmg5 QY8fmYQF5bPZDPG4ZpnxMKue0RrX6x+dLAnN3Ii9JQuRMpQO9UKPFZHIqJTraCdv/DFn bM7kY15aTh7yAq/DmPKUQKMjwjz+SIldOQU9CLCPW4wAz+aMbMdmWc9HsJceICm5k2Rz AkbMP+JsKDorLf49zi2pM+RJhZPhkO0hKC/Oo7WbhuM4vWcQwhH/3wKXsOxkOeB+bAel oXNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=TBSgKwZh; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n10-v6si2113374pls.112.2018.02.23.09.56.39; Fri, 23 Feb 2018 09:56: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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=TBSgKwZh; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751648AbeBWR4B (ORCPT + 99 others); Fri, 23 Feb 2018 12:56:01 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:55956 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751351AbeBWRz7 (ORCPT ); Fri, 23 Feb 2018 12:55:59 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w1NHpv3w044761; Fri, 23 Feb 2018 17:55:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=wbz7c00OjrHCPWRaf2gkkn6g8vquIXDxl0dOcCFiOxs=; b=TBSgKwZhDF9LV6vxXgCFkxPZhl7CmeVYKyqlPVAX/S1I+m8DQdwJChFI1oTCWs5n9srG gnmIkVUVROtlU6HuAVIxS1pGrtlFrmDals+l+kgRSVgOCK77h+dO4ojtSyA1qJUfS0WT GMq7JTkc3hgKU9rennExvpI44KKEMlvAI+UaLld75GUpbjepJgNw1Q9e/t97BE2AmO/l aOPdNsh/h5d5rXreCDcs0+r2ZanBYxFw7dPX4hsq4AHIUUFxslAhPzPnVaSsFQT4PZ4t Tm4gdVC8GaZ70++6Ay/2pedQ/3ZfgO0fgAck//YABGW/CVbY9e4seZMkVP1EpAVa+arh 5A== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2gaqq300kp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 23 Feb 2018 17:55:46 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w1NHtjEf007672 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 23 Feb 2018 17:55:45 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w1NHtiaE028348; Fri, 23 Feb 2018 17:55:45 GMT Received: from char.us.oracle.com (/10.137.176.158) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 23 Feb 2018 09:55:44 -0800 Received: by char.us.oracle.com (Postfix, from userid 1000) id 640C06A00FB; Fri, 23 Feb 2018 12:55:43 -0500 (EST) Date: Fri, 23 Feb 2018 12:55:43 -0500 From: Konrad Rzeszutek Wilk To: Paolo Bonzini Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, x86@kernel.org, Radim =?utf-8?B?S3LEjW3DocWZ?= , KarimAllah Ahmed , David Woodhouse , Jim Mattson , Thomas Gleixner , Ingo Molnar , stable@vger.kernel.org Subject: Re: [PATCH 1/3] KVM: x86: use native MSR ops for SPEC_CTRL Message-ID: <20180223175543.GN8252@char.us.oracle.com> References: <1519249297-73718-1-git-send-email-pbonzini@redhat.com> <1519249297-73718-2-git-send-email-pbonzini@redhat.com> <20180222170717.GP31483@char.us.oracle.com> <20180223172220.GK8252@char.us.oracle.com> <7534bcd3-e21b-240c-9ed2-62026ba10301@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7534bcd3-e21b-240c-9ed2-62026ba10301@redhat.com> User-Agent: Mutt/1.8.3 (2017-05-23) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8813 signatures=668678 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=940 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802230219 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 23, 2018 at 06:35:30PM +0100, Paolo Bonzini wrote: > On 23/02/2018 18:22, Konrad Rzeszutek Wilk wrote: > > On Fri, Feb 23, 2018 at 10:37:49AM +0100, Paolo Bonzini wrote: > >> On 22/02/2018 18:07, Konrad Rzeszutek Wilk wrote: > >>>> Having a paravirt indirect call in the IBRS restore path is not a > >>>> good idea, since we are trying to protect from speculative execution > >>>> of bogus indirect branch targets. It is also slower, so use > >>>> native_wrmsrl on the vmentry path too. > >>> But it gets replaced during patching. As in once the machine boots > >>> the assembler changes from: > >>> > >>> callq *0xfffflbah > >>> > >>> to > >>> wrmsr > >>> > >>> ? I don't think you need this patch. > >> > >> Why not be explicit? According to the spec, PRED_CMD and SPEC_CTRL > > > > Explicit is fine. > > > > But I would recommend you change the commit message to say so, and > > perhaps remove 'It is also slower' - as that is incorrect. > > Actually it is faster---that's why I made the change in the first place, > though later I noticed > > > If it is detected to be Xen PV, then yes > > it will be a call to a function. But that won't help as Xen PV runs in > > ring 3, so it has a whole bunch of other issues. > > Ok, I wasn't sure about PVH (which runs in ring 0 afair). Right. PVH is HVM without any emulated devices or BIOSes or such. In the context of the paravirt ops, Xen PVH == Xen HVM. Xen PV (and lguests) are the only ones that patch the the callq *0xffffblah to callq 0xffff800 While everyone else does the wrmsr. > > Paolo