WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [IA64] fixed a vcpu_translate bug

# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID 463c67da6f0ab8d598a1f0cac4e2005ae908182c
# Parent  edc63b5dd71d29dd52895b93ed72cb99c223fc38
[IA64] fixed a vcpu_translate bug

There are some below code segments in guest OS
1.     Rsm psr.dt
       ...
2.     itc.d r18
       ...
3.     rfi

After executing instruction 1, domain is in metaphysical mode.
When executing instruction 2, VMM gets control to emulate this
instruction. Firstly VMM will try to get opcode, which may
trigger a tlb miss. At this time domain is in metaphysical mode
and the fault address is in region 5. vcpu_translate handles this
as normal guest metaphysical mode.

It's not correct; sometimes this will make dom0 hang.

cpu_translate should handle this situation as if
guest is not in metaphysical mode.

Signed-off-by: Anthony Xu <anthony.xu@xxxxxxxxx>

diff -r edc63b5dd71d -r 463c67da6f0a xen/arch/ia64/xen/vcpu.c
--- a/xen/arch/ia64/xen/vcpu.c  Fri Mar 17 20:44:48 2006
+++ b/xen/arch/ia64/xen/vcpu.c  Fri Mar 17 21:06:20 2006
@@ -1283,13 +1283,23 @@
 // FIXME: This seems to happen even though it shouldn't.  Need to track
 // this down, but since it has been apparently harmless, just flag it for now
 //                     panic_domain(vcpu_regs(vcpu),
-                       printk(
-                        "vcpu_translate: bad physical address: 
0x%lx\n",address);
+
+                       /*
+                        * Guest may execute itc.d and rfi with psr.dt=0
+                        * When VMM try to fetch opcode, tlb miss may happen,
+                        * At this time PSCB(vcpu,metaphysical_mode)=1,
+                        * region=5,VMM need to handle this tlb miss as if
+                        * PSCB(vcpu,metaphysical_mode)=0
+                        */           
+                       printk("vcpu_translate: bad physical address: 0x%lx\n",
+                              address);
+               } else {
+                       *pteval = (address & _PAGE_PPN_MASK) | __DIRTY_BITS |
+                                 _PAGE_PL_2 | _PAGE_AR_RWX;
+                       *itir = PAGE_SHIFT << 2;
+                       phys_translate_count++;
+                       return IA64_NO_FAULT;
                }
-               *pteval = (address & _PAGE_PPN_MASK) | __DIRTY_BITS | 
_PAGE_PL_2 | _PAGE_AR_RWX;
-               *itir = PAGE_SHIFT << 2;
-               phys_translate_count++;
-               return IA64_NO_FAULT;
        }
        else if (!region && warn_region0_address) {
                REGS *regs = vcpu_regs(vcpu);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [IA64] fixed a vcpu_translate bug, Xen patchbot -unstable <=