ia64/xen-unstable

changeset 18876:09c467481a44

IA64: fix panic caused by daccess fault.

While fpswa emulation, Xen VMM access guest virtual address space
which may cause daccess fault resulting in panic.
This patch make daccess fault handler handle such cases properly.

(XEN) Xen BUG at faults.c:583
(XEN) FIXME: implement ia64 dump_execution_state()
(XEN)
(XEN) Call Trace:
(XEN) [<f4000000040fe360>] show_stack+0x90/0xb0
(XEN) sp=f0000002b6067940 bsp=f0000002b6061860
(XEN) [<f4000000040fee70>] dump_stack+0x30/0x50
(XEN) sp=f0000002b6067b10 bsp=f0000002b6061840
(XEN) [<f4000000040640d0>] __bug+0x70/0xa0
(XEN) sp=f0000002b6067b10 bsp=f0000002b6061810
(XEN) [<f4000000040b53b0>] ia64_handle_reflection+0x60/0x13b0
(XEN) sp=f0000002b6067b10 bsp=f0000002b60617b8
(XEN) [<f4000000040f5b40>] ia64_leave_kernel+0x0/0x300
(XEN) sp=f0000002b6067b20 bsp=f0000002b60617b8
(XEN) [<f4000000040c3a20>] __get_domain_bundle+0x0/0x40
(XEN) sp=f0000002b6067d20 bsp=f0000002b6061778
(XEN) [<f4000000040bee20>] vcpu_get_domain_bundle+0xb0/0xa10
(XEN) sp=f0000002b6067d20 bsp=f0000002b60616e8
(XEN) [<f4000000040b3f20>] handle_fpu_swa+0x360/0x4a0
(XEN) sp=f0000002b6067d60 bsp=f0000002b6061660
(XEN) vcpu.c:1371: vcpu_get_domain_bundle gip 0x40000000000008a0
(XEN) [<f4000000040b5e90>] ia64_handle_reflection+0xb40/0x13b0
(XEN) sp=f0000002b6067df0 bsp=f0000002b6061610
(XEN) vcpu.c:1371: vcpu_get_domain_bundle gip 0x4000000000000730
(XEN) faults.c:343:d6 handle_fpu_swa(fault): floating-point bundle at 0x4000000000000730 not mapped
(XEN) [<f4000000040f5b40>] ia64_leave_kernel+0x0/0x300
(XEN) sp=f0000002b6067e00 bsp=f0000002b6061610
(XEN) vcpu.c:1371: vcpu_get_domain_bundle gip 0x40000000000008a0
(XEN) faults.c:343:d6 handle_fpu_swa(fault): floating-point bundle at 0x40000000000008a0 not mapped
(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 15:
(XEN) Xen BUG at faults.c:583
(XEN) ****************************************

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Fri Dec 12 10:36:23 2008 +0900 (2008-12-12)
parents 05b293d7fbb7
children e97216802360
files xen/arch/ia64/xen/faults.c xen/arch/ia64/xen/ivt.S
line diff
     1.1 --- a/xen/arch/ia64/xen/faults.c	Fri Dec 12 10:35:58 2008 +0900
     1.2 +++ b/xen/arch/ia64/xen/faults.c	Fri Dec 12 10:36:23 2008 +0900
     1.3 @@ -412,6 +412,13 @@ ia64_fault(unsigned long vector, unsigne
     1.4  		printk("Dirty-bit.\n");
     1.5  		break;
     1.6  
     1.7 +	case 10:
     1.8 +		/* __domain_get_bundle() may cause fault. */
     1.9 +		if (ia64_done_with_exception(regs))
    1.10 +			return;
    1.11 +		printk("Data Access-bit.\n");
    1.12 +		break;
    1.13 +
    1.14  	case 20:
    1.15  		printk("Page Not Found.\n");
    1.16  		break;
     2.1 --- a/xen/arch/ia64/xen/ivt.S	Fri Dec 12 10:35:58 2008 +0900
     2.2 +++ b/xen/arch/ia64/xen/ivt.S	Fri Dec 12 10:36:23 2008 +0900
     2.3 @@ -471,10 +471,17 @@ ENTRY(daccess_bit)
     2.4  	DBG_FAULT(10)
     2.5  	mov r16=cr.isr
     2.6  	mov r17=cr.ifa
     2.7 +	mov r18=cr.ipsr
     2.8  	mov r31=pr
     2.9  	mov r19=10
    2.10 +	;;
    2.11  	mov r20=0x2800
    2.12 -	br.sptk.many fast_access_reflect
    2.13 +	extr.u r18=r18,IA64_PSR_CPL0_BIT,2
    2.14 +	;;
    2.15 +	cmp.ne p6,p0=r0,r18 	/* cpl != 0? */
    2.16 +(p6)	br.sptk.many fast_access_reflect
    2.17 +	/* __domain_get_bundle() may cause this fault. */
    2.18 +	br.sptk.few dispatch_to_fault_handler
    2.19  	;;
    2.20  END(daccess_bit)
    2.21