From: "Jan Beulich" Subject: Re: [PATCH v10 16/20] x86/VPMU: Merge vpmu_rdmsr and vpmu_wrmsr Date: Wed, 10 Sep 2014 16:33:58 +0100 Message-ID: <54108B8602000078000336B4@mail.emea.novell.com> References: <1409802080-6160-1-git-send-email-boris.ostrovsky@oracle.com> <1409802080-6160-17-git-send-email-boris.ostrovsky@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1409802080-6160-17-git-send-email-boris.ostrovsky@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: tim@xen.org, kevin.tian@intel.com, keir@xen.org, suravee.suthikulpanit@amd.com, andrew.cooper3@citrix.com, eddie.dong@intel.com, xen-devel@lists.xen.org, Aravind.Gopalakrishnan@amd.com, jun.nakajima@intel.com List-Id: xen-devel@lists.xenproject.org >>> On 04.09.14 at 05:41, wrote: > @@ -199,11 +192,11 @@ int vpmu_do_interrupt(struct cpu_user_regs *regs) > vpmu_reset(vpmu, VPMU_CONTEXT_SAVE | VPMU_CONTEXT_LOADED); > > /* Store appropriate registers in xenpmu_data */ > - if ( is_pv_32bit_domain(sampled->domain) ) > + if ( is_pv_32bit_domain(sampling->domain) ) > { > /* > * 32-bit dom0 cannot process Xen's addresses (which are 64 bit) > - * and therefore we treat it the same way as a non-priviledged > + * and therefore we treat it the same way as a non-privileged > * PV 32-bit domain. > */ > struct compat_cpu_user_regs *cmp; This whole hunk doesn't seem to belong here (and the first part of it seems actually wrong). > --- a/xen/include/asm-x86/hvm/vpmu.h > +++ b/xen/include/asm-x86/hvm/vpmu.h > @@ -95,9 +95,12 @@ static inline bool_t vpmu_are_all_set(const struct vpmu_struct *vpmu, > return !!((vpmu->flags & mask) == mask); > } > > +#define VPMU_MSR_READ 0 > +#define VPMU_MSR_WRITE 1 > + > void vpmu_lvtpc_update(uint32_t val); > -int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content, uint64_t supported); > -int vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content); > +int vpmu_do_msr(unsigned int msr, uint64_t *msr_content, > + uint64_t supported, int rw); Just like I think I said on another patch: Perhaps worth keeping the old functions as inline wrappers? And perhaps making the new parameter simply boolean? Jan