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

[Xen-changelog] [xen-unstable] [IA64] domheap: Fix current->domain->arch.shadow_bitmap reference



# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1200596743 25200
# Node ID 6a7fa7dbde5662618ab710d320479c575ae8a769
# Parent  d0216f9e87c1d9b99563c5a5381915d8c2cda47f
[IA64] domheap: Fix current->domain->arch.shadow_bitmap reference

Don't reference current->domain->arch.shadow_bitmap in dirty_bit fault handler.
Instead copy it to arch_vcpu.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 xen/arch/ia64/asm-offsets.c   |    3 +--
 xen/arch/ia64/xen/domain.c    |    9 ++++++++-
 xen/arch/ia64/xen/ivt.S       |    6 +-----
 xen/include/asm-ia64/domain.h |    1 +
 4 files changed, 11 insertions(+), 8 deletions(-)

diff -r d0216f9e87c1 -r 6a7fa7dbde56 xen/arch/ia64/asm-offsets.c
--- a/xen/arch/ia64/asm-offsets.c       Thu Jan 17 12:05:43 2008 -0700
+++ b/xen/arch/ia64/asm-offsets.c       Thu Jan 17 12:05:43 2008 -0700
@@ -56,7 +56,6 @@ void foo(void)
        DEFINE(IA64_TASK_THREAD_KSP_OFFSET, offsetof (struct vcpu, 
arch._thread.ksp));
        DEFINE(IA64_TASK_THREAD_ON_USTACK_OFFSET, offsetof (struct vcpu, 
arch._thread.on_ustack));
 
-       DEFINE(IA64_VCPU_DOMAIN_OFFSET, offsetof (struct vcpu, domain));
        DEFINE(IA64_VCPU_HYPERCALL_CONTINUATION_OFS, offsetof (struct vcpu, 
arch.hypercall_continuation));
        DEFINE(IA64_VCPU_FP_PSR_OFFSET, offsetof (struct vcpu, arch.fp_psr));
        DEFINE(IA64_VCPU_META_RID_DT_OFFSET, offsetof (struct vcpu, 
arch.metaphysical_rid_dt));
@@ -79,7 +78,7 @@ void foo(void)
 
        BLANK();
 
-       DEFINE(IA64_DOMAIN_SHADOW_BITMAP_OFFSET, offsetof (struct domain, 
arch.shadow_bitmap));
+       DEFINE(IA64_VCPU_SHADOW_BITMAP_OFFSET, offsetof (struct vcpu, 
arch.shadow_bitmap));
 
        BLANK();
 
diff -r d0216f9e87c1 -r 6a7fa7dbde56 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c        Thu Jan 17 12:05:43 2008 -0700
+++ b/xen/arch/ia64/xen/domain.c        Thu Jan 17 12:05:43 2008 -0700
@@ -1745,6 +1745,10 @@ int shadow_mode_control(struct domain *d
        case XEN_DOMCTL_SHADOW_OP_OFF:
                if (shadow_mode_enabled (d)) {
                        u64 *bm = d->arch.shadow_bitmap;
+                       struct vcpu *v;
+
+                       for_each_vcpu(d, v)
+                               v->arch.shadow_bitmap = NULL;
 
                        /* Flush vhpt and tlb to restore dirty bit usage.  */
                        domain_flush_tlb_vhpt(d);
@@ -1780,9 +1784,12 @@ int shadow_mode_control(struct domain *d
                        rc = -ENOMEM;
                }
                else {
+                       struct vcpu *v;
                        memset(d->arch.shadow_bitmap, 0, 
                               d->arch.shadow_bitmap_size / 8);
-                       
+
+                       for_each_vcpu(d, v)
+                               v->arch.shadow_bitmap = d->arch.shadow_bitmap;
                        /* Flush vhtp and tlb to enable dirty bit
                           virtualization.  */
                        domain_flush_tlb_vhpt(d);
diff -r d0216f9e87c1 -r 6a7fa7dbde56 xen/arch/ia64/xen/ivt.S
--- a/xen/arch/ia64/xen/ivt.S   Thu Jan 17 12:05:43 2008 -0700
+++ b/xen/arch/ia64/xen/ivt.S   Thu Jan 17 12:05:43 2008 -0700
@@ -394,11 +394,7 @@ ENTRY(dirty_bit)
        ;;
        ld8 r22=[r22]
        ;;
-       add r22=IA64_VCPU_DOMAIN_OFFSET,r22
-       ;;
-       ld8 r22=[r22]                   // read domain
-       ;;
-       add r22=IA64_DOMAIN_SHADOW_BITMAP_OFFSET,r22
+       add r22=IA64_VCPU_SHADOW_BITMAP_OFFSET,r22
        ;;
        ld8 r22=[r22]
        ;;
diff -r d0216f9e87c1 -r 6a7fa7dbde56 xen/include/asm-ia64/domain.h
--- a/xen/include/asm-ia64/domain.h     Thu Jan 17 12:05:43 2008 -0700
+++ b/xen/include/asm-ia64/domain.h     Thu Jan 17 12:05:43 2008 -0700
@@ -259,6 +259,7 @@ struct arch_vcpu {
     unsigned long metaphysical_saved_rr0;      // from arch_domain (so is 
pinned)
     unsigned long metaphysical_saved_rr4;      // from arch_domain (so is 
pinned)
     unsigned long fp_psr;       // used for lazy float register
+    u64 *shadow_bitmap;         // from arch_domain (so is pinned)
     int breakimm;                      // from arch_domain (so is pinned)
     int starting_rid;          /* first RID assigned to domain */
     int ending_rid;            /* one beyond highest RID assigned to domain */

_______________________________________________
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®.