Signed-off-by: juergen.gross@xxxxxxxxxxxxxx diff -r 3263d0ff9476 tools/libxl/libxl.c --- a/tools/libxl/libxl.c Thu Jul 29 16:53:40 2010 +0100 +++ b/tools/libxl/libxl.c Mon Aug 02 08:27:03 2010 +0200 @@ -2479,6 +2479,7 @@ int libxl_get_physinfo(libxl_ctx *ctx, l physinfo->max_cpu_id = xcphysinfo.max_cpu_id; physinfo->nr_cpus = xcphysinfo.nr_cpus; physinfo->cpu_khz = xcphysinfo.cpu_khz; + physinfo->max_phys_cpus = xcphysinfo.max_phys_cpus; physinfo->total_pages = xcphysinfo.total_pages; physinfo->free_pages = xcphysinfo.free_pages; physinfo->scrub_pages = xcphysinfo.scrub_pages; @@ -2550,7 +2551,7 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ct XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "getting physinfo"); return NULL; } - *cpusize = physinfo.max_cpu_id + 1; + *cpusize = physinfo.max_phys_cpus + 1; ptr = libxl_calloc(ctx, domaininfo.max_vcpu_id + 1, sizeof (libxl_vcpuinfo)); if (!ptr) { return NULL; diff -r 3263d0ff9476 tools/libxl/libxl.h --- a/tools/libxl/libxl.h Thu Jul 29 16:53:40 2010 +0100 +++ b/tools/libxl/libxl.h Mon Aug 02 08:27:03 2010 +0200 @@ -581,6 +581,7 @@ typedef struct { uint32_t max_cpu_id; uint32_t nr_cpus; uint32_t cpu_khz; + uint32_t max_phys_cpus; uint64_t total_pages; uint64_t free_pages; diff -r 3263d0ff9476 tools/libxl/xl_cmdimpl.c --- a/tools/libxl/xl_cmdimpl.c Thu Jul 29 16:53:40 2010 +0100 +++ b/tools/libxl/xl_cmdimpl.c Mon Aug 02 08:27:03 2010 +0200 @@ -3297,7 +3297,7 @@ void vcpupin(char *d, const char *vcpu, goto vcpupin_out1; } - cpumap = calloc(physinfo.max_cpu_id + 1, sizeof (uint64_t)); + cpumap = calloc(physinfo.max_phys_cpus + 1, sizeof (uint64_t)); if (!cpumap) { goto vcpupin_out1; } @@ -3325,12 +3325,12 @@ void vcpupin(char *d, const char *vcpu, } } else { - memset(cpumap, -1, sizeof (uint64_t) * (physinfo.max_cpu_id + 1)); + memset(cpumap, -1, sizeof (uint64_t) * (physinfo.max_phys_cpus + 1)); } if (vcpuid != -1) { if (libxl_set_vcpuaffinity(&ctx, domid, vcpuid, - cpumap, physinfo.max_cpu_id + 1) == -1) { + cpumap, physinfo.max_phys_cpus + 1) == -1) { fprintf(stderr, "Could not set affinity for vcpu `%u'.\n", vcpuid); } } @@ -3341,7 +3341,7 @@ void vcpupin(char *d, const char *vcpu, } for (; nb_vcpu > 0; --nb_vcpu, ++vcpuinfo) { if (libxl_set_vcpuaffinity(&ctx, domid, vcpuinfo->vcpuid, - cpumap, physinfo.max_cpu_id + 1) == -1) { + cpumap, physinfo.max_phys_cpus + 1) == -1) { fprintf(stderr, "libxl_list_vcpu failed on vcpu `%u'.\n", vcpuinfo->vcpuid); } } diff -r 3263d0ff9476 tools/python/xen/lowlevel/xc/xc.c --- a/tools/python/xen/lowlevel/xc/xc.c Thu Jul 29 16:53:40 2010 +0100 +++ b/tools/python/xen/lowlevel/xc/xc.c Mon Aug 02 08:27:03 2010 +0200 @@ -241,7 +241,7 @@ static PyObject *pyxc_vcpu_setaffinity(X if ( xc_physinfo(self->xc_handle, &info) != 0 ) return pyxc_error_to_exception(self->xc_handle); - nr_cpus = info.nr_cpus; + nr_cpus = info.max_phys_cpus; size = (nr_cpus + cpumap_size * 8 - 1)/ (cpumap_size * 8); cpumap = malloc(cpumap_size * size); @@ -400,7 +400,7 @@ static PyObject *pyxc_vcpu_getinfo(XcObj if ( xc_physinfo(self->xc_handle, &pinfo) != 0 ) return pyxc_error_to_exception(self->xc_handle); - nr_cpus = pinfo.nr_cpus; + nr_cpus = pinfo.max_phys_cpus; rc = xc_vcpu_getinfo(self->xc_handle, dom, vcpu, &info); if ( rc < 0 ) diff -r 3263d0ff9476 xen/arch/x86/sysctl.c --- a/xen/arch/x86/sysctl.c Thu Jul 29 16:53:40 2010 +0100 +++ b/xen/arch/x86/sysctl.c Mon Aug 02 08:27:03 2010 +0200 @@ -68,6 +68,7 @@ long arch_do_sysctl( pi->free_pages = avail_domheap_pages(); pi->scrub_pages = 0; pi->cpu_khz = cpu_khz; + pi->max_phys_cpus = NR_CPUS; memcpy(pi->hw_cap, boot_cpu_data.x86_capability, NCAPINTS*4); if ( hvm_enabled ) pi->capabilities |= XEN_SYSCTL_PHYSCAP_hvm; diff -r 3263d0ff9476 xen/include/public/sysctl.h --- a/xen/include/public/sysctl.h Thu Jul 29 16:53:40 2010 +0100 +++ b/xen/include/public/sysctl.h Mon Aug 02 08:27:03 2010 +0200 @@ -96,6 +96,7 @@ struct xen_sysctl_physinfo { uint32_t nr_cpus, max_cpu_id; uint32_t nr_nodes, max_node_id; uint32_t cpu_khz; + uint32_t max_phys_cpus; uint64_aligned_t total_pages; uint64_aligned_t free_pages; uint64_aligned_t scrub_pages;