@@ -2422,6 +2422,14 @@ static bool cf_check svm_get_pending_event(
info->type = vmcb->event_inj.type;
info->error_code = vmcb->event_inj.ec;
+ if ( info->type == X86_EVENTTYPE_HW_EXCEPTION &&
+ info->vector == X86_EXC_DB )
+ {
+ unsigned long dr6 = v->arch.hvm.flag_dr_dirty ?
+ vmcb_get_dr6(vmcb) : v->arch.dr6;
+ info->pending_dbg = dr6 ^ X86_DR6_DEFAULT;
+ }
+
return true;
}
@@ -2469,6 +2469,14 @@ static bool cf_check vmx_get_pending_event(
info->type = MASK_EXTR(intr_info, INTR_INFO_INTR_TYPE_MASK);
info->error_code = error_code;
+ if ( info->type == X86_EVENTTYPE_HW_EXCEPTION &&
+ info->vector == X86_EXC_DB )
+ {
+ unsigned long dr6 = v->arch.hvm.flag_dr_dirty ?
+ read_debugreg(6) : v->arch.dr6;
+ info->pending_dbg = dr6 ^ X86_DR6_DEFAULT;
+ }
+
return true;
}
Ensure that we pass the correct pending_dbg value to hvm_monitor_interrupt(). Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com> --- CC: Andrew Cooper <andrew.cooper3@citrix.com> CC: Jan Beulich <JBeulich@suse.com> CC: Wei Liu <wl@xen.org> CC: Roger Pau Monné <roger.pau@citrix.com> CC: Jun Nakajima <jun.nakajima@intel.com> CC: Kevin Tian <kevin.tian@intel.com> CC: Tamas K Lengyel <tamas@tklengyel.com> CC: Alexandru Isaila <aisaila@bitdefender.com> CC: Petre Pircalabu <ppircalabu@bitdefender.com> v1 -> v2: new patch --- xen/arch/x86/hvm/svm/svm.c | 8 ++++++++ xen/arch/x86/hvm/vmx/vmx.c | 8 ++++++++ 2 files changed, 16 insertions(+)