[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-ia64-devel] Re: [PATCH] Fix mca handler so as not to destroy ar



Hi,

Thank you for explaining. I see.
I have tested the attached porting patch, it was confirmed to work.

Thanks,
KAZ

Signed-off-by: Kazuhiro Suzuki <kaz@xxxxxxxxxxxxxx>


From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Subject: Re: [Xen-ia64-devel] Re: [PATCH] Fix mca handler so as not to destroy 
ar
Date: Fri, 8 Aug 2008 17:03:05 +0900

> On Fri, Aug 08, 2008 at 03:41:17PM +0900, SUZUKI Kazuhiro wrote:
> 
> > I think gp passed from SAL is changed to a virtual address by
> > DATA_PA_TO_VA() in VIRTUAL_MODE_ENTER().
> > 
> > #define DATA_PA_TO_VA(addr,temp)                    \
> >     mov     temp    = 0xf   ;;                      \
> >     dep     addr    = temp, addr, 60, 4
> > 
> > Could you please explain the issue a little more in detail?
> 
> The xen vmm image was made relocatable so that
> xen text and data are located at the area starting at
>       #define KERNEL_START             0xf400000004000000
> wherever the image is loaded.
> So __gp is a value of 0xf400000004000000 + offset
> and it's impossible to calculate __gp from the physical address
> of __gp.
> 
> On the other hand the macro, DATA_PA_TO_VA(), gives
> a value of 0xf000000000000000 + physical address.
> The value points to the same physical memory location pointed
> by __gp, so possibly the current code may just work.
> But it worried me much so that I checked the linux
> code to find the c/s f5a3f3dc189485d607fbd42678cc23958acc0a6e.
> 
> Yes, it's easy for me (and you) to port the following hunk of the c/s,
> however it's difficult for me to test the handler.
> 
> thanks,
> 
> diff --git a/include/asm-ia64/mca_asm.h b/include/asm-ia64/mca_asm.h
> index 27c9203..76203f9 100644
> --- a/include/asm-ia64/mca_asm.h
> +++ b/include/asm-ia64/mca_asm.h
> @@ -197,9 +197,9 @@
>         movl    temp2 = start_addr;                             \
>         ;;                                                      \
>         mov     cr.iip = temp2;                                 \
> +       movl    gp = __gp                                       \
>         ;;                                                      \
>         DATA_PA_TO_VA(sp, temp1);                               \
> -       DATA_PA_TO_VA(gp, temp2);                               \
>         srlz.i;                                                 \
>         ;;                                                      \
>         nop     1;                                              \
> 
> 
> -- 
> yamahata
diff -r e9706492e960 xen/include/asm-ia64/linux-xen/asm/mca_asm.h
--- a/xen/include/asm-ia64/linux-xen/asm/mca_asm.h      Thu Jul 31 12:25:50 
2008 +0900
+++ b/xen/include/asm-ia64/linux-xen/asm/mca_asm.h      Fri Aug 08 16:46:08 
2008 +0900
@@ -239,9 +239,9 @@ 30: mov ar.lc = _tmp1;                      \
        movl    temp2 = start_addr;                             \
        ;;                                                      \
        mov     cr.iip = temp2;                                 \
+       movl    gp = __gp                                       \
        ;;                                                      \
        DATA_PA_TO_VA(sp, temp1);                               \
-       DATA_PA_TO_VA(gp, temp2);                               \
        srlz.i;                                                 \
        ;;                                                      \
        nop     1;                                              \
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.