From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x225YXKTWcZxylWty/Gz3GYDGYmJ7ozAhr0pFNcyzQikR6U/gamvtjXNjacT/fxSyUDbW9GDz ARC-Seal: i=1; a=rsa-sha256; t=1517424838; cv=none; d=google.com; s=arc-20160816; b=yeXzaw+cGLxvSTKty/A+ovIe+k1tETVrBQR2waWggPlxtmqlS2v16RBHYojrLc5E0b bGn1MoGfZDFifeyhd7nxLgw6aVas7+oQ91gOilSOcBCDoG6IXXjws93jtXCi1oXw4KOY 16uYn3p/M7x3VnRSDg68mXuSW0OcRd2GSZkVYugkhBlbWl5EfxdYqVF4nATIB+t6fde4 1hLlrrxX2I+sw3YivYCk8XIUxWcaVC1GTEzklmqxe7MznvIJqHYI4GbDUNpBhLDYcuaM FqSo54s1yQIIJB60q41zVX3GCQt28LRA+ul/IDU4d4+oBDJ2GrEZGCi9fX3UbaMnQMyO zkGw== 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:references:cc:to:subject :arc-authentication-results; bh=Z8BqjE5cOEiLjbyNIoicQaZQfdmt7Td59W9nV/+BN1k=; b=dOJduRkeGclNg1k9g1TESYxOzpFIad3HHwIaFCa+bGidOA4Ys7GOPH6uXVzTTAsi4y Zug8VWeV8hWr/i6dWhZuIVSAf2i8GdXDZEe2hC6PUJIA8ugqEr2yQy9CC8aw6Lig8jzV KdWKk8emoddc/z9d1pSD2K6lNLSzoeJQk6aOoz8hv91n1fFQpYOqrqCucTm3ExEJ/DPU I98TwD13TFVqoxPSN//+6Ea0jlPy7bmIa7L1xkwRdl/KX4MTM+xv7zdiXJMxkCM7V3oB FTuiy64Vby2hCEZIA0Dv0VfSbWfBCgvBJAm5VS1iMZJOMuEabj/T2F/10cshBn0M1Gul LjQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of pbonzini@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=pbonzini@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Authentication-Results: mx.google.com; spf=pass (google.com: domain of pbonzini@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=pbonzini@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Subject: Re: [PATCH v4 2/5] KVM: x86: Add IBPB support To: Jim Mattson Cc: KarimAllah Ahmed , the arch/x86 maintainers , LKML , kvm list , 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 , David Woodhouse References: <1517404231-22406-1-git-send-email-karahmed@amazon.de> <1517404231-22406-3-git-send-email-karahmed@amazon.de> <7dbf6cad-f03d-640c-bc95-d82deaa30cb7@redhat.com> From: Paolo Bonzini Message-ID: Date: Wed, 31 Jan 2018 13:53:48 -0500 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: 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?1591113771329535327?= X-GMAIL-MSGID: =?utf-8?q?1591135267302441134?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: On 31/01/2018 12:39, Jim Mattson wrote: > On Wed, Jan 31, 2018 at 8:55 AM, Paolo Bonzini wrote: > >> In fact this MSR can even be passed down unconditionally, since it needs >> no save/restore and has no ill performance effect on the sibling >> hyperthread. > > I'm a bit surprised to hear that IBPB has no ill performance impact on > the sibling hyperthread. On current CPUs, this has to flush the BTB, > doesn't it? And since the BTB is shared between hyperthreads, doesn't > the sibling lose all of its branch predictions? Yeah, I knew about that, but I hadn't heard yet that it also blocks the hyperthread while you do the write. It makes sense in retrospect. In any case, there's no difference (unlike IBRS) in the vmexit cost if the MSR is passed through. Paolo