[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] merge
# HG changeset patch # User Ian Campbell <ian.campbell@xxxxxxxxxxxxx> # Node ID af704c33a9a49b58f4546d00b8d742b08f4e5a51 # Parent 6aeec897da3652159a2d2bbff132a5ea0ed924bb # Parent 0ea9a824c16c2a99fd803bcdc28f165c9de4b072 merge --- tools/libxc/xc_hvm_build.c | 11 ++-- tools/libxc/xc_linux_save.c | 6 -- tools/python/xen/lowlevel/xc/xc.c | 4 - xen/arch/ia64/xen/domain.c | 5 -- xen/arch/x86/shadow2-common.c | 42 ++++++++--------- xen/common/dom0_ops.c | 3 - xen/include/asm-x86/shadow2.h | 10 ++-- xen/include/public/dom0_ops.h | 89 ++++++++++++++++++++++++++------------ 8 files changed, 99 insertions(+), 71 deletions(-) diff -r 6aeec897da36 -r af704c33a9a4 tools/libxc/xc_hvm_build.c --- a/tools/libxc/xc_hvm_build.c Tue Aug 22 18:50:22 2006 +0100 +++ b/tools/libxc/xc_hvm_build.c Tue Aug 22 18:51:02 2006 +0100 @@ -442,13 +442,12 @@ static int xc_hvm_build_internal(int xc_ } /* HVM domains must be put into shadow2 mode at the start of day */ - if ( xc_shadow_control(xc_handle, domid, DOM0_SHADOW2_CONTROL_OP_ENABLE, + if ( xc_shadow_control(xc_handle, domid, DOM0_SHADOW_CONTROL_OP_ENABLE, NULL, 0, NULL, - DOM0_SHADOW2_CONTROL_FLAG_ENABLE - | DOM0_SHADOW2_CONTROL_FLAG_REFCOUNT - | DOM0_SHADOW2_CONTROL_FLAG_TRANSLATE - | DOM0_SHADOW2_CONTROL_FLAG_EXTERNAL, - NULL) ) + DOM0_SHADOW_ENABLE_REFCOUNT | + DOM0_SHADOW_ENABLE_TRANSLATE | + DOM0_SHADOW_ENABLE_EXTERNAL, + NULL) ) { PERROR("Could not enable shadow paging for domain.\n"); goto error_out; diff -r 6aeec897da36 -r af704c33a9a4 tools/libxc/xc_linux_save.c --- a/tools/libxc/xc_linux_save.c Tue Aug 22 18:50:22 2006 +0100 +++ b/tools/libxc/xc_linux_save.c Tue Aug 22 18:51:02 2006 +0100 @@ -346,11 +346,9 @@ static int analysis_phase(int xc_handle, xc_shadow_control(xc_handle, domid, DOM0_SHADOW_CONTROL_OP_PEEK, NULL, 0, NULL, 0, &stats); - DPRINTF("now= %lld faults= %" PRId32 " dirty= %" PRId32 - " dirty_net= %" PRId32 " dirty_block= %" PRId32"\n", + DPRINTF("now= %lld faults= %"PRId32" dirty= %"PRId32"\n", ((now-start)+500)/1000, - stats.fault_count, stats.dirty_count, - stats.dirty_net_count, stats.dirty_block_count); + stats.fault_count, stats.dirty_count); } } diff -r 6aeec897da36 -r af704c33a9a4 tools/python/xen/lowlevel/xc/xc.c --- a/tools/python/xen/lowlevel/xc/xc.c Tue Aug 22 18:50:22 2006 +0100 +++ b/tools/python/xen/lowlevel/xc/xc.c Tue Aug 22 18:51:02 2006 +0100 @@ -709,11 +709,11 @@ static PyObject *pyxc_shadow_mem_control return NULL; if ( mbarg < 0 ) - op = DOM0_SHADOW2_CONTROL_OP_GET_ALLOCATION; + op = DOM0_SHADOW_CONTROL_OP_GET_ALLOCATION; else { mb = mbarg; - op = DOM0_SHADOW2_CONTROL_OP_SET_ALLOCATION; + op = DOM0_SHADOW_CONTROL_OP_SET_ALLOCATION; } if ( xc_shadow_control(xc->xc_handle, dom, op, NULL, 0, &mb, 0, NULL) < 0 ) return PyErr_SetFromErrno(xc_error); diff -r 6aeec897da36 -r af704c33a9a4 xen/arch/ia64/xen/domain.c --- a/xen/arch/ia64/xen/domain.c Tue Aug 22 18:50:22 2006 +0100 +++ b/xen/arch/ia64/xen/domain.c Tue Aug 22 18:51:02 2006 +0100 @@ -653,11 +653,6 @@ int shadow_mode_control(struct domain *d } break; - case DOM0_SHADOW_CONTROL_OP_FLUSH: - atomic64_set(&d->arch.shadow_fault_count, 0); - atomic64_set(&d->arch.shadow_dirty_count, 0); - break; - case DOM0_SHADOW_CONTROL_OP_CLEAN: { int nbr_longs; diff -r 6aeec897da36 -r af704c33a9a4 xen/arch/x86/shadow2-common.c --- a/xen/arch/x86/shadow2-common.c Tue Aug 22 18:50:22 2006 +0100 +++ b/xen/arch/x86/shadow2-common.c Tue Aug 22 18:51:02 2006 +0100 @@ -2481,14 +2481,15 @@ static int shadow2_enable(struct domain unsigned int old_pages; int rv = 0; + mode |= SHM2_enable; + domain_pause(d); shadow2_lock(d); /* Sanity check the arguments */ - if ( d == current->domain - || shadow2_mode_enabled(d) - || !(mode & SHM2_enable) - || ((mode & SHM2_external) && !(mode & SHM2_translate)) ) + if ( (d == current->domain) || + shadow2_mode_enabled(d) || + ((mode & SHM2_external) && !(mode & SHM2_translate)) ) { rv = -EINVAL; goto out; @@ -2957,11 +2958,7 @@ static int shadow2_log_dirty_op(struct d domain_pause(d); shadow2_lock(d); - if ( sc->op == DOM0_SHADOW_CONTROL_OP_CLEAN - || sc->op == DOM0_SHADOW_CONTROL_OP_FLUSH ) - clean = 1; - else - ASSERT(sc->op == DOM0_SHADOW_CONTROL_OP_PEEK); + clean = (sc->op == DOM0_SHADOW_CONTROL_OP_CLEAN); SHADOW2_DEBUG(LOGDIRTY, "log-dirty %s: dom %u faults=%u dirty=%u\n", (clean) ? "clean" : "peek", @@ -3111,25 +3108,27 @@ int shadow2_control_op(struct domain *d, case DOM0_SHADOW_CONTROL_OP_ENABLE_TEST: return shadow2_test_enable(d); - + case DOM0_SHADOW_CONTROL_OP_ENABLE_LOGDIRTY: return shadow2_log_dirty_enable(d); - - case DOM0_SHADOW_CONTROL_OP_FLUSH: + + case DOM0_SHADOW_CONTROL_OP_ENABLE_TRANSLATE: + return shadow2_enable(d, SHM2_refcounts|SHM2_translate); + case DOM0_SHADOW_CONTROL_OP_CLEAN: case DOM0_SHADOW_CONTROL_OP_PEEK: return shadow2_log_dirty_op(d, sc); - - - case DOM0_SHADOW2_CONTROL_OP_ENABLE: - return shadow2_enable(d, sc->mode << SHM2_shift); - - case DOM0_SHADOW2_CONTROL_OP_GET_ALLOCATION: + case DOM0_SHADOW_CONTROL_OP_ENABLE: + if ( sc->mode & DOM0_SHADOW_ENABLE_LOG_DIRTY ) + return shadow2_log_dirty_enable(d); + return shadow2_enable(d, sc->mode << SHM2_shift); + + case DOM0_SHADOW_CONTROL_OP_GET_ALLOCATION: sc->mb = shadow2_get_allocation(d); return 0; - - case DOM0_SHADOW2_CONTROL_OP_SET_ALLOCATION: + + case DOM0_SHADOW_CONTROL_OP_SET_ALLOCATION: rc = shadow2_set_allocation(d, sc->mb, &preempted); if ( preempted ) /* Not finished. Set up to re-run the call. */ @@ -3139,8 +3138,7 @@ int shadow2_control_op(struct domain *d, /* Finished. Return the new allocation */ sc->mb = shadow2_get_allocation(d); return rc; - - + default: SHADOW2_ERROR("Bad shadow op %u\n", sc->op); return -EINVAL; diff -r 6aeec897da36 -r af704c33a9a4 xen/common/dom0_ops.c --- a/xen/common/dom0_ops.c Tue Aug 22 18:50:22 2006 +0100 +++ b/xen/common/dom0_ops.c Tue Aug 22 18:51:02 2006 +0100 @@ -141,7 +141,8 @@ long do_dom0_op(XEN_GUEST_HANDLE(dom0_op if ( copy_from_guest(op, u_dom0_op, 1) ) return -EFAULT; - if ( op->interface_version != DOM0_INTERFACE_VERSION ) + if ( (op->interface_version != DOM0_TOOLS_INTERFACE_VERSION) && + (op->interface_version != DOM0_KERNEL_INTERFACE_VERSION) ) return -EACCES; if ( acm_pre_dom0_op(op, &ssid) ) diff -r 6aeec897da36 -r af704c33a9a4 xen/include/asm-x86/shadow2.h --- a/xen/include/asm-x86/shadow2.h Tue Aug 22 18:50:22 2006 +0100 +++ b/xen/include/asm-x86/shadow2.h Tue Aug 22 18:51:02 2006 +0100 @@ -32,16 +32,16 @@ #define SHM2_shift 10 /* We're in one of the shadow modes */ -#define SHM2_enable (DOM0_SHADOW2_CONTROL_FLAG_ENABLE << SHM2_shift) +#define SHM2_enable (1U << SHM2_shift) /* Refcounts based on shadow tables instead of guest tables */ -#define SHM2_refcounts (DOM0_SHADOW2_CONTROL_FLAG_REFCOUNT << SHM2_shift) +#define SHM2_refcounts (DOM0_SHADOW_ENABLE_REFCOUNT << SHM2_shift) /* Enable log dirty mode */ -#define SHM2_log_dirty (DOM0_SHADOW2_CONTROL_FLAG_LOG_DIRTY << SHM2_shift) +#define SHM2_log_dirty (DOM0_SHADOW_ENABLE_LOG_DIRTY << SHM2_shift) /* Xen does p2m translation, not guest */ -#define SHM2_translate (DOM0_SHADOW2_CONTROL_FLAG_TRANSLATE << SHM2_shift) +#define SHM2_translate (DOM0_SHADOW_ENABLE_TRANSLATE << SHM2_shift) /* Xen does not steal address space from the domain for its own booking; * requires VT or similar mechanisms */ -#define SHM2_external (DOM0_SHADOW2_CONTROL_FLAG_EXTERNAL << SHM2_shift) +#define SHM2_external (DOM0_SHADOW_ENABLE_EXTERNAL << SHM2_shift) #define shadow2_mode_enabled(_d) ((_d)->arch.shadow2.mode) #define shadow2_mode_refcounts(_d) ((_d)->arch.shadow2.mode & SHM2_refcounts) diff -r 6aeec897da36 -r af704c33a9a4 xen/include/public/dom0_ops.h --- a/xen/include/public/dom0_ops.h Tue Aug 22 18:50:22 2006 +0100 +++ b/xen/include/public/dom0_ops.h Tue Aug 22 18:51:02 2006 +0100 @@ -18,8 +18,19 @@ * Make sure you increment the interface version whenever you modify this file! * This makes sure that old versions of dom0 tools will stop working in a * well-defined way (rather than crashing the machine, for instance). - */ -#define DOM0_INTERFACE_VERSION 0x03000001 + * + * Separate kernel from tools as the kernel uses a small subset of the dom0 + * operations and so it is unnecessary to break backward compatibility so + * often. + */ +#define DOM0_TOOLS_INTERFACE_VERSION 0x13000001 +#define DOM0_KERNEL_INTERFACE_VERSION 0x03000001 + +#ifdef __XEN_TOOLS__ +#define DOM0_INTERFACE_VERSION DOM0_TOOLS_INTERFACE_VERSION +#else +#define DOM0_INTERFACE_VERSION DOM0_KERNEL_INTERFACE_VERSION +#endif /************************************************************************/ @@ -253,32 +264,54 @@ DEFINE_XEN_GUEST_HANDLE(dom0_sched_id_t) */ #define DOM0_SHADOW_CONTROL 25 +/* Disable shadow mode. */ #define DOM0_SHADOW_CONTROL_OP_OFF 0 -#define DOM0_SHADOW_CONTROL_OP_ENABLE_TEST 1 -#define DOM0_SHADOW_CONTROL_OP_ENABLE_LOGDIRTY 2 -#define DOM0_SHADOW_CONTROL_OP_ENABLE_TRANSLATE 3 - -#define DOM0_SHADOW_CONTROL_OP_FLUSH 10 /* table ops */ + +/* Enable shadow mode (mode contains ORed DOM0_SHADOW_ENABLE_* flags). */ +#define DOM0_SHADOW_CONTROL_OP_ENABLE 32 + +/* Log-dirty bitmap operations. */ + /* Return the bitmap and clean internal copy for next round. */ #define DOM0_SHADOW_CONTROL_OP_CLEAN 11 + /* Return the bitmap but do not modify internal copy. */ #define DOM0_SHADOW_CONTROL_OP_PEEK 12 -/* Shadow2 operations */ -#define DOM0_SHADOW2_CONTROL_OP_GET_ALLOCATION 30 -#define DOM0_SHADOW2_CONTROL_OP_SET_ALLOCATION 31 -#define DOM0_SHADOW2_CONTROL_OP_ENABLE 32 - -/* Mode flags for Shadow2 enable op */ -#define DOM0_SHADOW2_CONTROL_FLAG_ENABLE (1 << 0) -#define DOM0_SHADOW2_CONTROL_FLAG_REFCOUNT (1 << 1) -#define DOM0_SHADOW2_CONTROL_FLAG_LOG_DIRTY (1 << 2) -#define DOM0_SHADOW2_CONTROL_FLAG_TRANSLATE (1 << 3) -#define DOM0_SHADOW2_CONTROL_FLAG_EXTERNAL (1 << 4) +/* Memory allocation accessors. */ +#define DOM0_SHADOW_CONTROL_OP_GET_ALLOCATION 30 +#define DOM0_SHADOW_CONTROL_OP_SET_ALLOCATION 31 + +/* Legacy enable operations. */ + /* Equiv. to ENABLE with no mode flags. */ +#define DOM0_SHADOW_CONTROL_OP_ENABLE_TEST 1 + /* Equiv. to ENABLE with mode flag ENABLE_LOG_DIRTY. */ +#define DOM0_SHADOW_CONTROL_OP_ENABLE_LOGDIRTY 2 + /* Equiv. to ENABLE with mode flags ENABLE_REFCOUNT and ENABLE_TRANSLATE. */ +#define DOM0_SHADOW_CONTROL_OP_ENABLE_TRANSLATE 3 + +/* Mode flags for DOM0_SHADOW_CONTROL_OP_ENABLE. */ + /* + * Shadow pagetables are refcounted: guest does not use explicit mmu + * operations nor write-protect its pagetables. + */ +#define DOM0_SHADOW_ENABLE_REFCOUNT (1 << 1) + /* + * Log pages in a bitmap as they are dirtied. + * Used for live relocation to determine which pages must be re-sent. + */ +#define DOM0_SHADOW_ENABLE_LOG_DIRTY (1 << 2) + /* + * Automatically translate GPFNs into MFNs. + */ +#define DOM0_SHADOW_ENABLE_TRANSLATE (1 << 3) + /* + * Xen does not steal virtual address space from the guest. + * Requires HVM support. + */ +#define DOM0_SHADOW_ENABLE_EXTERNAL (1 << 4) struct dom0_shadow_control_stats { uint32_t fault_count; uint32_t dirty_count; - uint32_t dirty_net_count; - uint32_t dirty_block_count; }; typedef struct dom0_shadow_control_stats dom0_shadow_control_stats_t; DEFINE_XEN_GUEST_HANDLE(dom0_shadow_control_stats_t); @@ -286,13 +319,17 @@ struct dom0_shadow_control { struct dom0_shadow_control { /* IN variables. */ domid_t domain; - uint32_t op; + uint32_t op; /* DOM0_SHADOW_CONTROL_OP_* */ + + /* OP_ENABLE */ + uint32_t mode; /* DOM0_SHADOW_ENABLE_* */ + + /* OP_GET_ALLOCATION / OP_SET_ALLOCATION */ + uint32_t mb; /* Shadow memory allocation in MB */ + + /* OP_PEEK / OP_CLEAN */ XEN_GUEST_HANDLE(ulong) dirty_bitmap; - /* IN/OUT variables. */ - uint64_t pages; /* size of buffer, updated with actual size */ - uint32_t mb; /* Shadow2 memory allocation in MB */ - uint32_t mode; /* Shadow2 mode to enable */ - /* OUT variables. */ + uint64_t pages; /* Size of buffer. Updated with actual size. */ struct dom0_shadow_control_stats stats; }; typedef struct dom0_shadow_control dom0_shadow_control_t; _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |