From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x2251xS+h4bqLwJb8mwQoe0yCtEecXVol3HxKvxVW22I4y/baO6t2IV6+ESPABdQ1uT8tAYyI ARC-Seal: i=1; a=rsa-sha256; t=1517381678; cv=none; d=google.com; s=arc-20160816; b=H+e8jNmOxH5mxqOyUNgcFAexuv3cVwry/yclONAHb6Pxvs2oZY8gZPUAKZYmfxPrv4 RWnRflF/AUUc7+D2ZL1HAfVlH/NKpiixl7qesO9wgxtRbLsvnOqniLveTGo46MTtY4Pp Ko8qlUx0VZBcs1z4gvw8B1WVGV3WNRKZSdDdmBKZCVuOZFNRVX1Ntztz0y0PmImbsnJJ x5jPtMYBosbZvXTorYgaOaxMTTF58lUqxXSVZlt3IHSAZxxMRl93JK151sQdiRQFWEHE PRDYDK+vLEe3Af8lRLzh5j1ep5Gp6GE0axfSDU2CJmdqy1xHg6M/5xqDIV5mU8lje4NQ qqKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:cc:references:to:subject :arc-authentication-results; bh=L0OT9tLGZM0CGe2w2BsTFjyHtXxWDozio+Cb0TuHR3c=; b=Rejq6XwPCVAe6qpqHj1SU5jR5Y/rMWX1UjCE3oGmGdIPUUeyx+oHBCGUQdhlhwRkzC zfuUBUgDE5FX9At0+cbaY9sWq6OqrD7b8ZdsYAITh4zCO5HRII/LEo9NJkDHJz4uvU+c DioHi12s42QALOpd5RyNrZN4kLKeNZ4F6LntLP6onDfARpE0QJBHi6oU7v+mwmz8gaAI bpxEr055lhU1YAgQaPPvi3prKZDsuuK8f/4jdEPSqZFVzeHCC1zfJCwX8OfKLoB/SJOa YWmNO2KSb8OMC2sNdMMAyAe5j2oHfzrNykSXwqzYgum5MGw7MoOi0gfAtJQBWcWFosCU /lKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dave.hansen@intel.com designates 192.55.52.120 as permitted sender) smtp.mailfrom=dave.hansen@intel.com Authentication-Results: mx.google.com; spf=pass (google.com: domain of dave.hansen@intel.com designates 192.55.52.120 as permitted sender) smtp.mailfrom=dave.hansen@intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,438,1511856000"; d="scan'208";a="170510257" Subject: Re: [PATCH v3 0/4] KVM: Expose speculation control feature to guests To: Paolo Bonzini , "Raj, Ashok" References: <1517271028-15916-1-git-send-email-karahmed@amazon.de> <1517302830.18619.78.camel@infradead.org> <6b7db789-9cc1-1b4d-9209-8d082e0d8def@redhat.com> <20180130234822.GA62797@otc-nc-03> Cc: David Woodhouse , KarimAllah Ahmed , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Andi Kleen , Andrea Arcangeli , Andy Lutomirski , Arjan van de Ven , Asit Mallick , Borislav Petkov , Dan Williams , Greg Kroah-Hartman , "H . Peter Anvin" , Ingo Molnar , Janakarajan Natarajan , Joerg Roedel , Jun Nakajima , Laura Abbott , Linus Torvalds , Masami Hiramatsu , Peter Zijlstra , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Thomas Gleixner , Tim Chen , Tom Lendacky From: Dave Hansen Message-ID: Date: Tue, 30 Jan 2018 22:54:37 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1590974343910960333?= X-GMAIL-MSGID: =?utf-8?q?1591090011031546333?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: On 01/30/2018 04:16 PM, Paolo Bonzini wrote: > On 30/01/2018 18:48, Raj, Ashok wrote: >>> Certainly not every vmexit! But doing it on every userspace vmexit and >>> every sched_out would not be *that* bad. >> Right.. agreed. We discussed the different scenarios that doing IBPB >> on VMexit would help, and decided its really not required on every exit. >> >> One obvious case is when there is a VMexit and return back to Qemu >> process (witout a real context switch) do we need that to be >> protected from any poisoned BTB from guest? > If the host is using retpolines, then some kind of barrier is needed. I > don't know if the full PRED_CMD barrier is needed, or two IBRS=1/IBRS=0 > writes back-to-back are enough. I think the spec is pretty clear here: protection is only provided *while* IBRS=1. Once it goes back to 0, all bets are off.