ia64/xen-unstable

changeset 8375:72f51528d55a

More pal_flush_cache calls for split cache machines (by Anthony Xu)
author djm@kirby.fc.hp.com
date Wed Dec 21 08:27:09 2005 -0600 (2005-12-21)
parents 545ba1b126ca
children ff81b875b136
files xen/arch/ia64/xen/domain.c
line diff
     1.1 --- a/xen/arch/ia64/xen/domain.c	Tue Dec 20 14:11:17 2005 -0600
     1.2 +++ b/xen/arch/ia64/xen/domain.c	Wed Dec 21 08:27:09 2005 -0600
     1.3 @@ -272,17 +272,6 @@ int arch_set_info_guest(struct vcpu *v, 
     1.4  	printf("arch_set_info_guest\n");
     1.5  	if ( test_bit(_VCPUF_initialised, &v->vcpu_flags) )
     1.6              return 0;
     1.7 -
     1.8 -#ifdef CONFIG_IA64_SPLIT_CACHE
     1.9 -	/* Sync d/i cache conservatively */
    1.10 -	if (!running_on_sim) {
    1.11 -	    ret = ia64_pal_cache_flush(4, 0, &progress, NULL);
    1.12 -	    if (ret != PAL_STATUS_SUCCESS)
    1.13 -	        panic("PAL CACHE FLUSH failed for domain.\n");
    1.14 -	    printk("Sync i/d cache for dom0 image SUCC\n");
    1.15 -	}
    1.16 -#endif
    1.17 -
    1.18  	if (c->flags & VGCF_VMX_GUEST) {
    1.19  	    if (!vmx_enabled) {
    1.20  		printk("No VMX hardware feature for vmx domain.\n");
    1.21 @@ -299,6 +288,16 @@ int arch_set_info_guest(struct vcpu *v, 
    1.22  	d->arch.sys_pgnr = c->sys_pgnr;
    1.23  	new_thread(v, regs->cr_iip, 0, 0);
    1.24  
    1.25 +#ifdef CONFIG_IA64_SPLIT_CACHE
    1.26 +    /* Sync d/i cache conservatively */
    1.27 +    if (!running_on_sim) {
    1.28 +        ret = ia64_pal_cache_flush(4, 0, &progress, NULL);
    1.29 +        if ((ret!=PAL_STATUS_SUCCESS)&& (ret!=PAL_STATUS_UNIMPLEMENTED))
    1.30 +            printk("PAL CACHE FLUSH failed for dom0.\n");
    1.31 +        else
    1.32 +            printk("Sync i/d cache for guest SUCC\n");
    1.33 +    }
    1.34 +#endif
    1.35   	v->vcpu_info->arch.evtchn_vector = c->vcpu.evtchn_vector;
    1.36  	if ( c->vcpu.privregs && copy_from_user(v->arch.privregs,
    1.37  			   c->vcpu.privregs, sizeof(mapped_regs_t))) {
    1.38 @@ -898,13 +897,6 @@ int construct_dom0(struct domain *d,
    1.39  	//if ( initrd_len != 0 )
    1.40  	//    memcpy((void *)vinitrd_start, initrd_start, initrd_len);
    1.41  
    1.42 -	/* Sync d/i cache conservatively */
    1.43 -	if (!running_on_sim) {
    1.44 -	    ret = ia64_pal_cache_flush(4, 0, &progress, NULL);
    1.45 -	    if (ret != PAL_STATUS_SUCCESS)
    1.46 -	        panic("PAL CACHE FLUSH failed for dom0.\n");
    1.47 -	    printk("Sync i/d cache for dom0 image SUCC\n");
    1.48 -	}
    1.49  
    1.50  	/* Set up start info area. */
    1.51  	si = (start_info_t *)alloc_xenheap_page();
    1.52 @@ -958,6 +950,16 @@ int construct_dom0(struct domain *d,
    1.53  
    1.54  	new_thread(v, pkern_entry, 0, 0);
    1.55  	physdev_init_dom0(d);
    1.56 +#ifdef CONFIG_IA64_SPLIT_CACHE
    1.57 +    /* Sync d/i cache conservatively */
    1.58 +    if (!running_on_sim) {
    1.59 +        ret = ia64_pal_cache_flush(4, 0, &progress, NULL);
    1.60 +        if ((ret!=PAL_STATUS_SUCCESS)&& (ret!=PAL_STATUS_UNIMPLEMENTED))
    1.61 +            printk("PAL CACHE FLUSH failed for dom0.\n");
    1.62 +        else
    1.63 +            printk("Sync i/d cache for guest SUCC\n");
    1.64 +    }
    1.65 +#endif
    1.66  
    1.67  	// FIXME: Hack for keyboard input
    1.68  #ifdef CLONE_DOMAIN0
    1.69 @@ -1016,6 +1018,16 @@ int construct_domU(struct domain *d,
    1.70  #endif
    1.71  	new_thread(v, pkern_entry, 0, 0);
    1.72  	printk("new_thread returns\n");
    1.73 +#ifdef CONFIG_IA64_SPLIT_CACHE
    1.74 +    /* Sync d/i cache conservatively */
    1.75 +    if (!running_on_sim) {
    1.76 +        ret = ia64_pal_cache_flush(4, 0, &progress, NULL);
    1.77 +        if ((ret!=PAL_STATUS_SUCCESS)&& (ret!=PAL_STATUS_UNIMPLEMENTED))
    1.78 +            printk("PAL CACHE FLUSH failed for dom0.\n");
    1.79 +        else
    1.80 +            printk("Sync i/d cache for guest SUCC\n");
    1.81 +    }
    1.82 +#endif
    1.83  	__set_bit(0x30, VCPU(v, delivery_mask));
    1.84  
    1.85  	return 0;
    1.86 @@ -1029,6 +1041,16 @@ void reconstruct_domU(struct vcpu *v)
    1.87  		v->domain->domain_id);
    1.88  	loaddomainelfimage(v->domain,v->domain->arch.image_start);
    1.89  	new_thread(v, v->domain->arch.entry, 0, 0);
    1.90 +#ifdef CONFIG_IA64_SPLIT_CACHE
    1.91 +    /* Sync d/i cache conservatively */
    1.92 +    if (!running_on_sim) {
    1.93 +        ret = ia64_pal_cache_flush(4, 0, &progress, NULL);
    1.94 +        if ((ret!=PAL_STATUS_SUCCESS)&& (ret!=PAL_STATUS_UNIMPLEMENTED))
    1.95 +            printk("PAL CACHE FLUSH failed for dom0.\n");
    1.96 +        else
    1.97 +            printk("Sync i/d cache for guest SUCC\n");
    1.98 +    }
    1.99 +#endif
   1.100  }
   1.101  #endif
   1.102