From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH v4 15/17] x86/VPMU: NMI-based VPMU support Date: Tue, 04 Feb 2014 11:50:29 -0500 Message-ID: <52F11A55.4020708@oracle.com> References: <1390331342-3967-1-git-send-email-boris.ostrovsky@oracle.com> <1390331342-3967-16-git-send-email-boris.ostrovsky@oracle.com> <52F0E1BB0200007800118F8E@nat28.tlf.novell.com> <52F115E3.3050109@oracle.com> <52F126570200007800119259@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <52F126570200007800119259@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: keir@xen.org, suravee.suthikulpanit@amd.com, andrew.cooper3@citrix.com, eddie.dong@intel.com, dietmar.hahn@ts.fujitsu.com, xen-devel@lists.xen.org, jun.nakajima@intel.com List-Id: xen-devel@lists.xenproject.org On 02/04/2014 11:41 AM, Jan Beulich wrote: >>>> On 04.02.14 at 17:31, Boris Ostrovsky wrote: >> On 02/04/2014 06:48 AM, Jan Beulich wrote: >>> And then I'm still missing a reasonable level of analysis that the >>> previously non-NMI-only interrupt handler is now safe to use in NMI >>> context. >> How about this? > Looks okay, except ... > >> 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 can only access PMU MSRs. > ... that this additionally needs to exclude things like > {rd,wr}msr_safe() (i.e. stuff raising exceptions that normally > get recovered from). I'll add that. And probably a comment in vendor-specific code to remind people that these routines need to be NMI-safe. -boris