Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752602AbdLFRzu (ORCPT ); Wed, 6 Dec 2017 12:55:50 -0500 Received: from mga14.intel.com ([192.55.52.115]:44680 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752172AbdLFRzq (ORCPT ); Wed, 6 Dec 2017 12:55:46 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,369,1508828400"; d="scan'208";a="184284104" Date: Wed, 6 Dec 2017 09:55:43 -0800 From: Andi Kleen To: Jan Dakinevich Cc: linux-kernel@vger.kernel.org, "Denis V . Lunev" , Roman Kagan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , "H. Peter Anvin" , x86@kernel.org, Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Kan Liang , Stephane Eranian , Colin King , Sebastian Andrzej Siewior , Jin Yao , kvm@vger.kernel.org Subject: Re: [PATCH RFC 2/2] KVM: x86/vPMU: ignore access to LBR-related MSRs Message-ID: <20171206175543.GM3070@tassilo.jf.intel.com> References: <1512560585-27263-1-git-send-email-jan.dakinevich@virtuozzo.com> <1512560585-27263-3-git-send-email-jan.dakinevich@virtuozzo.com> <20171206155728.GL3070@tassilo.jf.intel.com> <20171206200207.11094037@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171206200207.11094037@virtuozzo.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 944 Lines: 25 On Wed, Dec 06, 2017 at 08:02:07PM +0300, Jan Dakinevich wrote: > On Wed, 6 Dec 2017 07:57:28 -0800 > Andi Kleen wrote: > > > > > If you do all this it's only a small step to fully enable LBRs for > > guests. > > It is quite simple in a case where guest LBR-related MSRs matches host > ones. They could be handled by MSR load/store areas, I suppose. There is already a LBR control to enable/disable I believe. You don't want to save/restore all MSRs on every entry/exit because that would be slow. The normal Linux context switch can do it. > > In other cases, it could be expected the different amount of these MSRs > and different theirs base values (e.g. Nehalem vs Core). Guest MSRs > could be both subset and superset of host MSRs, so additional efforts > to support this would be required. In this case ignoring would be sufficient I suppose. But for the case when everything matches it should work. -Andi