ia64/xen-unstable

changeset 15893:f3173d151e1d

[IA64] debug_op hypercall and debug points

Add debug_op hypercall.
Add many debug points.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
author Alex Williamson <alex.williamson@hp.com>
date Fri Sep 21 11:03:54 2007 -0600 (2007-09-21)
parents b2a02f7ed849
children 09b45357e492
files xen/arch/ia64/linux-xen/entry.S xen/arch/ia64/vmx/vmx_interrupt.c xen/arch/ia64/vmx/vmx_phy_mode.c xen/arch/ia64/vmx/vmx_vcpu.c xen/arch/ia64/vmx/vmx_virt.c xen/arch/ia64/xen/faults.c xen/arch/ia64/xen/fw_emul.c xen/arch/ia64/xen/hypercall.c xen/arch/ia64/xen/mm.c xen/arch/ia64/xen/privop.c xen/include/asm-ia64/debugger.h xen/include/asm-ia64/domain.h xen/include/asm-ia64/vmx.h xen/include/public/arch-ia64.h
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/entry.S	Mon Sep 17 13:38:25 2007 -0600
     1.2 +++ b/xen/arch/ia64/linux-xen/entry.S	Fri Sep 21 11:03:54 2007 -0600
     1.3 @@ -1535,7 +1535,7 @@ ia64_hypercall_table:
     1.4  	data8 do_ni_hypercall		/*  */
     1.5  	data8 do_dom0vp_op              /* dom0vp_op */
     1.6  	data8 do_pirq_guest_eoi		/* arch_1 */
     1.7 -	data8 do_ni_hypercall		/* arch_2 */           /* 50 */
     1.8 +	data8 do_ia64_debug_op		/* arch_2 */           /* 50 */
     1.9  	data8 do_ni_hypercall		/* arch_3 */
    1.10  	data8 do_ni_hypercall		/* arch_4 */
    1.11  	data8 do_ni_hypercall		/* arch_5 */
     2.1 --- a/xen/arch/ia64/vmx/vmx_interrupt.c	Mon Sep 17 13:38:25 2007 -0600
     2.2 +++ b/xen/arch/ia64/vmx/vmx_interrupt.c	Fri Sep 21 11:03:54 2007 -0600
     2.3 @@ -24,6 +24,7 @@
     2.4  #include <asm/vmx_vcpu.h>
     2.5  #include <asm/vmx_mm_def.h>
     2.6  #include <asm/vmx_pal_vsa.h>
     2.7 +#include <asm/debugger.h>
     2.8  
     2.9  /* SDM vol2 5.5 - IVA based interruption handling */
    2.10  #define INITIAL_PSR_VALUE_AT_INTERRUPTION 0x0000001808028034
    2.11 @@ -107,6 +108,9 @@ inject_guest_interruption(VCPU *vcpu, u6
    2.12  
    2.13      viva = vmx_vcpu_get_iva(vcpu);
    2.14      regs->cr_iip = viva + vec;
    2.15 +
    2.16 +    debugger_event(vec == IA64_EXTINT_VECTOR ?
    2.17 +                   XEN_IA64_DEBUG_ON_EXTINT : XEN_IA64_DEBUG_ON_EXCEPT);
    2.18  }
    2.19  
    2.20  
     3.1 --- a/xen/arch/ia64/vmx/vmx_phy_mode.c	Mon Sep 17 13:38:25 2007 -0600
     3.2 +++ b/xen/arch/ia64/vmx/vmx_phy_mode.c	Fri Sep 21 11:03:54 2007 -0600
     3.3 @@ -28,6 +28,7 @@
     3.4  #include <xen/sched.h>
     3.5  #include <asm/pgtable.h>
     3.6  #include <asm/vmmu.h>
     3.7 +#include <asm/debugger.h>
     3.8  
     3.9  static const int valid_mm_mode[8] = {
    3.10      GUEST_PHYS, /* (it, dt, rt) -> (0, 0, 0) */
    3.11 @@ -300,6 +301,7 @@ check_mm_mode_switch (VCPU *vcpu,  IA64_
    3.12           (old_psr.rt != new_psr.rt )
    3.13           ) {
    3.14          switch_mm_mode (vcpu, old_psr, new_psr);
    3.15 +        debugger_event(XEN_IA64_DEBUG_ON_MMU);
    3.16      }
    3.17  
    3.18      return;
     4.1 --- a/xen/arch/ia64/vmx/vmx_vcpu.c	Mon Sep 17 13:38:25 2007 -0600
     4.2 +++ b/xen/arch/ia64/vmx/vmx_vcpu.c	Fri Sep 21 11:03:54 2007 -0600
     4.3 @@ -135,6 +135,13 @@ vmx_vcpu_set_psr(VCPU *vcpu, unsigned lo
     4.4      if (FP_PSR(vcpu) & IA64_PSR_DFH)
     4.5          regs->cr_ipsr |= IA64_PSR_DFH;
     4.6  
     4.7 +    if (unlikely(vcpu->domain->debugger_attached)) {
     4.8 +        if (vcpu->domain->arch.debug_flags & XEN_IA64_DEBUG_FORCE_SS)
     4.9 +            regs->cr_ipsr |= IA64_PSR_SS;
    4.10 +        if (vcpu->domain->arch.debug_flags & XEN_IA64_DEBUG_FORCE_DB)
    4.11 +            regs->cr_ipsr |= IA64_PSR_DB;
    4.12 +    }
    4.13 +
    4.14      check_mm_mode_switch(vcpu, old_psr, new_psr);
    4.15      return ;
    4.16  }
     5.1 --- a/xen/arch/ia64/vmx/vmx_virt.c	Mon Sep 17 13:38:25 2007 -0600
     5.2 +++ b/xen/arch/ia64/vmx/vmx_virt.c	Fri Sep 21 11:03:54 2007 -0600
     5.3 @@ -30,6 +30,7 @@
     5.4  #include <asm/vmx.h>
     5.5  #include <asm/virt_event.h>
     5.6  #include <asm/vmx_phy_mode.h>
     5.7 +#include <asm/debugger.h>
     5.8  
     5.9  #ifdef BYPASS_VMAL_OPCODE
    5.10  static void
    5.11 @@ -203,6 +204,11 @@ static IA64FAULT vmx_emul_rfi(VCPU *vcpu
    5.12      }
    5.13  #endif // CHECK_FAULT
    5.14  
    5.15 +    if (debugger_event(XEN_IA64_DEBUG_ON_RFI)) {
    5.16 +        raise_softirq(SCHEDULE_SOFTIRQ);
    5.17 +        do_softirq();
    5.18 +    }
    5.19 +
    5.20      regs=vcpu_regs(vcpu);
    5.21      vpsr.val=regs->cr_ipsr;
    5.22      if ( vpsr.is == 1 ) {
    5.23 @@ -279,6 +285,8 @@ static IA64FAULT vmx_emul_ptc_l(VCPU *vc
    5.24      }
    5.25  #endif // VMAL_NO_FAULT_CHECK
    5.26  
    5.27 +    debugger_event(XEN_IA64_DEBUG_ON_TC);
    5.28 +
    5.29      return vmx_vcpu_ptc_l(vcpu,r3,bits(r2,2,7));
    5.30  }
    5.31  
    5.32 @@ -338,6 +346,8 @@ static IA64FAULT vmx_emul_ptc_g(VCPU *vc
    5.33      }
    5.34  #endif // VMAL_NO_FAULT_CHECK
    5.35  
    5.36 +    debugger_event(XEN_IA64_DEBUG_ON_TC);
    5.37 +
    5.38      return vmx_vcpu_ptc_g(vcpu,r3,bits(r2,2,7));
    5.39  }
    5.40  
    5.41 @@ -372,6 +382,8 @@ static IA64FAULT vmx_emul_ptc_ga(VCPU *v
    5.42      }
    5.43  #endif // VMAL_NO_FAULT_CHECK
    5.44  
    5.45 +    debugger_event(XEN_IA64_DEBUG_ON_TC);
    5.46 +
    5.47      return vmx_vcpu_ptc_ga(vcpu,r3,bits(r2,2,7));
    5.48  }
    5.49  
    5.50 @@ -414,6 +426,9 @@ static IA64FAULT vmx_emul_ptr_d(VCPU *vc
    5.51      u64 r2,r3;
    5.52      if ( ptr_fault_check(vcpu, inst, &r2, &r3 ) == IA64_FAULT )
    5.53      	return IA64_FAULT;
    5.54 +
    5.55 +    debugger_event(XEN_IA64_DEBUG_ON_TR);
    5.56 +
    5.57      return vmx_vcpu_ptr_d(vcpu,r3,bits(r2,2,7));
    5.58  }
    5.59  
    5.60 @@ -422,6 +437,9 @@ static IA64FAULT vmx_emul_ptr_i(VCPU *vc
    5.61      u64 r2,r3;
    5.62      if ( ptr_fault_check(vcpu, inst, &r2, &r3 ) == IA64_FAULT )
    5.63      	return IA64_FAULT;
    5.64 +
    5.65 +    debugger_event(XEN_IA64_DEBUG_ON_TR);
    5.66 +
    5.67      return vmx_vcpu_ptr_i(vcpu,r3,bits(r2,2,7));
    5.68  }
    5.69  
    5.70 @@ -633,6 +651,8 @@ static IA64FAULT vmx_emul_itr_d(VCPU *vc
    5.71          return IA64_FAULT;
    5.72      }
    5.73  
    5.74 +    debugger_event(XEN_IA64_DEBUG_ON_TR);
    5.75 +
    5.76      return (vmx_vcpu_itr_d(vcpu, slot, pte, itir, ifa));
    5.77  }
    5.78  
    5.79 @@ -699,6 +719,8 @@ static IA64FAULT vmx_emul_itr_i(VCPU *vc
    5.80          return IA64_FAULT;
    5.81      }
    5.82  
    5.83 +    debugger_event(XEN_IA64_DEBUG_ON_TR);
    5.84 +
    5.85      return vmx_vcpu_itr_i(vcpu, slot, pte, itir, ifa);
    5.86  }
    5.87  
    5.88 @@ -760,6 +782,8 @@ static IA64FAULT vmx_emul_itc_d(VCPU *vc
    5.89      	return IA64_FAULT;
    5.90      }
    5.91  
    5.92 +    debugger_event(XEN_IA64_DEBUG_ON_TC);
    5.93 +    
    5.94      return vmx_vcpu_itc_d(vcpu, pte, itir, ifa);
    5.95  }
    5.96  
    5.97 @@ -771,6 +795,8 @@ static IA64FAULT vmx_emul_itc_i(VCPU *vc
    5.98      	return IA64_FAULT;
    5.99      }
   5.100  
   5.101 +    debugger_event(XEN_IA64_DEBUG_ON_TC);
   5.102 +
   5.103      return vmx_vcpu_itc_i(vcpu, pte, itir, ifa);
   5.104  }
   5.105  
   5.106 @@ -1425,6 +1451,9 @@ if ( (cause == 0xff && opcode == 0x1e000
   5.107  #else
   5.108      inst.inst=opcode;
   5.109  #endif /* BYPASS_VMAL_OPCODE */
   5.110 +
   5.111 +    debugger_event(XEN_IA64_DEBUG_ON_PRIVOP);
   5.112 +
   5.113      /*
   5.114       * Switch to actual virtual rid in rr0 and rr4,
   5.115       * which is required by some tlb related instructions.
     6.1 --- a/xen/arch/ia64/xen/faults.c	Mon Sep 17 13:38:25 2007 -0600
     6.2 +++ b/xen/arch/ia64/xen/faults.c	Fri Sep 21 11:03:54 2007 -0600
     6.3 @@ -104,6 +104,9 @@ static void reflect_interruption(unsigne
     6.4  	PSCB(v, interrupt_collection_enabled) = 0;
     6.5  
     6.6  	perfc_incra(slow_reflect, vector >> 8);
     6.7 +
     6.8 +	debugger_event(vector == IA64_EXTINT_VECTOR ?
     6.9 +		       XEN_IA64_DEBUG_ON_EXTINT : XEN_IA64_DEBUG_ON_EXCEPT);
    6.10  }
    6.11  
    6.12  void reflect_event(void)
    6.13 @@ -151,6 +154,8 @@ void reflect_event(void)
    6.14  	PSCB(v, vpsr_dfh) = 0;
    6.15  	v->vcpu_info->evtchn_upcall_mask = 1;
    6.16  	PSCB(v, interrupt_collection_enabled) = 0;
    6.17 +
    6.18 +	debugger_event(XEN_IA64_DEBUG_ON_EVENT);
    6.19  }
    6.20  
    6.21  static int handle_lazy_cover(struct vcpu *v, struct pt_regs *regs)
    6.22 @@ -670,7 +675,7 @@ ia64_handle_reflection(unsigned long ifa
    6.23  		break;
    6.24  	case 29:
    6.25  		vector = IA64_DEBUG_VECTOR;
    6.26 -		if (debugger_trap_entry(vector,regs))
    6.27 +		if (debugger_kernel_event(regs, XEN_IA64_DEBUG_ON_KERN_DEBUG))
    6.28  			return;
    6.29  		break;
    6.30  	case 30:
    6.31 @@ -708,12 +713,12 @@ ia64_handle_reflection(unsigned long ifa
    6.32  		break;
    6.33  	case 35:
    6.34  		vector = IA64_TAKEN_BRANCH_TRAP_VECTOR;
    6.35 -		if (debugger_trap_entry(vector,regs))
    6.36 +		if (debugger_kernel_event(regs, XEN_IA64_DEBUG_ON_KERN_TBRANCH))
    6.37  			return;
    6.38  		break;
    6.39  	case 36:
    6.40  		vector = IA64_SINGLE_STEP_TRAP_VECTOR;
    6.41 -		if (debugger_trap_entry(vector,regs))
    6.42 +		if (debugger_kernel_event(regs, XEN_IA64_DEBUG_ON_KERN_SSTEP))
    6.43  			return;
    6.44  		break;
    6.45  
     7.1 --- a/xen/arch/ia64/xen/fw_emul.c	Mon Sep 17 13:38:25 2007 -0600
     7.2 +++ b/xen/arch/ia64/xen/fw_emul.c	Fri Sep 21 11:03:54 2007 -0600
     7.3 @@ -36,6 +36,7 @@
     7.4  #include <xen/hypercall.h>
     7.5  #include <xen/softirq.h>
     7.6  #include <xen/time.h>
     7.7 +#include <asm/debugger.h>
     7.8  
     7.9  static DEFINE_SPINLOCK(efi_time_services_lock);
    7.10  
    7.11 @@ -137,6 +138,8 @@ sal_emulator (long index, unsigned long 
    7.12  	long r11 = 0;
    7.13  	long status;
    7.14  
    7.15 +	debugger_event(XEN_IA64_DEBUG_ON_SAL);
    7.16 +
    7.17  	status = 0;
    7.18  	switch (index) {
    7.19  	    case SAL_FREQ_BASE:
    7.20 @@ -595,6 +598,8 @@ xen_pal_emulator(unsigned long index, u6
    7.21  	if (unlikely(running_on_sim))
    7.22  		return pal_emulator_static(index);
    7.23  
    7.24 +	debugger_event(XEN_IA64_DEBUG_ON_PAL);
    7.25 +
    7.26  	// pal code must be mapped by a TR when pal is called, however
    7.27  	// calls are rare enough that we will map it lazily rather than
    7.28  	// at every context switch
    7.29 @@ -1241,6 +1246,8 @@ efi_emulator (struct pt_regs *regs, IA64
    7.30  	struct vcpu *v = current;
    7.31  	efi_status_t status;
    7.32  
    7.33 +	debugger_event(XEN_IA64_DEBUG_ON_EFI);
    7.34 +
    7.35  	*fault = IA64_NO_FAULT;
    7.36  
    7.37  	switch (regs->r2) {
     8.1 --- a/xen/arch/ia64/xen/hypercall.c	Mon Sep 17 13:38:25 2007 -0600
     8.2 +++ b/xen/arch/ia64/xen/hypercall.c	Fri Sep 21 11:03:54 2007 -0600
     8.3 @@ -493,3 +493,35 @@ long do_callback_op(int cmd, XEN_GUEST_H
     8.4  
     8.5      return ret;
     8.6  }
     8.7 +
     8.8 +unsigned long
     8.9 +do_ia64_debug_op(unsigned long cmd, unsigned long domain,
    8.10 +		 XEN_GUEST_HANDLE(xen_ia64_debug_op_t) u_debug_op)
    8.11 +{
    8.12 +    xen_ia64_debug_op_t curop, *op = &curop;
    8.13 +    struct domain *d;
    8.14 +    long ret = 0;
    8.15 +
    8.16 +    if (!IS_PRIV(current->domain))
    8.17 +        return -EPERM;
    8.18 +    if (copy_from_guest(op, u_debug_op, 1))
    8.19 +        return -EFAULT;
    8.20 +    d = rcu_lock_domain_by_id(domain);
    8.21 +    if (d == NULL)
    8.22 +        return -ESRCH;
    8.23 +
    8.24 +    switch (cmd) {
    8.25 +    case XEN_IA64_DEBUG_OP_SET_FLAGS:
    8.26 +        d->arch.debug_flags = op->flags;
    8.27 +        break;
    8.28 +    case XEN_IA64_DEBUG_OP_GET_FLAGS:
    8.29 +        op->flags = d->arch.debug_flags;
    8.30 +        if (copy_to_guest(u_debug_op, op, 1))
    8.31 +            ret = -EFAULT;
    8.32 +        break;
    8.33 +    default:
    8.34 +        ret = -ENOSYS;
    8.35 +    }
    8.36 +    rcu_unlock_domain(d);
    8.37 +    return ret;
    8.38 +}
     9.1 --- a/xen/arch/ia64/xen/mm.c	Mon Sep 17 13:38:25 2007 -0600
     9.2 +++ b/xen/arch/ia64/xen/mm.c	Fri Sep 21 11:03:54 2007 -0600
     9.3 @@ -181,6 +181,7 @@
     9.4  #include <asm/dom_fw_common.h>
     9.5  #include <public/memory.h>
     9.6  #include <asm/event.h>
     9.7 +#include <asm/debugger.h>
     9.8  
     9.9  static void domain_page_flush_and_put(struct domain* d, unsigned long mpaddr,
    9.10                                        volatile pte_t* ptep, pte_t old_pte, 
    9.11 @@ -763,6 +764,8 @@ unsigned long lookup_domain_mpa(struct d
    9.12                   d->domain_id, mpaddr, d->arch.convmem_end);
    9.13      }
    9.14  
    9.15 +    debugger_event (XEN_IA64_DEBUG_ON_BAD_MPA);
    9.16 +
    9.17      if (entry != NULL)
    9.18          p2m_entry_set(entry, NULL, __pte(0));
    9.19      //XXX This is a work around until the emulation memory access to a region
    10.1 --- a/xen/arch/ia64/xen/privop.c	Mon Sep 17 13:38:25 2007 -0600
    10.2 +++ b/xen/arch/ia64/xen/privop.c	Fri Sep 21 11:03:54 2007 -0600
    10.3 @@ -622,6 +622,8 @@ static IA64FAULT priv_handle_op(VCPU * v
    10.4  	} else if (ia64_get_cpl(ipsr) > CONFIG_CPL0_EMUL)
    10.5  		return IA64_ILLOP_FAULT;
    10.6  
    10.7 +	debugger_event(XEN_IA64_DEBUG_ON_PRIVOP);
    10.8 +
    10.9  	switch (slot_type) {
   10.10  	case M:
   10.11  		if (inst.generic.major == 0) {
   10.12 @@ -785,6 +787,9 @@ int ia64_hyperprivop(unsigned long iim, 
   10.13  		return 1;
   10.14  	}
   10.15  	perfc_incra(slow_hyperprivop, iim);
   10.16 +
   10.17 +	debugger_event(XEN_IA64_DEBUG_ON_PRIVOP);
   10.18 +
   10.19  	switch (iim) {
   10.20  	case HYPERPRIVOP_RFI:
   10.21  		vcpu_rfi(v);
    11.1 --- a/xen/include/asm-ia64/debugger.h	Mon Sep 17 13:38:25 2007 -0600
    11.2 +++ b/xen/include/asm-ia64/debugger.h	Fri Sep 21 11:03:54 2007 -0600
    11.3 @@ -83,16 +83,31 @@ static inline int debugger_trap_fatal(
    11.4  #define debugger_trap_immediate()		((void)0)
    11.5  #endif
    11.6  
    11.7 -static inline int debugger_trap_entry(
    11.8 -    unsigned int vector, struct cpu_user_regs *regs)
    11.9 +static inline int debugger_event(unsigned long event)
   11.10  {
   11.11      struct vcpu *v = current;
   11.12 +    struct domain *d = v->domain;
   11.13  
   11.14 -    if (guest_kernel_mode(regs) && v->domain->debugger_attached) {
   11.15 +    if (unlikely (d->debugger_attached && (d->arch.debug_flags & event))) {
   11.16 +        d->arch.debug_event = event;
   11.17          domain_pause_for_debugger();
   11.18          return 1;
   11.19      }
   11.20 +    return 0;
   11.21 +}
   11.22  
   11.23 +static inline int debugger_kernel_event(
   11.24 +    struct cpu_user_regs *regs, unsigned long event)
   11.25 +{
   11.26 +    struct vcpu *v = current;
   11.27 +    struct domain *d = v->domain;
   11.28 +
   11.29 +    if (unlikely(d->debugger_attached && (d->arch.debug_flags & event)
   11.30 +                 && guest_kernel_mode(regs))) {
   11.31 +        d->arch.debug_event = event;
   11.32 +        domain_pause_for_debugger();
   11.33 +        return 1;
   11.34 +    }
   11.35      return 0;
   11.36  }
   11.37  
    12.1 --- a/xen/include/asm-ia64/domain.h	Mon Sep 17 13:38:25 2007 -0600
    12.2 +++ b/xen/include/asm-ia64/domain.h	Fri Sep 21 11:03:54 2007 -0600
    12.3 @@ -181,6 +181,12 @@ struct arch_domain {
    12.4  
    12.5      struct opt_feature opt_feature;
    12.6  
    12.7 +    /* Debugging flags.  See arch-ia64.h for bits definition.  */
    12.8 +    unsigned int debug_flags;
    12.9 +
   12.10 +    /* Reason of debugging break.  */
   12.11 +    unsigned int debug_event;
   12.12 +
   12.13  #ifdef CONFIG_XEN_IA64_TLB_TRACK
   12.14      struct tlb_track*   tlb_track;
   12.15  #endif
    13.1 --- a/xen/include/asm-ia64/vmx.h	Mon Sep 17 13:38:25 2007 -0600
    13.2 +++ b/xen/include/asm-ia64/vmx.h	Fri Sep 21 11:03:54 2007 -0600
    13.3 @@ -39,8 +39,6 @@ extern void vmx_io_assist(struct vcpu *v
    13.4  extern int ia64_hypercall (struct pt_regs *regs);
    13.5  extern void vmx_save_state(struct vcpu *v);
    13.6  extern void vmx_load_state(struct vcpu *v);
    13.7 -extern void show_registers(struct pt_regs *regs);
    13.8 -#define show_execution_state show_registers
    13.9  extern unsigned long __gpfn_to_mfn_foreign(struct domain *d, unsigned long gpfn);
   13.10  extern void sync_split_caches(void);
   13.11  extern void set_privileged_operation_isr (struct vcpu *vcpu,int inst);
    14.1 --- a/xen/include/public/arch-ia64.h	Mon Sep 17 13:38:25 2007 -0600
    14.2 +++ b/xen/include/public/arch-ia64.h	Fri Sep 21 11:03:54 2007 -0600
    14.3 @@ -293,6 +293,8 @@ struct ia64_tr_entry {
    14.4      unsigned long vadr;
    14.5      unsigned long rid;
    14.6  };
    14.7 +typedef struct ia64_tr_entry ia64_tr_entry_t;
    14.8 +DEFINE_XEN_GUEST_HANDLE(ia64_tr_entry_t);
    14.9  
   14.10  struct vcpu_tr_regs {
   14.11      struct ia64_tr_entry itrs[8];
   14.12 @@ -556,6 +558,82 @@ struct xen_ia64_boot_param {
   14.13  /* Fast and light hypercalls.  */
   14.14  #define __HYPERVISOR_ia64_fast_eoi	__HYPERVISOR_arch_1
   14.15  
   14.16 +/* Extra debug features.  */
   14.17 +#define __HYPERVISOR_ia64_debug_op  __HYPERVISOR_arch_2
   14.18 +
   14.19 +/* Set/Get extra conditions to break.  */
   14.20 +#define XEN_IA64_DEBUG_OP_SET_FLAGS 1
   14.21 +#define XEN_IA64_DEBUG_OP_GET_FLAGS 2
   14.22 +
   14.23 +/* Break on kernel single step.  */
   14.24 +#define XEN_IA64_DEBUG_ON_KERN_SSTEP   (1 << 0)
   14.25 +
   14.26 +/* Break on kernel debug (breakpoint or watch point).  */
   14.27 +#define XEN_IA64_DEBUG_ON_KERN_DEBUG   (1 << 1)
   14.28 +
   14.29 +/* Break on kernel taken branch.  */
   14.30 +#define XEN_IA64_DEBUG_ON_KERN_TBRANCH (1 << 2)
   14.31 +
   14.32 +/* Break on interrupt injection.  */
   14.33 +#define XEN_IA64_DEBUG_ON_EXTINT       (1 << 3)
   14.34 +
   14.35 +/* Break on interrupt injection.  */
   14.36 +#define XEN_IA64_DEBUG_ON_EXCEPT       (1 << 4)
   14.37 +
   14.38 +/* Break on event injection.  */
   14.39 +#define XEN_IA64_DEBUG_ON_EVENT        (1 << 5)
   14.40 +
   14.41 +/* Break on privop/virtualized instruction (slow path only).  */
   14.42 +#define XEN_IA64_DEBUG_ON_PRIVOP       (1 << 6)
   14.43 +
   14.44 +/* Break on emulated PAL call (at entry).  */
   14.45 +#define XEN_IA64_DEBUG_ON_PAL          (1 << 7)
   14.46 +
   14.47 +/* Break on emulated SAL call (at entry).  */
   14.48 +#define XEN_IA64_DEBUG_ON_SAL          (1 << 8)
   14.49 +
   14.50 +/* Break on emulated EFI call (at entry).  */
   14.51 +#define XEN_IA64_DEBUG_ON_EFI          (1 << 9)
   14.52 +
   14.53 +/* Break on rfi emulation (slow path only, before exec).  */
   14.54 +#define XEN_IA64_DEBUG_ON_RFI          (1 << 10)
   14.55 +
   14.56 +/* Break on address translation switch.  */
   14.57 +#define XEN_IA64_DEBUG_ON_MMU          (1 << 11)
   14.58 +
   14.59 +/* Break on bad guest physical address.  */
   14.60 +#define XEN_IA64_DEBUG_ON_BAD_MPA      (1 << 12)
   14.61 +
   14.62 +/* Force psr.ss bit.  */
   14.63 +#define XEN_IA64_DEBUG_FORCE_SS        (1 << 13)
   14.64 +
   14.65 +/* Force psr.db bit.  */
   14.66 +#define XEN_IA64_DEBUG_FORCE_DB        (1 << 14)
   14.67 +
   14.68 +/* Break on ITR/PTR.  */
   14.69 +#define XEN_IA64_DEBUG_ON_TR           (1 << 15)
   14.70 +
   14.71 +/* Break on ITC/PTC.L/PTC.G/PTC.GA.  */
   14.72 +#define XEN_IA64_DEBUG_ON_TC           (1 << 16)
   14.73 +
   14.74 +/* Get translation cache.  */
   14.75 +#define XEN_IA64_DEBUG_OP_GET_TC   3
   14.76 +
   14.77 +/* Translate virtual address to guest physical address.  */
   14.78 +#define XEN_IA64_DEBUG_OP_TRANSLATE 4
   14.79 +
   14.80 +#ifndef __ASSEMBLY__
   14.81 +union xen_ia64_debug_op {
   14.82 +    uint64_t flags;
   14.83 +    struct xen_ia64_debug_vtlb {
   14.84 +        uint64_t nbr;                             /* IN/OUT */
   14.85 +        XEN_GUEST_HANDLE_64(ia64_tr_entry_t) tr;  /* IN/OUT */
   14.86 +    } vtlb;
   14.87 +};
   14.88 +typedef union xen_ia64_debug_op xen_ia64_debug_op_t;
   14.89 +DEFINE_XEN_GUEST_HANDLE(xen_ia64_debug_op_t);
   14.90 +#endif /* __ASSEMBLY__ */
   14.91 +
   14.92  /* Xencomm macros.  */
   14.93  #define XENCOMM_INLINE_MASK 0xf800000000000000UL
   14.94  #define XENCOMM_INLINE_FLAG 0x8000000000000000UL