[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v6 13/19] x86/VPMU: Handle PMU interrupts for PV guests
On 05/22/2014 11:30 AM, Jan Beulich wrote:
@@ -99,14 +120,87 @@ int vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content)
return 0;
if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->do_rdmsr )
- return vpmu->arch_vpmu_ops->do_rdmsr(msr, msr_content);
+ {
+ int ret = vpmu->arch_vpmu_ops->do_rdmsr(msr, msr_content);
+
+ if ( !is_hvm_domain(current->domain) &&
+ (current->arch.vpmu.xenpmu_data->pmu_flags & PMU_CACHED) )
Wouldn't the same comment as in WRMSR handling apply here too?
If so, either replicate it or add a brief comment referring to the
other one.
Yes, the comment is applicable here too and the next patch merges the
two routines.
+ /* Store appropriate registers in xenpmu_data */
+ if ( is_pv_32bit_domain(current->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
+ * PV 32-bit domain.
+ */
+ struct compat_cpu_user_regs *cmp;
+
+ gregs = guest_cpu_user_regs();
+
+ cmp = (void *)&v->arch.vpmu.xenpmu_data->pmu.r.regs;
+ XLAT_cpu_user_regs(cmp, gregs);
+ memcpy(&v->arch.vpmu.xenpmu_data->pmu.r.regs,
+ &cmp, sizeof(struct compat_cpu_user_regs));
Afaict this memcpy() does nothing (src == dst).
Yes, memcpy is unnecessary here, copying is already done by the
preceeding XLAT_cpu_user_reg().
-boris
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|