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-ia64-devel

[Xen-ia64-devel] [PATCH 4/12] make vmx_switch_rr7 map stack

To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH 4/12] make vmx_switch_rr7 map stack
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Thu, 20 Dec 2007 16:37:04 +0900
Cc: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Delivery-date: Wed, 19 Dec 2007 23:37:51 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
# HG changeset patch
# User yamahata@xxxxxxxxxxxxx
# Date 1197967036 -32400
# Node ID 7a490dbc8f32b32a19ba713f4f9a76e74d10fe1d
# Parent  425cd56ef7a955c593cc70c1ea5755c0b72e97b2
make vmx_swtich_rr7() consistent to ia64_new_rr7() so that it maps
stack.
PATCHNAME: fix_vmx_switch_rr7_map_stack

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff -r 425cd56ef7a9 -r 7a490dbc8f32 xen/arch/ia64/vmx/vmx_entry.S
--- a/xen/arch/ia64/vmx/vmx_entry.S     Tue Dec 18 17:37:15 2007 +0900
+++ b/xen/arch/ia64/vmx/vmx_entry.S     Tue Dec 18 17:37:16 2007 +0900
@@ -620,7 +620,6 @@ END(ia64_leave_hypercall)
 #define PSR_BITS_TO_SET    IA64_PSR_BN
 
 //extern void vmx_switch_rr7(unsigned long rid, void *guest_vhpt, void * 
pal_vaddr );
-
 GLOBAL_ENTRY(vmx_switch_rr7)
        // not sure this unwind statement is correct...
        .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(1)
@@ -672,6 +671,7 @@ 1:
        mov cr.ifa=r17
        mov r16=IA64_TR_KERNEL
        movl r25 = PAGE_KERNEL
+       // r2=KERNEL_TR_PAGE_SHIFT truncated physicall address of ip
        dep r2=0,r3,0,KERNEL_TR_PAGE_SHIFT
        ;;
        or r24=r2,r25
@@ -693,6 +693,25 @@ 1:
        itr.d dtr[r16]=r24
        ;;
 
+       // re-pin mapping for stack (current)
+       // unless overlaps with IA64_TR_XEN_HEAP_REGS
+       mov r26=IA64_GRANULE_SHIFT<<2
+       dep r21=0,r13,60,4              // physical address of "current"
+       ;;
+       dep r3=0,r21,0,KERNEL_TR_PAGE_SHIFT
+       ;; 
+       cmp.eq p7,p0=r2,r3
+(p7)   br.cond.sptk .stack_overlaps
+       ;;
+       ptr.d   r13,r26
+       or r23=r21,r25                  // construct PA | page properties
+       mov cr.itir=r26
+       mov cr.ifa=r13                  // VA of next task...
+       mov r18=IA64_TR_CURRENT_STACK
+       ;;
+       itr.d dtr[r18]=r23              // wire in new mapping...
+.stack_overlaps:
+
        // re-pin mappings for per-cpu data
        movl r22 = PERCPU_ADDR
        ;;
@@ -709,8 +728,16 @@ 1:
        ;;
 
        // re-pin mappings for guest_vhpt
+       // unless overlaps with IA64_TR_XEN_HEAP_REGS or IA64_TR_CURRENT_STACK
+       dep r18=0,loc5,0,KERNEL_TR_PAGE_SHIFT
+       dep r21=0,r21,0,IA64_GRANULE_SHIFT 
+       dep r17=0,loc5,0,IA64_GRANULE_SHIFT 
+       ;;
+       cmp.eq p6,p0=r18,r2             // check overlap with xen heap
+       cmp.eq p7,p0=r17,r21            // check overlap with current stack
+(p6)   br.cond.sptk .vhpt_overlaps
+(p7)   br.cond.sptk .vhpt_overlaps
        mov r24=IA64_TR_VHPT
-       movl r25=PAGE_KERNEL
        ;;
        or loc5 = r25,loc5              // construct PA | page properties
        mov r23 = IA64_GRANULE_SHIFT <<2
@@ -722,6 +749,7 @@ 1:
        ;;
        itr.d dtr[r24]=loc5             // wire in new mapping...
        ;;
+.vhpt_overlaps:
 
        // re-pin mappings for PAL code section
        mov r24=IA64_TR_PALCODE

Attachment: 16636_7a490dbc8f32_fix_vmx_switch_rr7_map_stack.patch
Description: Text Data

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-ia64-devel] [PATCH 4/12] make vmx_switch_rr7 map stack, Isaku Yamahata <=