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

[Xen-ia64-devel] [PATCH][Open GFW] Fix windows 2003 boot issue.



Hi Tristan,

The attached patch fixes windows 2003 boot issue of Open GFW.
Please apply.

Thanks,
Kouya

Kouya Shimura writes:
> Hi Ronghui,
> 
> I'm just investigating this issue.
> CS#17288 exposes a hiding issue of Open GFW.
> The cause is that some EFI service accesses a MMIO 
> without the TLB mapping. I'll fix it.
> 
> FYI, this issue can be avoided with the following VM's config:
> ====================================
> guest_os_type='windows'
> ====================================
> 
> Thanks,
> Kouya
> 
> Duan, Ronghui writes:
> > 
> > Hi Kouya,
> > 
> > Our QA member Amy reported few days before that Win2k3 hangs when booting. 
> > I find that if using Open Guest firmware and revert your patch of CS#17288, 
> > Win2k3 can boot. As Amy says Win2k3 can boot on Intel's firmware and I 
> > don't make sure that whether it is a firmware's bug but I note that you 
> > delete many conditions checking in your patch. I rewrite your patch base on 
> > original code and seem that Win2k3 can boot as normal. I am not sure 
> > whether it implements the purpose of your patch, could you help to check? 
> > 
> > I find that you include one condition that vpsr.it=0, vpsr.dt=1 which does 
> > not exist in original code. I am not sure whether this condition could 
> > happen in the real OS. If so could we support this at this time? If you can 
> > make sure that it is fine, could you explain that or whether I 
> > misunderstand something? Thanks.
> > 
> > Best regards
> > Ronghui

# HG changeset patch
# User Kouya Shimura <kouya@xxxxxxxxxxxxxx>
# Date 1206954986 -32400
# Node ID 12566e336e51874c6a71ac0fac368d1e9a0d5143
# Parent  42899f0d94c38f08e4ceb3fa9dfe027b24d59109
Fix windows 2003 boot issue.

Windows 2003 bootloder sets psr.dt=1 before it sets its own IVT handler.
That causes a impossible data TLB miss in EFI's KeyboardTimerHandler
which expects running on physical data addressing mode.

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>

diff -r 42899f0d94c3 -r 12566e336e51 edk2-sparse/EdkXenPkg/SecMain/Ipf/startup.s
--- a/edk2-sparse/EdkXenPkg/SecMain/Ipf/startup.s       Sun Mar 30 07:42:10 
2008 +0200
+++ b/edk2-sparse/EdkXenPkg/SecMain/Ipf/startup.s       Mon Mar 31 18:16:26 
2008 +0900
@@ -49,7 +49,7 @@ VECTOR(0x0800)  // Data TLB
        mov SCRATCH_REG1=cr.ifa
        mov SCRATCH_REG2=0x661 // AR=3,PL=0(RWX),D,A,P
        ;;
-       mov SCRATCH_REG3=14<<2 // pagesize=16KB
+       mov SCRATCH_REG3=24<<2 // pagesize=16MB
        dep SCRATCH_REG2=SCRATCH_REG2,SCRATCH_REG1,0,12
        movl SCRATCH_REG4=(1<<50)-1
        ;;
@@ -65,7 +65,7 @@ VECTOR(0x0800)  // Data TLB
        mov SCRATCH_REG1=cr.ifa
        mov SCRATCH_REG2=0x661 // AR=3,PL=0(RWX),D,A,P
        ;;
-       mov SCRATCH_REG3=14<<2 // pagesize=16KB
+       mov SCRATCH_REG3=24<<2 // pagesize=16MB
        dep SCRATCH_REG2=SCRATCH_REG2,SCRATCH_REG1,0,12
        movl SCRATCH_REG4=(1<<50)-1
        ;;
@@ -186,6 +186,24 @@ IpfContextBuf:
 //      loc4 - temporary storage of last address in context record
 
 HookHandler:
+   // switch to using physical data addressing
+#define IA64_PSR_DT_BIT        17
+#define IA64_PSR_RT_BIT        27
+#define IA64_PSR_DT    (1<<IA64_PSR_DT_BIT)
+#define IA64_PSR_RT    (1<<IA64_PSR_RT_BIT)
+       mov     r30=pr
+       mov     r16=psr
+       movl    r17=~(IA64_PSR_DT|IA64_PSR_RT)
+       ;;
+       tbit.nz p6,p0=r16,IA64_PSR_DT_BIT
+       and     r17=r16,r17
+       ;;
+(p6)   mov     psr.l=r17
+       ;;
+(p6)   srlz.d
+       mov     pr=r30,-1
+       ;;
+  // now we are in physical data addressing mode
        mov     r16=cr.iip
        mov     r17=cr.ifa
        mov     r20=cr.isr
_______________________________________________
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®.