Is the code for break 0x0 just for testing the register
dump code? Isn't it possible for a guest to generate a
break 0x0 that should be reflected? (And, IIRC, I think
on certain break instructions, the immediate value is
ignored and a zero is used instead...)
> -----Original Message-----
> From: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
> [mailto:xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf
> Of Isaku Yamahata
> Sent: Wednesday, December 28, 2005 3:12 AM
> To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
> Subject: [Xen-ia64-devel] [PATCH] [5/6] panic stack trace: adds hook
>
> 5/6
> insert hook to handle 'break 0x0'.
>
>
> Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
>
> --
> diff -r fc7f2f8057cb -r 8a92e8091a2f xen/arch/ia64/xen/hyperprivop.S
> --- a/xen/arch/ia64/xen/hyperprivop.S Wed Dec 28 15:20:00 2005 +0900
> +++ b/xen/arch/ia64/xen/hyperprivop.S Wed Dec 28 15:29:23 2005 +0900
> @@ -543,6 +543,13 @@
> extr.u r21=r30,IA64_PSR_PP_BIT,1 ;;
> cmp.ne p7,p0=r21,r0 ;;
> (p7) br.spnt.few dispatch_break_fault ;;
> + movl r20=IA64_PSR_CPL ;;
> + and r22=r20,r30 ;;
> + cmp.ne p7,p0=r22,r0
> +(p7) br.spnt.many 1f ;;
> + cmp.eq p7,p0=r17,r0
> +(p7) br.spnt.few dispatch_break_fault ;;
> +1:
> #if 1 /* special handling in case running on simulator */
> movl r20=first_break;;
> ld4 r23=[r20];;
> diff -r fc7f2f8057cb -r 8a92e8091a2f xen/arch/ia64/xen/ivt.S
> --- a/xen/arch/ia64/xen/ivt.S Wed Dec 28 15:20:00 2005 +0900
> +++ b/xen/arch/ia64/xen/ivt.S Wed Dec 28 15:29:23 2005 +0900
> @@ -839,6 +839,8 @@
> mov r17=cr.iim
> mov r31=pr
> ;;
> + cmp.eq p7,p0=r17,r0
> +(p7) br.spnt.few dispatch_break_fault ;;
> movl r18=XSI_PSR_IC
> ;;
> ld8 r19=[r18]
> diff -r fc7f2f8057cb -r 8a92e8091a2f xen/arch/ia64/xen/process.c
> --- a/xen/arch/ia64/xen/process.c Wed Dec 28 15:20:00 2005 +0900
> +++ b/xen/arch/ia64/xen/process.c Wed Dec 28 15:29:23 2005 +0900
> @@ -33,6 +33,7 @@
> #include <xen/multicall.h>
>
> extern unsigned long vcpu_get_itir_on_fault(struct vcpu *, UINT64);
> +extern void die_if_kernel(char *str, struct pt_regs *regs, long err);
>
> extern unsigned long dom0_start, dom0_size;
>
> @@ -686,6 +687,8 @@
> vcpu_increment_iip(current);
> }
> else {
> + if (iim == 0)
> + die_if_kernel("bug check", regs, iim);
> PSCB(v,iim) = iim;
> reflect_interruption(isr,regs,IA64_BREAK_VECTOR);
> }
> diff -r fc7f2f8057cb -r 8a92e8091a2f xen/arch/ia64/xen/xenmisc.c
> --- a/xen/arch/ia64/xen/xenmisc.c Wed Dec 28 15:20:00 2005 +0900
> +++ b/xen/arch/ia64/xen/xenmisc.c Wed Dec 28 15:29:23 2005 +0900
> @@ -230,7 +230,13 @@
>
> void die_if_kernel(char *str, struct pt_regs *regs, long
> err) /* __attribute__ ((noreturn)) */
> {
> - printk("die_if_kernel: called, not implemented\n");
> + if (user_mode(regs))
> + return;
> +
> + printk("%s: %s %ld\n", __func__, str, err);
> + debugtrace_dump();
> + show_registers(regs);
> + domain_crash_synchronous();
> }
>
> long
>
>
> --
> yamahata
>
> _______________________________________________
> Xen-ia64-devel mailing list
> Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-ia64-devel
>
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
|