ia64/xen-unstable

changeset 8993:e33ebd143767

Tools changes for per-vcpu io event channel on IA64.

Signed-off-by Kevin Tian <Kevin.tian@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Feb 24 10:29:09 2006 +0100 (2006-02-24)
parents 70575c8cab99
children e0f563e8db9f
files tools/libxc/xc_ia64_stubs.c
line diff
     1.1 --- a/tools/libxc/xc_ia64_stubs.c	Fri Feb 24 08:49:32 2006 +0100
     1.2 +++ b/tools/libxc/xc_ia64_stubs.c	Fri Feb 24 10:29:09 2006 +0100
     1.3 @@ -569,12 +569,14 @@ static int add_pal_hob(void* hob_buf){
     1.4  static int setup_guest(  int xc_handle,
     1.5                           uint32_t dom, unsigned long memsize,
     1.6                           char *image, unsigned long image_size,
     1.7 -                         unsigned int control_evtchn,
     1.8 +                         uint32_t vcpus,
     1.9                           unsigned int store_evtchn,
    1.10                           unsigned long *store_mfn)
    1.11  {
    1.12      unsigned long page_array[2];
    1.13      shared_iopage_t *sp;
    1.14 +    int i;
    1.15 +
    1.16      // FIXME: initialize pfn list for a temp hack
    1.17      if (xc_ia64_get_pfn_list(xc_handle, dom, NULL, -1, -1) == -1) {
    1.18  	PERROR("Could not allocate continuous memory");
    1.19 @@ -612,7 +614,18 @@ static int setup_guest(  int xc_handle,
    1.20  		page_array[0])) == 0)
    1.21  	goto error_out;
    1.22      memset(sp, 0, PAGE_SIZE);
    1.23 -    sp->sp_global.eport = control_evtchn;
    1.24 +
    1.25 +    for (i = 0; i < vcpus; i++) {
    1.26 +        uint32_t vp_eport;
    1.27 +
    1.28 +        vp_eport = xc_evtchn_alloc_unbound(xc_handle, dom, 0);
    1.29 +        if (vp_eport < 0) {
    1.30 +            fprintf(stderr, "Couldn't get unbound port from VMX guest.\n");
    1.31 +            goto error_out;
    1.32 +        }
    1.33 +        sp->vcpu_iodata[i].vp_eport = vp_eport;
    1.34 +    }
    1.35 +
    1.36      munmap(sp, PAGE_SIZE);
    1.37  
    1.38      return 0;
    1.39 @@ -625,7 +638,6 @@ int xc_hvm_build(int xc_handle,
    1.40                   uint32_t domid,
    1.41                   int memsize,
    1.42                   const char *image_name,
    1.43 -                 unsigned int control_evtchn,
    1.44                   unsigned int vcpus,
    1.45                   unsigned int pae,
    1.46                   unsigned int acpi,
    1.47 @@ -668,8 +680,8 @@ int xc_hvm_build(int xc_handle,
    1.48  
    1.49      memset(ctxt, 0, sizeof(*ctxt));
    1.50  
    1.51 -    if ( setup_guest(xc_handle, domid, (unsigned long)memsize, image, image_size, 
    1.52 -                       control_evtchn, store_evtchn, store_mfn ) < 0 ){
    1.53 +    if ( setup_guest(xc_handle, domid, (unsigned long)memsize, image,
    1.54 +                     image_size, vcpus, store_evtchn, store_mfn ) < 0 ){
    1.55          ERROR("Error constructing guest OS");
    1.56          goto error_out;
    1.57      }