From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andi Kleen Subject: Re: [PATCH] KVM: VMX: Cache IA32_DEBUGCTL in memory Date: Wed, 29 Nov 2017 12:56:24 -0800 Message-ID: <20171129205624.GD3070@tassilo.jf.intel.com> References: <1511935673-7371-1-git-send-email-wanpeng.li@hotmail.com> <87fu8xj69o.fsf@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Wanpeng Li , LKML , kvm list , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Wanpeng Li To: Jim Mattson Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Wed, Nov 29, 2017 at 11:05:46AM -0800, Jim Mattson wrote: > An alternative is to give the L1 guest read permission for this MSR in > the MSR permission bitmaps. It's still going to be ~80 cycles, but > that's better than the cost of a VM-exit/VM-entry round-trip. It's a useful optimization, 80 cycles is 80 cycles. The cache invalidation could likely be really simple, like: have a global counter always check the counter before and after and don't use the cache if they don't match. change KDB etc. to increase the counter. -Andi