From: "Jan Beulich" Subject: Re: [PATCH RFC V8 3/5] xen, libxc: Force-enable relevant MSR events Date: Wed, 27 Aug 2014 16:44:11 +0100 Message-ID: <53FE18EB020000780002E2E4@mail.emea.novell.com> References: <1409148101-11703-1-git-send-email-rcojocaru@bitdefender.com> <1409148101-11703-3-git-send-email-rcojocaru@bitdefender.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XMfm6-0001rt-PT for xen-devel@lists.xenproject.org; Wed, 27 Aug 2014 16:08:42 +0000 In-Reply-To: <1409148101-11703-3-git-send-email-rcojocaru@bitdefender.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Razvan Cojocaru Cc: kevin.tian@intel.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, eddie.dong@intel.com, tim@xen.org, jun.nakajima@intel.com, xen-devel@lists.xenproject.org, ian.jackson@eu.citrix.com List-Id: xen-devel@lists.xenproject.org >>> On 27.08.14 at 16:01, wrote: > Vmx_disable_intercept_for_msr() will now refuse to disable interception of > MSRs needed for memory introspection. It is not possible to gate this on > mem_access being active for the domain, since by the time mem_access does > become active the interception for the interesting MSRs has already been > disabled (vmx_disable_intercept_for_msr() runs very early on). > > Changes since V1: > - Replaced printk() with gdprintk(XENLOG_DEBUG, ...). > > Changes since V2: > - Split a log line differently to keep it grepable. > - Interception for relevant MSRs will be disabled only if > mem_access is not enabled. > - Since they end up being disabled early on (when mem_access > is not enabled yet), re-enable interception when mem_access > becomes active. > > Changes since V3: > - Removed log line stating that MSR interception cannot be disabled. > - Removed superfluous #include . > - Moved VMX-specific code to vmx.c (as a new hvm_funcs member). > > Changes since V5: > - Added xc_mem_access_enable_introspection() to libxc, which has > the same parameters and semantics as xc_mem_access_enable(), > but it additionally sets d->arch.hvm_domain.introspection_enabled > and enables relevant MSR interception. > - Renamed vmx_enable_intro_msr_interception() to > vmx_enable_msr_exit_interception(). > - Simplified vmx_enable_msr_exit_interception() (const array of MSRs). > > Changes since V6: > - Moved the array of interesting MSRs to common header. > - Minor code cleanup. > > Changes since V7: > - Reversed if conditions (cheapest one first). > - Combined two if statements. > - Moved "bool_t introspection_enabled;" to the bool_t group above. > - Renamed msrs_exit_array to vmx_msrs_exit_array and made it > "extern" in the header. > > Signed-off-by: Razvan Cojocaru > --- > tools/libxc/xc_mem_access.c | 10 +++++++++- > tools/libxc/xc_mem_event.c | 7 +++++-- > tools/libxc/xc_private.h | 2 +- > tools/libxc/xenctrl.h | 2 ++ > xen/arch/x86/hvm/vmx/vmcs.c | 25 +++++++++++++++++++++++++ > xen/arch/x86/hvm/vmx/vmx.c | 12 ++++++++++++ > xen/arch/x86/mm/mem_event.c | 11 +++++++++++ > xen/include/asm-x86/hvm/domain.h | 1 + > xen/include/asm-x86/hvm/hvm.h | 2 ++ > xen/include/asm-x86/hvm/vmx/vmcs.h | 3 +++ > xen/include/public/domctl.h | 7 ++++--- > 11 files changed, 75 insertions(+), 7 deletions(-) For the hypervisor parts: Acked-by: Jan Beulich