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

[Xen-changelog] [xen-unstable] [IA64] Fix a bug in set_rse_reg



# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID 997bd5fcf30739c12a12563683fa9a632775dfe9
# Parent  a34659228c2466f4443f22543ea2bebd3859b077
[IA64] Fix a bug in set_rse_reg

When setting rse reg, XEN needs to modify backing store memory.
This operation can't be interrupted, otherwise contents of
stack registers may be destroyed.

Signed-off-by: Anthony Xu <anthony.xu@xxxxxxxxx>
---
 xen/arch/ia64/linux-xen/unaligned.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff -r a34659228c24 -r 997bd5fcf307 xen/arch/ia64/linux-xen/unaligned.c
--- a/xen/arch/ia64/linux-xen/unaligned.c       Thu Sep 21 15:34:10 2006 -0600
+++ b/xen/arch/ia64/linux-xen/unaligned.c       Thu Sep 21 15:34:24 2006 -0600
@@ -304,7 +304,7 @@ set_rse_reg (struct pt_regs *regs, unsig
        unsigned long *bsp, *bspstore, *addr, *rnat_addr;
        unsigned long *kbs = (void *) current + IA64_RBS_OFFSET;
        unsigned long nat_mask;
-    unsigned long old_rsc,new_rsc;
+       unsigned long old_rsc, new_rsc, psr;
        unsigned long rnat;
        long sof = (regs->cr_ifs) & 0x7f;
        long sor = 8 * ((regs->cr_ifs >> 14) & 0xf);
@@ -321,16 +321,17 @@ set_rse_reg (struct pt_regs *regs, unsig
                ridx = rotate_reg(sor, rrb_gr, ridx);
 
     old_rsc=ia64_get_rsc();
-    new_rsc=old_rsc&(~0x3);
+    /* put RSC to lazy mode, and set loadrs 0 */
+    new_rsc = old_rsc & (~0x3fff0003);
     ia64_set_rsc(new_rsc);
-
+    bsp = kbs + (regs->loadrs >> 19); /* 16 + 3 */
+
+    addr = ia64_rse_skip_regs(bsp, -sof + ridx);
+    nat_mask = 1UL << ia64_rse_slot_num(addr);
+    rnat_addr = ia64_rse_rnat_addr(addr);
+    
+    local_irq_save(psr); 
     bspstore = (unsigned long*)ia64_get_bspstore();
-    bsp =kbs + (regs->loadrs >> 19);//16+3
-
-       addr = ia64_rse_skip_regs(bsp, -sof + ridx);
-    nat_mask = 1UL << ia64_rse_slot_num(addr);
-       rnat_addr = ia64_rse_rnat_addr(addr);
-
     if(addr >= bspstore){
 
         ia64_flushrs ();
@@ -358,6 +359,7 @@ set_rse_reg (struct pt_regs *regs, unsig
         ia64_set_bspstore (bspstore);
         ia64_set_rnat(rnat);
     }
+    local_irq_restore(psr);
     ia64_set_rsc(old_rsc);
 }
 

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


 


Rackspace

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