view xen/include/xen/shared.h @ 19826:2f9e1348aa98

x86_64: allow more vCPU-s per guest

Since the shared info layout is fixed, guests are required to use
VCPUOP_register_vcpu_info prior to booting any vCPU beyond the
traditional limit of 32.

MAX_VIRT_CPUS, being an implemetation detail of the hypervisor, is no
longer being exposed in the public headers.

The tools changes are clearly incomplete (and done only so things
build again), and the current state of the tools (using scalar
variables all over the place to represent vCPU bitmaps) very likely
doesn't permit booting DomU-s with more than the traditional number of
vCPU-s. Testing of the extended functionality was done with Dom0 (96
vCPU-s, as well as 128 vCPU-s out of which the kernel elected - by way
of a simple kernel side patch - to use only some, resulting in a

ia64 changes only to make things build, and build-tested only (and the
tools part only as far as the build would go without encountering
unrelated problems in the blktap code).

Signed-off-by: Jan Beulich <>
author Keir Fraser <>
date Thu Jun 18 10:14:16 2009 +0100 (2009-06-18)
parents af33f2054f47
children 809b20f066fb
line source
1 #ifndef __XEN_SHARED_H__
2 #define __XEN_SHARED_H__
4 #include <xen/config.h>
8 #include <compat/xen.h>
10 typedef union {
11 struct shared_info native;
12 struct compat_shared_info compat;
13 } shared_info_t;
15 /*
16 * Compat field is never larger than native field, so cast to that as it
17 * is the largest memory range it is safe for the caller to modify without
18 * further discrimination between compat and native cases.
19 */
20 #define __shared_info(d, s, field) \
21 (*(!has_32bit_shinfo(d) ? \
22 (typeof(&(s)->compat.field))&(s)->native.field : \
23 (typeof(&(s)->compat.field))&(s)->compat.field))
25 typedef union {
26 struct vcpu_info native;
27 struct compat_vcpu_info compat;
28 } vcpu_info_t;
30 /* As above, cast to compat field type. */
31 #define __vcpu_info(v, i, field) \
32 (*(!has_32bit_shinfo((v)->domain) ? \
33 (typeof(&(i)->compat.field))&(i)->native.field : \
34 (typeof(&(i)->compat.field))&(i)->compat.field))
36 #else
38 typedef struct shared_info shared_info_t;
39 #define __shared_info(d, s, field) ((s)->field)
41 typedef struct vcpu_info vcpu_info_t;
42 #define __vcpu_info(v, i, field) ((i)->field)
44 #endif
46 #define shared_info(d, field) __shared_info(d, (d)->shared_info, field)
47 #define vcpu_info(v, field) __vcpu_info(v, (v)->vcpu_info, field)
49 #endif /* __XEN_SHARED_H__ */