From: "Jan Beulich" Subject: Re: [PATCH] x86/vPMU: constrain MSR_IA32_DS_AREA loads Date: Thu, 17 Dec 2015 07:29:31 -0700 Message-ID: <5672D4DB02000078000C0CD5@prv-mh.provo.novell.com> References: <5672CE4002000078000C0C7D@prv-mh.provo.novell.com> <5672C2C6.9020808@oracle.com> <5672D24802000078000C0CB7@prv-mh.provo.novell.com> <5672C60E.3010303@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1a9ZYm-0002H0-KZ for xen-devel@lists.xenproject.org; Thu, 17 Dec 2015 14:29:36 +0000 In-Reply-To: <5672C60E.3010303@oracle.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: Boris Ostrovsky Cc: Andrew Cooper , Kevin Tian , Keir Fraser , Jun Nakajima , xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 17.12.15 at 15:26, wrote: > On 12/17/2015 09:18 AM, Jan Beulich wrote: >>>>> On 17.12.15 at 15:12, wrote: >>> On 12/17/2015 09:01 AM, Jan Beulich wrote: >>>> @@ -415,8 +416,10 @@ static int core2_vpmu_verify(struct vcpu >>>> enabled_cntrs |= (1ULL << i); >>>> } >>>> >>>> - if ( vpmu_is_set(vcpu_vpmu(v), VPMU_CPU_HAS_DS) && >>>> - !is_canonical_address(core2_vpmu_cxt->ds_area) ) >>>> + if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_DS) && >>>> + !(has_hvm_container_vcpu(v) >>>> + ? is_canonical_address(core2_vpmu_cxt->ds_area) >>>> + : __addr_ok(core2_vpmu_cxt->ds_area)) ) >>> Should we instead of (or in addition to) this also make the same change >>> in core2_vpmu_do_wrmsr()? >> Currently there's no need for this since - afaict - PV guests can't >> write this MSR directly (it's not among the white listed set in >> traps.c). > > Then we probably shouldn't set VPMU_CPU_HAS_DS for PV guests. Or add the MSR to the permitted set. You know better than I what the best route here is. Jan