[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3 15/16] x86/VPMU: NMI-based VPMU support



On 01/16/2014 04:35 AM, Jan Beulich wrote:

+/* Process the softirq set by PMU NMI handler */
+static void pmu_softnmi(void)
+{
+    struct cpu_user_regs *regs;
+    struct vcpu *v, *sampled = per_cpu(sampled_vcpu, smp_processor_id());
+
+    if ( vpmu_mode & XENPMU_MODE_PRIV ||
+         sampled->domain->domain_id >= DOMID_FIRST_RESERVED )
+        v = dom0->vcpu[smp_processor_id()];
+    else
+        v = sampled;
+
+    regs = &v->arch.vpmu.xenpmu_data->pmu.regs;
+    if ( is_hvm_domain(sampled->domain) )
+    {
+        struct segment_register cs;
+
+        hvm_get_segment_register(sampled, x86_seg_cs, &cs);
+        regs->cs = cs.attr.fields.dpl;
+    }
+
+    send_guest_vcpu_virq(v, VIRQ_XENPMU);
+}
Perhaps I should have asked this on an earlier patch already:
How is this supposed to work for a 32-bit HVM guest?
struct cpu_user_regs is clearly different for it than what the
hypervisor or a 64-bit HVM guest would use.

Right, I need to XLAT_cpu_user_regs() for 32-bit HVM guest in vpmu_interrupt() (I already do it for a PV guest).

Thanks.
-boris


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.