view xen/include/xen/domain.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 3929487cdb82
children 3ffdb094c2c0 07befd9cf6d3
line source
2 #ifndef __XEN_DOMAIN_H__
3 #define __XEN_DOMAIN_H__
5 #include <public/xen.h>
7 typedef union {
8 struct vcpu_guest_context *nat;
9 struct compat_vcpu_guest_context *cmp;
10 } vcpu_guest_context_u __attribute__((__transparent_union__));
12 struct vcpu *alloc_vcpu(
13 struct domain *d, unsigned int vcpu_id, unsigned int cpu_id);
14 int boot_vcpu(
15 struct domain *d, int vcpuid, vcpu_guest_context_u ctxt);
16 struct vcpu *alloc_idle_vcpu(unsigned int cpu_id);
17 struct vcpu *alloc_dom0_vcpu0(void);
18 void vcpu_reset(struct vcpu *v);
20 struct xen_domctl_getdomaininfo;
21 void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info);
23 /*
24 * Arch-specifics.
25 */
27 /* Allocate/free a domain structure. */
28 struct domain *alloc_domain_struct(void);
29 void free_domain_struct(struct domain *d);
31 /* Allocate/free a VCPU structure. */
32 struct vcpu *alloc_vcpu_struct(void);
33 void free_vcpu_struct(struct vcpu *v);
35 /*
36 * Initialise/destroy arch-specific details of a VCPU.
37 * - vcpu_initialise() is called after the basic generic fields of the
38 * VCPU structure are initialised. Many operations can be applied to the
39 * VCPU at this point (e.g., vcpu_pause()).
40 * - vcpu_destroy() is called only if vcpu_initialise() previously succeeded.
41 */
42 int vcpu_initialise(struct vcpu *v);
43 void vcpu_destroy(struct vcpu *v);
45 int arch_domain_create(struct domain *d, unsigned int domcr_flags);
47 void arch_domain_destroy(struct domain *d);
49 int arch_set_info_guest(struct vcpu *, vcpu_guest_context_u);
50 void arch_get_info_guest(struct vcpu *, vcpu_guest_context_u);
52 int domain_relinquish_resources(struct domain *d);
54 void dump_pageframe_info(struct domain *d);
56 void arch_dump_vcpu_info(struct vcpu *v);
58 void arch_dump_domain_info(struct domain *d);
60 void arch_vcpu_reset(struct vcpu *v);
62 bool_t domctl_lock_acquire(void);
63 void domctl_lock_release(void);
65 extern unsigned int xen_processor_pmbits;
67 #endif /* __XEN_DOMAIN_H__ */