Received: by 10.223.185.116 with SMTP id b49csp474412wrg; Fri, 23 Feb 2018 01:38:47 -0800 (PST) X-Google-Smtp-Source: AH8x227laG/g80uq+XGSXav3pdPh03MzXJSbY+NY8O/COsYzl+2fmxr1EYGpyQJ0b9N12Tibpepl X-Received: by 10.99.103.195 with SMTP id b186mr965291pgc.446.1519378727504; Fri, 23 Feb 2018 01:38:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519378727; cv=none; d=google.com; s=arc-20160816; b=zeMf9IFnnPME0z7TP/X4LfbLMGkVeBSKFpfVuaEn+caex1nezDu1OkEqSnUgPT2is2 FYbJOsW0rGWyhKBlTUPV9VmIjKSF2SKDJAfwMLX1PmdmeZfVN589sOJTBRJMLr+srxxM oW26aZlUEkcx+7LnmG6qR4KDSI+A2ydSY5XudPk5oB5PZxL3cbQ80lHD1z0+6OfHSTZp e3ZWkCGNaDdOUw5tcrvTGmaYF2NEirTqFa2Npo7rYQnvSAsojU8iUSlfK2EwwnRN+GGg 9fAwwbYr1QheAiijdhjm8Gx+d5BCz4Rja5/0E4cm/I7dX+3Z81Cm24ltc0RhpcUNGh7F TT1Q== 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=2oDSnVUIbQ/Q20VhDW7n9VbS+oaZRUBeNBy4/WbEcmM=; b=rj7RATRObJlcDc8B2XSsJRcaw0j8yXgj40ccQEjArc9UW5TdFp3JpV6XFZy6+M5Tv6 VTpVZhcHO7LXUV72WD7v6ilaJn9pbXlcEnholzAEzCKTjnQ5RiF2ayQz5EDUX6Jy+Urm EPYEH37aWa4HK1OStJJgAOWyUMVY5EqlVhXIy6AmIHh4PbP8MdKcUVW6mXNEZn3Z8c/V kI77Znr5LvKwNsh35NWR+4moG4L97bTHKYfjiqf91HFOeNW0gb7XbQdJWbStK6VSDqZh vkE0p3b0mqi26AtsIwR/eW66pCAYSsXcUJEf9lBhSlpyjblbcESTJZETNBJWEOlJgeFr EjJQ== 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 b22si1314120pgn.296.2018.02.23.01.38.33; Fri, 23 Feb 2018 01:38:47 -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 S1751553AbeBWJh4 (ORCPT + 99 others); Fri, 23 Feb 2018 04:37:56 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56960 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751360AbeBWJhy (ORCPT ); Fri, 23 Feb 2018 04:37:54 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EB69040363B6; Fri, 23 Feb 2018 09:37:53 +0000 (UTC) Received: from [10.36.117.249] (ovpn-117-249.ams2.redhat.com [10.36.117.249]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1DEF810073C5; Fri, 23 Feb 2018 09:37:50 +0000 (UTC) Subject: Re: [PATCH 1/3] KVM: x86: use native MSR ops for SPEC_CTRL To: Konrad Rzeszutek Wilk Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, x86@kernel.org, =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , KarimAllah Ahmed , David Woodhouse , Jim Mattson , Thomas Gleixner , Ingo Molnar , stable@vger.kernel.org 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> From: Paolo Bonzini Message-ID: Date: Fri, 23 Feb 2018 10:37:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180222170717.GP31483@char.us.oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 23 Feb 2018 09:37:54 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Fri, 23 Feb 2018 09:37:54 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pbonzini@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 should be passed down to the guest without interception so it's safe to do this. On the other hand, especially with nested virtualization, I don't think you can absolutely guarantee that the paravirt call will be patched to rdmsr/wrmsr. Paolo