ia64/xen-unstable

changeset 16784:6a7fa7dbde56

[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@valinux.co.jp>
author Alex Williamson <alex.williamson@hp.com>
date Thu Jan 17 12:05:43 2008 -0700 (2008-01-17)
parents d0216f9e87c1
children af3550f53874
files xen/arch/ia64/asm-offsets.c xen/arch/ia64/xen/domain.c xen/arch/ia64/xen/ivt.S xen/include/asm-ia64/domain.h
line diff
     1.1 --- a/xen/arch/ia64/asm-offsets.c	Thu Jan 17 12:05:43 2008 -0700
     1.2 +++ b/xen/arch/ia64/asm-offsets.c	Thu Jan 17 12:05:43 2008 -0700
     1.3 @@ -56,7 +56,6 @@ void foo(void)
     1.4  	DEFINE(IA64_TASK_THREAD_KSP_OFFSET, offsetof (struct vcpu, arch._thread.ksp));
     1.5  	DEFINE(IA64_TASK_THREAD_ON_USTACK_OFFSET, offsetof (struct vcpu, arch._thread.on_ustack));
     1.6  
     1.7 -	DEFINE(IA64_VCPU_DOMAIN_OFFSET, offsetof (struct vcpu, domain));
     1.8  	DEFINE(IA64_VCPU_HYPERCALL_CONTINUATION_OFS, offsetof (struct vcpu, arch.hypercall_continuation));
     1.9  	DEFINE(IA64_VCPU_FP_PSR_OFFSET, offsetof (struct vcpu, arch.fp_psr));
    1.10  	DEFINE(IA64_VCPU_META_RID_DT_OFFSET, offsetof (struct vcpu, arch.metaphysical_rid_dt));
    1.11 @@ -79,7 +78,7 @@ void foo(void)
    1.12  
    1.13  	BLANK();
    1.14  
    1.15 -	DEFINE(IA64_DOMAIN_SHADOW_BITMAP_OFFSET, offsetof (struct domain, arch.shadow_bitmap));
    1.16 +	DEFINE(IA64_VCPU_SHADOW_BITMAP_OFFSET, offsetof (struct vcpu, arch.shadow_bitmap));
    1.17  
    1.18  	BLANK();
    1.19  
     2.1 --- a/xen/arch/ia64/xen/domain.c	Thu Jan 17 12:05:43 2008 -0700
     2.2 +++ b/xen/arch/ia64/xen/domain.c	Thu Jan 17 12:05:43 2008 -0700
     2.3 @@ -1745,6 +1745,10 @@ int shadow_mode_control(struct domain *d
     2.4  	case XEN_DOMCTL_SHADOW_OP_OFF:
     2.5  		if (shadow_mode_enabled (d)) {
     2.6  			u64 *bm = d->arch.shadow_bitmap;
     2.7 +			struct vcpu *v;
     2.8 +
     2.9 +			for_each_vcpu(d, v)
    2.10 +				v->arch.shadow_bitmap = NULL;
    2.11  
    2.12  			/* Flush vhpt and tlb to restore dirty bit usage.  */
    2.13  			domain_flush_tlb_vhpt(d);
    2.14 @@ -1780,9 +1784,12 @@ int shadow_mode_control(struct domain *d
    2.15  			rc = -ENOMEM;
    2.16  		}
    2.17  		else {
    2.18 +			struct vcpu *v;
    2.19  			memset(d->arch.shadow_bitmap, 0, 
    2.20  			       d->arch.shadow_bitmap_size / 8);
    2.21 -			
    2.22 +
    2.23 +			for_each_vcpu(d, v)
    2.24 +				v->arch.shadow_bitmap = d->arch.shadow_bitmap;
    2.25  			/* Flush vhtp and tlb to enable dirty bit
    2.26  			   virtualization.  */
    2.27  			domain_flush_tlb_vhpt(d);
     3.1 --- a/xen/arch/ia64/xen/ivt.S	Thu Jan 17 12:05:43 2008 -0700
     3.2 +++ b/xen/arch/ia64/xen/ivt.S	Thu Jan 17 12:05:43 2008 -0700
     3.3 @@ -394,11 +394,7 @@ ENTRY(dirty_bit)
     3.4  	;;
     3.5  	ld8 r22=[r22]
     3.6  	;;
     3.7 -	add r22=IA64_VCPU_DOMAIN_OFFSET,r22
     3.8 -	;;
     3.9 -	ld8 r22=[r22]			// read domain
    3.10 -	;;
    3.11 -	add r22=IA64_DOMAIN_SHADOW_BITMAP_OFFSET,r22
    3.12 +	add r22=IA64_VCPU_SHADOW_BITMAP_OFFSET,r22
    3.13  	;;
    3.14  	ld8 r22=[r22]
    3.15  	;;
     4.1 --- a/xen/include/asm-ia64/domain.h	Thu Jan 17 12:05:43 2008 -0700
     4.2 +++ b/xen/include/asm-ia64/domain.h	Thu Jan 17 12:05:43 2008 -0700
     4.3 @@ -259,6 +259,7 @@ struct arch_vcpu {
     4.4      unsigned long metaphysical_saved_rr0;	// from arch_domain (so is pinned)
     4.5      unsigned long metaphysical_saved_rr4;	// from arch_domain (so is pinned)
     4.6      unsigned long fp_psr;       // used for lazy float register
     4.7 +    u64 *shadow_bitmap;         // from arch_domain (so is pinned)
     4.8      int breakimm;			// from arch_domain (so is pinned)
     4.9      int starting_rid;		/* first RID assigned to domain */
    4.10      int ending_rid;		/* one beyond highest RID assigned to domain */