direct-io.hg

changeset 11453:019b7c756ddb

[IA64] Add xen boot option "dom0_vcpus_pin"

This patch adds the xen boot option to pin Domain-0 VCPUs.

Signed-off-by: Kouya SHIMURA <kouya@jp.fujitsu.com>
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author awilliam@xenbuild.aw
date Tue Sep 12 11:29:02 2006 -0600 (2006-09-12)
parents a1988768828d
children b55bbf6d4e89
files xen/arch/ia64/xen/domain.c xen/arch/ia64/xen/xensetup.c
line diff
     1.1 --- a/xen/arch/ia64/xen/domain.c	Sun Sep 10 15:34:14 2006 -0600
     1.2 +++ b/xen/arch/ia64/xen/domain.c	Tue Sep 12 11:29:02 2006 -0600
     1.3 @@ -54,6 +54,7 @@ unsigned long dom0_align = 64*1024*1024;
     1.4  static unsigned int dom0_max_vcpus = 1;
     1.5  integer_param("dom0_max_vcpus", dom0_max_vcpus); 
     1.6  
     1.7 +extern int opt_dom0_vcpus_pin;
     1.8  extern unsigned long running_on_sim;
     1.9  
    1.10  extern char dom0_command_line[];
    1.11 @@ -1020,9 +1021,12 @@ int construct_dom0(struct domain *d,
    1.12  	    dom0_max_vcpus = MAX_VIRT_CPUS;
    1.13  	
    1.14  	printf ("Dom0 max_vcpus=%d\n", dom0_max_vcpus);
    1.15 -	for ( i = 1; i < dom0_max_vcpus; i++ )
    1.16 +	for ( i = 1; i < dom0_max_vcpus; i++ ) {
    1.17  	    if (alloc_vcpu(d, i, i) == NULL)
    1.18  		printf ("Cannot allocate dom0 vcpu %d\n", i);
    1.19 +	    else if (opt_dom0_vcpus_pin)
    1.20 +		d->vcpu[i]->cpu_affinity = cpumask_of_cpu(i);
    1.21 +	}
    1.22  
    1.23  	/* Copy the OS image. */
    1.24  	loaddomainelfimage(d,image_start);
     2.1 --- a/xen/arch/ia64/xen/xensetup.c	Sun Sep 10 15:34:14 2006 -0600
     2.2 +++ b/xen/arch/ia64/xen/xensetup.c	Tue Sep 12 11:29:02 2006 -0600
     2.3 @@ -49,6 +49,10 @@ extern void mem_init(void);
     2.4  extern void init_IRQ(void);
     2.5  extern void trap_init(void);
     2.6  
     2.7 +/* opt_dom0_vcpus_pin: If true, dom0 VCPUs are pinned. */
     2.8 +unsigned int opt_dom0_vcpus_pin = 0;
     2.9 +boolean_param("dom0_vcpus_pin", opt_dom0_vcpus_pin);
    2.10 +
    2.11  /* opt_nosmp: If true, secondary processors are ignored. */
    2.12  static int opt_nosmp = 0;
    2.13  boolean_param("nosmp", opt_nosmp);
    2.14 @@ -517,6 +521,10 @@ printk("num_online_cpus=%d, max_cpus=%d\
    2.15    			0) != 0)
    2.16          panic("Could not set up DOM0 guest OS\n");
    2.17  
    2.18 +    /* PIN domain0 VCPU 0 on CPU 0. */
    2.19 +    if (opt_dom0_vcpus_pin)
    2.20 +        dom0->vcpu[0]->cpu_affinity = cpumask_of_cpu(0);
    2.21 +
    2.22      if (!running_on_sim)  // slow on ski and pages are pre-initialized to zero
    2.23  	scrub_heap_pages();
    2.24