# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID cfb1136ee8f73a07d0c6fed9dc6f4084d592c129
# Parent 4ff83eddd1f65e64610f563fbd128e953a12d4e8
[XEN] Remove VGCF_hvm_guest, replace with XEN_DOMINF_hvm_guest.
Rename DOMFLAGS_* to XEN_DOMINF_*.
Clean up tools to deal with flags changes.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
tools/libxc/xc_core.c | 2 -
tools/libxc/xc_domain.c | 18 ++++++++------
tools/libxc/xc_hvm_build.c | 1
tools/libxc/xc_private.h | 5 ++++
tools/libxc/xc_ptrace.c | 29 ++++++++++++-----------
tools/libxc/xc_ptrace_core.c | 24 ++++++++++---------
tools/libxc/xenctrl.h | 21 ++++-------------
tools/python/xen/lowlevel/xc/xc.c | 3 +-
tools/xenstat/libxenstat/src/xenstat.c | 20 ++++++++--------
xen/arch/x86/domain.c | 4 ---
xen/arch/x86/domctl.c | 2 -
xen/common/domctl.c | 24 +++++++++++--------
xen/include/asm-x86/hvm/support.h | 3 --
xen/include/public/arch-x86_32.h | 3 --
xen/include/public/arch-x86_64.h | 3 --
xen/include/public/domctl.h | 40 +++++++++++++++++++++++----------
xen/include/xen/sched.h | 3 ++
17 files changed, 106 insertions(+), 99 deletions(-)
diff -r 4ff83eddd1f6 -r cfb1136ee8f7 tools/libxc/xc_core.c
--- a/tools/libxc/xc_core.c Fri Nov 03 10:41:20 2006 +0000
+++ b/tools/libxc/xc_core.c Fri Nov 03 10:52:29 2006 +0000
@@ -62,7 +62,7 @@ xc_domain_dumpcore_via_callback(int xc_h
nr_pages = info.nr_pages;
- header.xch_magic = XC_CORE_MAGIC;
+ header.xch_magic = info.hvm ? XC_CORE_MAGIC_HVM : XC_CORE_MAGIC;
header.xch_nr_vcpus = nr_vcpus;
header.xch_nr_pages = nr_pages;
header.xch_ctxt_offset = sizeof(struct xc_core_header);
diff -r 4ff83eddd1f6 -r cfb1136ee8f7 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c Fri Nov 03 10:41:20 2006 +0000
+++ b/tools/libxc/xc_domain.c Fri Nov 03 10:52:29 2006 +0000
@@ -171,15 +171,16 @@ int xc_domain_getinfo(int xc_handle,
break;
info->domid = (uint16_t)domctl.domain;
- info->dying = !!(domctl.u.getdomaininfo.flags & DOMFLAGS_DYING);
- info->shutdown = !!(domctl.u.getdomaininfo.flags & DOMFLAGS_SHUTDOWN);
- info->paused = !!(domctl.u.getdomaininfo.flags & DOMFLAGS_PAUSED);
- info->blocked = !!(domctl.u.getdomaininfo.flags & DOMFLAGS_BLOCKED);
- info->running = !!(domctl.u.getdomaininfo.flags & DOMFLAGS_RUNNING);
+ info->dying = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_dying);
+ info->shutdown = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_shutdown);
+ info->paused = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_paused);
+ info->blocked = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_blocked);
+ info->running = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_running);
+ info->hvm = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_hvm_guest);
info->shutdown_reason =
- (domctl.u.getdomaininfo.flags>>DOMFLAGS_SHUTDOWNSHIFT) &
- DOMFLAGS_SHUTDOWNMASK;
+ (domctl.u.getdomaininfo.flags>>XEN_DOMINF_shutdownshift) &
+ XEN_DOMINF_shutdownmask;
if ( info->shutdown && (info->shutdown_reason == SHUTDOWN_crash) )
{
@@ -202,7 +203,8 @@ int xc_domain_getinfo(int xc_handle,
info++;
}
- if( !nr_doms ) return rc;
+ if ( nr_doms == 0 )
+ return rc;
return nr_doms;
}
diff -r 4ff83eddd1f6 -r cfb1136ee8f7 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c Fri Nov 03 10:41:20 2006 +0000
+++ b/tools/libxc/xc_hvm_build.c Fri Nov 03 10:52:29 2006 +0000
@@ -337,7 +337,6 @@ static int xc_hvm_build_internal(int xc_
}
memset(ctxt, 0, sizeof(*ctxt));
- ctxt->flags = VGCF_HVM_GUEST;
if ( setup_guest(xc_handle, domid, memsize, image, image_size,
ctxt, domctl.u.getdomaininfo.shared_info_frame,
diff -r 4ff83eddd1f6 -r cfb1136ee8f7 tools/libxc/xc_private.h
--- a/tools/libxc/xc_private.h Fri Nov 03 10:41:20 2006 +0000
+++ b/tools/libxc/xc_private.h Fri Nov 03 10:52:29 2006 +0000
@@ -158,4 +158,9 @@ int xc_map_foreign_ranges(int xc_handle,
int xc_map_foreign_ranges(int xc_handle, uint32_t dom,
privcmd_mmap_entry_t *entries, int nr);
+void *map_domain_va_core(unsigned long domfd, int cpu, void *guest_va,
+ vcpu_guest_context_t *ctxt);
+int xc_waitdomain_core(int xc_handle, int domain, int *status,
+ int options, vcpu_guest_context_t *ctxt);
+
#endif /* __XC_PRIVATE_H__ */
diff -r 4ff83eddd1f6 -r cfb1136ee8f7 tools/libxc/xc_ptrace.c
--- a/tools/libxc/xc_ptrace.c Fri Nov 03 10:41:20 2006 +0000
+++ b/tools/libxc/xc_ptrace.c Fri Nov 03 10:52:29 2006 +0000
@@ -36,8 +36,9 @@ static char *ptrace_names[] = {
};
#endif
-static int current_domid = -1;
-static int current_isfile;
+static int current_domid = -1;
+static int current_isfile;
+static int current_is_hvm;
static uint64_t online_cpumap;
static uint64_t regs_valid;
@@ -45,7 +46,6 @@ static vcpu_guest_context_t ctxt[MAX
extern int ffsll(long long int);
#define FOREACH_CPU(cpumap, i) for ( cpumap = online_cpumap; (i =
ffsll(cpumap)); cpumap &= ~(1 << (index - 1)) )
-
static int
fetch_regs(int xc_handle, int cpu, int *online)
@@ -172,7 +172,7 @@ to_ma(int cpu,
{
unsigned long maddr = in_addr;
- if ( (ctxt[cpu].flags & VGCF_HVM_GUEST) && paging_enabled(&ctxt[cpu]) )
+ if ( current_is_hvm && paging_enabled(&ctxt[cpu]) )
maddr = page_array[maddr >> PAGE_SHIFT] << PAGE_SHIFT;
return maddr;
}
@@ -443,7 +443,7 @@ __xc_waitdomain(
goto done;
}
- if ( !(domctl.u.getdomaininfo.flags & DOMFLAGS_PAUSED) )
+ if ( !(domctl.u.getdomaininfo.flags & XEN_DOMINF_paused) )
{
nanosleep(&ts,NULL);
goto retry;
@@ -482,11 +482,11 @@ xc_ptrace(
case PTRACE_PEEKTEXT:
case PTRACE_PEEKDATA:
if (current_isfile)
- guest_va = (unsigned long *)map_domain_va_core(current_domid,
- cpu, addr, ctxt);
+ guest_va = (unsigned long *)map_domain_va_core(
+ current_domid, cpu, addr, ctxt);
else
- guest_va = (unsigned long *)map_domain_va(xc_handle,
- cpu, addr, PROT_READ);
+ guest_va = (unsigned long *)map_domain_va(
+ xc_handle, cpu, addr, PROT_READ);
if ( guest_va == NULL )
goto out_error;
retval = *guest_va;
@@ -496,11 +496,11 @@ xc_ptrace(
case PTRACE_POKEDATA:
/* XXX assume that all CPUs have the same address space */
if (current_isfile)
- guest_va = (unsigned long *)map_domain_va_core(current_domid,
- cpu, addr, ctxt);
+ guest_va = (unsigned long *)map_domain_va_core(
+ current_domid, cpu, addr, ctxt);
else
- guest_va = (unsigned long *)map_domain_va(xc_handle,
- cpu, addr, PROT_READ|PROT_WRITE);
+ guest_va = (unsigned long *)map_domain_va(
+ xc_handle, cpu, addr, PROT_READ|PROT_WRITE);
if ( guest_va == NULL )
goto out_error;
*guest_va = (unsigned long)data;
@@ -590,10 +590,11 @@ xc_ptrace(
retval = do_domctl(xc_handle, &domctl);
if ( retval || (domctl.domain != current_domid) )
goto out_error_domctl;
- if ( domctl.u.getdomaininfo.flags & DOMFLAGS_PAUSED )
+ if ( domctl.u.getdomaininfo.flags & XEN_DOMINF_paused )
IPRINTF("domain currently paused\n");
else if ((retval = xc_domain_pause(xc_handle, current_domid)))
goto out_error_domctl;
+ current_is_hvm = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_hvm_guest);
domctl.cmd = XEN_DOMCTL_setdebugging;
domctl.domain = current_domid;
domctl.u.setdebugging.enable = 1;
diff -r 4ff83eddd1f6 -r cfb1136ee8f7 tools/libxc/xc_ptrace_core.c
--- a/tools/libxc/xc_ptrace_core.c Fri Nov 03 10:41:20 2006 +0000
+++ b/tools/libxc/xc_ptrace_core.c Fri Nov 03 10:52:29 2006 +0000
@@ -7,6 +7,7 @@
/* XXX application state */
+static int current_is_hvm = 0;
static long nr_pages = 0;
static unsigned long *p2m_array = NULL;
static unsigned long *m2p_array = NULL;
@@ -24,8 +25,8 @@ map_mtop_offset(unsigned long ma)
void *
-map_domain_va_core(unsigned long domfd, int cpu, void * guest_va,
- vcpu_guest_context_t *ctxt)
+map_domain_va_core(unsigned long domfd, int cpu, void *guest_va,
+ vcpu_guest_context_t *ctxt)
{
unsigned long pde, page;
unsigned long va = (unsigned long)guest_va;
@@ -55,7 +56,7 @@ map_domain_va_core(unsigned long domfd,
}
if ((pde = cr3_virt[cpu][l2_table_offset_i386(va)]) == 0) /* logical
address */
return NULL;
- if (ctxt[cpu].flags & VGCF_HVM_GUEST)
+ if (current_is_hvm)
pde = p2m_array[pde >> PAGE_SHIFT] << PAGE_SHIFT;
if (pde != pde_phys[cpu])
{
@@ -71,7 +72,7 @@ map_domain_va_core(unsigned long domfd,
}
if ((page = pde_virt[cpu][l1_table_offset_i386(va)]) == 0) /* logical
address */
return NULL;
- if (ctxt[cpu].flags & VGCF_HVM_GUEST)
+ if (current_is_hvm)
page = p2m_array[page >> PAGE_SHIFT] << PAGE_SHIFT;
if (page != page_phys[cpu])
{
@@ -104,17 +105,18 @@ xc_waitdomain_core(
int i;
xc_core_header_t header;
- if (nr_pages == 0)
+ if ( nr_pages == 0 )
{
-
if (read(domfd, &header, sizeof(header)) != sizeof(header))
return -1;
- if (header.xch_magic != XC_CORE_MAGIC) {
- IPRINTF("Magic number missmatch: 0x%08x (file) != "
- " 0x%08x (code)\n", header.xch_magic,
- XC_CORE_MAGIC);
- return -1;
+ current_is_hvm = (header.xch_magic == XC_CORE_MAGIC_HVM);
+ if ( !current_is_hvm && (header.xch_magic != XC_CORE_MAGIC) )
+ {
+ IPRINTF("Magic number missmatch: 0x%08x (file) != "
+ " 0x%08x (code)\n", header.xch_magic,
+ XC_CORE_MAGIC);
+ return -1;
}
nr_pages = header.xch_nr_pages;
diff -r 4ff83eddd1f6 -r cfb1136ee8f7 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h Fri Nov 03 10:41:20 2006 +0000
+++ b/tools/libxc/xenctrl.h Fri Nov 03 10:52:29 2006 +0000
@@ -113,25 +113,13 @@ typedef struct xc_core_header {
unsigned int xch_pages_offset;
} xc_core_header_t;
-#define XC_CORE_MAGIC 0xF00FEBED
+#define XC_CORE_MAGIC 0xF00FEBED
+#define XC_CORE_MAGIC_HVM 0xF00FEBEE
#ifdef __linux__
#include <sys/ptrace.h>
#include <thread_db.h>
-
-void * map_domain_va_core(
- unsigned long domfd,
- int cpu,
- void *guest_va,
- vcpu_guest_context_t *ctxt);
-
-int xc_waitdomain_core(
- int xc_handle,
- int domain,
- int *status,
- int options,
- vcpu_guest_context_t *ctxt);
typedef void (*thr_ev_handler_t)(long);
@@ -158,11 +146,12 @@ int xc_waitdomain(
* DOMAIN MANAGEMENT FUNCTIONS
*/
-typedef struct {
+typedef struct xc_dominfo {
uint32_t domid;
uint32_t ssidref;
unsigned int dying:1, crashed:1, shutdown:1,
- paused:1, blocked:1, running:1;
+ paused:1, blocked:1, running:1,
+ hvm:1;
unsigned int shutdown_reason; /* only meaningful if shutdown==1 */
unsigned long nr_pages;
unsigned long shared_info_frame;
diff -r 4ff83eddd1f6 -r cfb1136ee8f7 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Fri Nov 03 10:41:20 2006 +0000
+++ b/tools/python/xen/lowlevel/xc/xc.c Fri Nov 03 10:52:29 2006 +0000
@@ -257,11 +257,12 @@ static PyObject *pyxc_domain_getinfo(XcO
PyObject *pyhandle = PyList_New(sizeof(xen_domain_handle_t));
for ( j = 0; j < sizeof(xen_domain_handle_t); j++ )
PyList_SetItem(pyhandle, j, PyInt_FromLong(info[i].handle[j]));
- info_dict = Py_BuildValue("{s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i"
+ info_dict = Py_BuildValue("{s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i,s:i"
",s:l,s:L,s:l,s:i,s:i}",
"domid", info[i].domid,
"online_vcpus", info[i].nr_online_vcpus,
"max_vcpu_id", info[i].max_vcpu_id,
+ "hvm", info[i].hvm,
"dying", info[i].dying,
"crashed", info[i].crashed,
"shutdown", info[i].shutdown,
diff -r 4ff83eddd1f6 -r cfb1136ee8f7 tools/xenstat/libxenstat/src/xenstat.c
--- a/tools/xenstat/libxenstat/src/xenstat.c Fri Nov 03 10:41:20 2006 +0000
+++ b/tools/xenstat/libxenstat/src/xenstat.c Fri Nov 03 10:52:29 2006 +0000
@@ -449,36 +449,36 @@ unsigned int xenstat_domain_ssid(xenstat
/* Get domain states */
unsigned int xenstat_domain_dying(xenstat_domain * domain)
{
- return (domain->state & DOMFLAGS_DYING) == DOMFLAGS_DYING;
+ return (domain->state & XEN_DOMINF_dying) == XEN_DOMINF_dying;
}
unsigned int xenstat_domain_crashed(xenstat_domain * domain)
{
- return ((domain->state & DOMFLAGS_SHUTDOWN) == DOMFLAGS_SHUTDOWN)
- && (((domain->state >> DOMFLAGS_SHUTDOWNSHIFT)
- & DOMFLAGS_SHUTDOWNMASK) == SHUTDOWN_crash);
+ return ((domain->state & XEN_DOMINF_shutdown) == XEN_DOMINF_shutdown)
+ && (((domain->state >> XEN_DOMINF_shutdownshift)
+ & XEN_DOMINF_shutdownmask) == SHUTDOWN_crash);
}
unsigned int xenstat_domain_shutdown(xenstat_domain * domain)
{
- return ((domain->state & DOMFLAGS_SHUTDOWN) == DOMFLAGS_SHUTDOWN)
- && (((domain->state >> DOMFLAGS_SHUTDOWNSHIFT)
- & DOMFLAGS_SHUTDOWNMASK) != SHUTDOWN_crash);
+ return ((domain->state & XEN_DOMINF_shutdown) == XEN_DOMINF_shutdown)
+ && (((domain->state >> XEN_DOMINF_shutdownshift)
+ & XEN_DOMINF_shutdownmask) != SHUTDOWN_crash);
}
unsigned int xenstat_domain_paused(xenstat_domain * domain)
{
- return (domain->state & DOMFLAGS_PAUSED) == DOMFLAGS_PAUSED;
+ return (domain->state & XEN_DOMINF_paused) == XEN_DOMINF_paused;
}
unsigned int xenstat_domain_blocked(xenstat_domain * domain)
{
- return (domain->state & DOMFLAGS_BLOCKED) == DOMFLAGS_BLOCKED;
+ return (domain->state & XEN_DOMINF_blocked) == XEN_DOMINF_blocked;
}
unsigned int xenstat_domain_running(xenstat_domain * domain)
{
- return (domain->state & DOMFLAGS_RUNNING) == DOMFLAGS_RUNNING;
+ return (domain->state & XEN_DOMINF_running) == XEN_DOMINF_running;
}
/* Get the number of networks for a given domain */
diff -r 4ff83eddd1f6 -r cfb1136ee8f7 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c Fri Nov 03 10:41:20 2006 +0000
+++ b/xen/arch/x86/domain.c Fri Nov 03 10:52:29 2006 +0000
@@ -286,10 +286,6 @@ int arch_set_info_guest(
unsigned long cr3_pfn = INVALID_MFN;
int i, rc;
- if ( !!(c->flags & VGCF_hvm_guest) != is_hvm_vcpu(v) )
- return -EINVAL;
- c->flags &= ~VGCF_hvm_guest;
-
if ( !is_hvm_vcpu(v) )
{
fixup_guest_stack_selector(c->user_regs.ss);
diff -r 4ff83eddd1f6 -r cfb1136ee8f7 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c Fri Nov 03 10:41:20 2006 +0000
+++ b/xen/arch/x86/domctl.c Fri Nov 03 10:52:29 2006 +0000
@@ -310,8 +310,6 @@ void arch_getdomaininfo_ctxt(
c->flags |= VGCF_i387_valid;
if ( guest_kernel_mode(v, &v->arch.guest_context.user_regs) )
c->flags |= VGCF_in_kernel;
- if ( is_hvm_vcpu(v) )
- c->flags |= VGCF_hvm_guest;
c->ctrlreg[3] = xen_pfn_to_cr3(pagetable_get_pfn(v->arch.guest_table));
diff -r 4ff83eddd1f6 -r cfb1136ee8f7 xen/common/domctl.c
--- a/xen/common/domctl.c Fri Nov 03 10:41:20 2006 +0000
+++ b/xen/common/domctl.c Fri Nov 03 10:52:29 2006 +0000
@@ -83,7 +83,7 @@ void getdomaininfo(struct domain *d, str
{
struct vcpu *v;
u64 cpu_time = 0;
- int flags = DOMFLAGS_BLOCKED;
+ int flags = XEN_DOMINF_blocked;
struct vcpu_runstate_info runstate;
info->domain = d->domain_id;
@@ -93,16 +93,17 @@ void getdomaininfo(struct domain *d, str
* - domain is marked as blocked only if all its vcpus are blocked
* - domain is marked as running if any of its vcpus is running
*/
- for_each_vcpu ( d, v ) {
+ for_each_vcpu ( d, v )
+ {
vcpu_runstate_get(v, &runstate);
cpu_time += runstate.time[RUNSTATE_running];
info->max_vcpu_id = v->vcpu_id;
if ( !test_bit(_VCPUF_down, &v->vcpu_flags) )
{
if ( !(v->vcpu_flags & VCPUF_blocked) )
- flags &= ~DOMFLAGS_BLOCKED;
+ flags &= ~XEN_DOMINF_blocked;
if ( v->vcpu_flags & VCPUF_running )
- flags |= DOMFLAGS_RUNNING;
+ flags |= XEN_DOMINF_running;
info->nr_online_vcpus++;
}
}
@@ -110,12 +111,15 @@ void getdomaininfo(struct domain *d, str
info->cpu_time = cpu_time;
info->flags = flags |
- ((d->domain_flags & DOMF_dying) ? DOMFLAGS_DYING : 0) |
- ((d->domain_flags & DOMF_shutdown) ? DOMFLAGS_SHUTDOWN : 0) |
- ((d->domain_flags & DOMF_ctrl_pause) ? DOMFLAGS_PAUSED : 0) |
- d->shutdown_code << DOMFLAGS_SHUTDOWNSHIFT;
-
- if (d->ssid != NULL)
+ ((d->domain_flags & DOMF_dying) ? XEN_DOMINF_dying : 0) |
+ ((d->domain_flags & DOMF_shutdown) ? XEN_DOMINF_shutdown : 0) |
+ ((d->domain_flags & DOMF_ctrl_pause) ? XEN_DOMINF_paused : 0) |
+ d->shutdown_code << XEN_DOMINF_shutdownshift;
+
+ if ( is_hvm_domain(d) )
+ info->flags |= XEN_DOMINF_hvm_guest;
+
+ if ( d->ssid != NULL )
info->ssidref = ((struct acm_ssid_domain *)d->ssid)->ssidref;
else
info->ssidref = ACM_DEFAULT_SSID;
diff -r 4ff83eddd1f6 -r cfb1136ee8f7 xen/include/asm-x86/hvm/support.h
--- a/xen/include/asm-x86/hvm/support.h Fri Nov 03 10:41:20 2006 +0000
+++ b/xen/include/asm-x86/hvm/support.h Fri Nov 03 10:52:29 2006 +0000
@@ -31,9 +31,6 @@
#else
#define HVM_DEBUG 1
#endif
-
-#define is_hvm_domain(d) ((d)->is_hvm)
-#define is_hvm_vcpu(v) (is_hvm_domain(v->domain))
static inline shared_iopage_t *get_sp(struct domain *d)
{
diff -r 4ff83eddd1f6 -r cfb1136ee8f7 xen/include/public/arch-x86_32.h
--- a/xen/include/public/arch-x86_32.h Fri Nov 03 10:41:20 2006 +0000
+++ b/xen/include/public/arch-x86_32.h Fri Nov 03 10:52:29 2006 +0000
@@ -172,12 +172,9 @@ struct vcpu_guest_context {
/* FPU registers come first so they can be aligned for FXSAVE/FXRSTOR. */
struct { char x[512]; } fpu_ctxt; /* User-level FPU registers */
#define VGCF_I387_VALID (1<<0)
-#define VGCF_HVM_GUEST (1<<1)
#define VGCF_IN_KERNEL (1<<2)
#define _VGCF_i387_valid 0
#define VGCF_i387_valid (1<<_VGCF_i387_valid)
-#define _VGCF_hvm_guest 1
-#define VGCF_hvm_guest (1<<_VGCF_hvm_guest)
#define _VGCF_in_kernel 2
#define VGCF_in_kernel (1<<_VGCF_in_kernel)
#define _VGCF_failsafe_disables_events 3
diff -r 4ff83eddd1f6 -r cfb1136ee8f7 xen/include/public/arch-x86_64.h
--- a/xen/include/public/arch-x86_64.h Fri Nov 03 10:41:20 2006 +0000
+++ b/xen/include/public/arch-x86_64.h Fri Nov 03 10:52:29 2006 +0000
@@ -245,12 +245,9 @@ struct vcpu_guest_context {
/* FPU registers come first so they can be aligned for FXSAVE/FXRSTOR. */
struct { char x[512]; } fpu_ctxt; /* User-level FPU registers */
#define VGCF_I387_VALID (1<<0)
-#define VGCF_HVM_GUEST (1<<1)
#define VGCF_IN_KERNEL (1<<2)
#define _VGCF_i387_valid 0
#define VGCF_i387_valid (1<<_VGCF_i387_valid)
-#define _VGCF_hvm_guest 1
-#define VGCF_hvm_guest (1<<_VGCF_hvm_guest)
#define _VGCF_in_kernel 2
#define VGCF_in_kernel (1<<_VGCF_in_kernel)
#define _VGCF_failsafe_disables_events 3
diff -r 4ff83eddd1f6 -r cfb1136ee8f7 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h Fri Nov 03 10:41:20 2006 +0000
+++ b/xen/include/public/domctl.h Fri Nov 03 10:52:29 2006 +0000
@@ -32,6 +32,7 @@ struct xen_domctl_createdomain {
/* IN parameters */
uint32_t ssidref;
xen_domain_handle_t handle;
+ /* Is this an HVM guest (as opposed to a PV guest)? */
#define _XEN_DOMCTL_CDF_hvm_guest 0
#define XEN_DOMCTL_CDF_hvm_guest (1U<<_XEN_DOMCTL_CDF_hvm_guest)
uint32_t flags;
@@ -47,22 +48,37 @@ struct xen_domctl_getdomaininfo {
struct xen_domctl_getdomaininfo {
/* OUT variables. */
domid_t domain; /* Also echoed in domctl.domain */
-#define DOMFLAGS_DYING (1<<0) /* Domain is scheduled to die. */
-#define DOMFLAGS_SHUTDOWN (1<<2) /* The guest OS has shut down. */
-#define DOMFLAGS_PAUSED (1<<3) /* Currently paused by control software. */
-#define DOMFLAGS_BLOCKED (1<<4) /* Currently blocked pending an event. */
-#define DOMFLAGS_RUNNING (1<<5) /* Domain is currently running. */
-#define DOMFLAGS_CPUMASK 255 /* CPU to which this domain is bound. */
-#define DOMFLAGS_CPUSHIFT 8
-#define DOMFLAGS_SHUTDOWNMASK 255 /* DOMFLAGS_SHUTDOWN guest-supplied code. */
-#define DOMFLAGS_SHUTDOWNSHIFT 16
- uint32_t flags;
+ /* Domain is scheduled to die. */
+#define _XEN_DOMINF_dying 0
+#define XEN_DOMINF_dying (1U<<_XEN_DOMINF_dying)
+ /* Domain is an HVM guest (as opposed to a PV guest). */
+#define _XEN_DOMINF_hvm_guest 1
+#define XEN_DOMINF_hvm_guest (1U<<_XEN_DOMINF_hvm_guest)
+ /* The guest OS has shut down. */
+#define _XEN_DOMINF_shutdown 2
+#define XEN_DOMINF_shutdown (1U<<_XEN_DOMINF_shutdown)
+ /* Currently paused by control software. */
+#define _XEN_DOMINF_paused 3
+#define XEN_DOMINF_paused (1U<<_XEN_DOMINF_paused)
+ /* Currently blocked pending an event. */
+#define _XEN_DOMINF_blocked 4
+#define XEN_DOMINF_blocked (1U<<_XEN_DOMINF_blocked)
+ /* Domain is currently running. */
+#define _XEN_DOMINF_running 5
+#define XEN_DOMINF_running (1U<<_XEN_DOMINF_running)
+ /* CPU to which this domain is bound. */
+#define XEN_DOMINF_cpumask 255
+#define XEN_DOMINF_cpushift 8
+ /* XEN_DOMINF_shutdown guest-supplied code. */
+#define XEN_DOMINF_shutdownmask 255
+#define XEN_DOMINF_shutdownshift 16
+ uint32_t flags; /* XEN_DOMINF_* */
uint64_t tot_pages;
uint64_t max_pages;
uint64_t shared_info_frame; /* MFN of shared_info struct */
uint64_t cpu_time;
- uint32_t nr_online_vcpus; /* Number of VCPUs currently online. */
- uint32_t max_vcpu_id; /* Maximum VCPUID in use by this domain. */
+ uint32_t nr_online_vcpus; /* Number of VCPUs currently online. */
+ uint32_t max_vcpu_id; /* Maximum VCPUID in use by this domain. */
uint32_t ssidref;
xen_domain_handle_t handle;
};
diff -r 4ff83eddd1f6 -r cfb1136ee8f7 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h Fri Nov 03 10:41:20 2006 +0000
+++ b/xen/include/xen/sched.h Fri Nov 03 10:52:29 2006 +0000
@@ -461,6 +461,9 @@ static inline void vcpu_unblock(struct v
#define VM_ASSIST(_d,_t) (test_bit((_t), &(_d)->vm_assist))
+#define is_hvm_domain(d) ((d)->is_hvm)
+#define is_hvm_vcpu(v) (is_hvm_domain(v->domain))
+
#endif /* __SCHED_H__ */
/*
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|