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

Re: [Xen-devel] [PATCH v5 RESEND 15/17] x86/VPMU: NMI-based VPMU support



On 04/26/2014 04:48 AM, Tian, Kevin wrote:
From: Boris Ostrovsky [mailto:boris.ostrovsky@xxxxxxxxxx]
Sent: Wednesday, April 23, 2014 8:51 PM

Add support for using NMIs as PMU interrupts.

Most of processing is still performed by vpmu_do_interrupt(). However, since
certain operations are not NMI-safe we defer them to a softint that
vpmu_do_interrupt()
will schedule:
* For PV guests that would be send_guest_vcpu_virq()
* For HVM guests it's VLAPIC accesses and hvm_get_segment_register() (the
later
can be called in privileged profiling mode when the interrupted guest is an
HVM one).

With send_guest_vcpu_virq() and hvm_get_segment_register() for PV(H) and
vlapic
accesses for HVM moved to sofint, the only routines/macros that
vpmu_do_interrupt()
calls in NMI mode are:
* memcpy()
* querying domain type (is_XX_domain())
* guest_cpu_user_regs()
* XLAT_cpu_user_regs()
* raise_softirq()
* vcpu_vpmu()
* vpmu_ops->arch_vpmu_save()
* vpmu_ops->do_interrupt() (in the future for PVH support)

The latter two only access PMU MSRs with {rd,wr}msrl() (not the _safe
versions
which would not be NMI-safe).

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
if a SCHEDULE_SOFTIRQ happens before NMI_SOFTIRQ, will it cause any race
condition when accessing previous recorded content in nmi softirq handler?

I think you are right.

I in fact had an earlier version where I'd put the record into a linked list but when I later looked at that code again I took it out because I thought it was unnecessary. But now that you mentioned it I may need to resurrect that code. Let me think about this again.

-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®.