[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] tools: Delete XEN_DOMCTL_disable_migrate
commit baa4d064e91b6d2bcfe400bdf71f83b961e4c28e Author: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> AuthorDate: Tue Feb 11 20:27:15 2020 +0000 Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> CommitDate: Fri Sep 18 20:40:52 2020 +0100 tools: Delete XEN_DOMCTL_disable_migrate It is conceptually wrong for this information to exist in the hypervisor in the first place. Only the toolstack is capable of correctly reasoning about the non-migrateability of guests. This hypercall has only ever existed to control the visibility of the Invariant TSC flag to the guest. Now that we have properly disentanged that and moved ITSC into the guests CPUID policy, delete this hypercall. Furthermore, this fixes a corner case where Xen would override the toolstacks choice of ITSC for a xenstore stubdomain. That said, init-xenstore-domain doesn't currently ask for ITSC, and MiniOS doesn't know what ITSC is either, so nothing actually changes in practice. Bump the DOMCTL_INTERFACE_VERSION for 4.15 Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> Acked-by: Jan Beulich <jbeulich@xxxxxxxx> Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> --- tools/libs/ctrl/include/xenctrl.h | 2 -- tools/libs/ctrl/xc_domain.c | 9 --------- tools/libxl/libxl_dom.c | 6 ------ tools/python/xen/lowlevel/xc/xc.c | 21 --------------------- xen/arch/arm/domctl.c | 4 ---- xen/arch/x86/cpuid.c | 3 ++- xen/arch/x86/domctl.c | 5 ----- xen/common/domain.c | 4 ---- xen/include/public/domctl.h | 10 ++-------- xen/include/xen/sched.h | 2 -- xen/xsm/flask/hooks.c | 1 - xen/xsm/flask/policy/access_vectors | 2 +- 12 files changed, 5 insertions(+), 64 deletions(-) diff --git a/tools/libs/ctrl/include/xenctrl.h b/tools/libs/ctrl/include/xenctrl.h index 0a921a95fa..73e9535fc8 100644 --- a/tools/libs/ctrl/include/xenctrl.h +++ b/tools/libs/ctrl/include/xenctrl.h @@ -1351,8 +1351,6 @@ int xc_domain_get_tsc_info(xc_interface *xch, uint32_t *gtsc_khz, uint32_t *incarnation); -int xc_domain_disable_migrate(xc_interface *xch, uint32_t domid); - int xc_domain_maximum_gpfn(xc_interface *xch, uint32_t domid, xen_pfn_t *gpfns); int xc_domain_nr_gpfns(xc_interface *xch, uint32_t domid, xen_pfn_t *gpfns); diff --git a/tools/libs/ctrl/xc_domain.c b/tools/libs/ctrl/xc_domain.c index 43fab50c06..e7cea4a17d 100644 --- a/tools/libs/ctrl/xc_domain.c +++ b/tools/libs/ctrl/xc_domain.c @@ -815,15 +815,6 @@ int xc_domain_set_time_offset(xc_interface *xch, return do_domctl(xch, &domctl); } -int xc_domain_disable_migrate(xc_interface *xch, uint32_t domid) -{ - DECLARE_DOMCTL; - domctl.cmd = XEN_DOMCTL_disable_migrate; - domctl.domain = domid; - domctl.u.disable_migrate.disable = 1; - return do_domctl(xch, &domctl); -} - int xc_domain_set_tsc_info(xc_interface *xch, uint32_t domid, uint32_t tsc_mode, diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index e2dca64aa1..597a6826d1 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -257,12 +257,6 @@ int libxl__build_pre(libxl__gc *gc, uint32_t domid, return ERROR_FAIL; } - if (libxl_defbool_val(d_config->b_info.disable_migrate) && - xc_domain_disable_migrate(ctx->xch, domid) != 0) { - LOG(ERROR, "Couldn't set nomigrate"); - return ERROR_FAIL; - } - /* * Check if the domain has any CPU or node affinity already. If not, try * to build up the latter via automatic NUMA placement. In fact, in case diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c index 8c7b184f0b..ce123f0409 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -1469,20 +1469,6 @@ static PyObject *pyxc_domain_set_tsc_info(XcObject *self, PyObject *args) return zero; } -static PyObject *pyxc_domain_disable_migrate(XcObject *self, PyObject *args) -{ - uint32_t dom; - - if (!PyArg_ParseTuple(args, "i", &dom)) - return NULL; - - if (xc_domain_disable_migrate(self->xc_handle, dom) != 0) - return pyxc_error_to_exception(self->xc_handle); - - Py_INCREF(zero); - return zero; -} - static PyObject *pyxc_domain_send_trigger(XcObject *self, PyObject *args, PyObject *kwds) @@ -2306,13 +2292,6 @@ static PyMethodDef pyxc_methods[] = { " 1=always emulate 2=never emulate\n" "Returns: [int] 0 on success; -1 on error.\n" }, - { "domain_disable_migrate", - (PyCFunction)pyxc_domain_disable_migrate, - METH_VARARGS, "\n" - "Marks domain as non-migratable AND non-restoreable\n" - " dom [int]: Domain whose TSC mode is being set.\n" - "Returns: [int] 0 on success; -1 on error.\n" }, - { "domain_send_trigger", (PyCFunction)pyxc_domain_send_trigger, METH_VARARGS | METH_KEYWORDS, "\n" diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c index 9da88b8c64..b7d27f37df 100644 --- a/xen/arch/arm/domctl.c +++ b/xen/arch/arm/domctl.c @@ -146,10 +146,6 @@ long arch_do_domctl(struct xen_domctl *domctl, struct domain *d, return 0; } - case XEN_DOMCTL_disable_migrate: - d->disable_migrate = domctl->u.disable_migrate.disable; - return 0; - case XEN_DOMCTL_vuart_op: { int rc; diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c index 23425790e1..dde3e95284 100644 --- a/xen/arch/x86/cpuid.c +++ b/xen/arch/x86/cpuid.c @@ -708,7 +708,8 @@ int init_domain_cpuid_policy(struct domain *d) if ( !p ) return -ENOMEM; - if ( d->disable_migrate ) + /* The hardware domain can't migrate. Give it ITSC if available. */ + if ( is_hardware_domain(d) ) p->extd.itsc = cpu_has_itsc; /* diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 7c644add92..2ee29a0f78 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -1277,11 +1277,6 @@ long arch_do_domctl( break; - case XEN_DOMCTL_disable_migrate: - d->disable_migrate = domctl->u.disable_migrate.disable; - recalculate_cpuid_policy(d); - break; - case XEN_DOMCTL_get_cpu_policy: /* Process the CPUID leaves. */ if ( guest_handle_is_null(domctl->u.cpu_policy.cpuid_policy) ) diff --git a/xen/common/domain.c b/xen/common/domain.c index f0f9c62feb..61ffccde0c 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -371,7 +371,6 @@ struct domain *domain_create(domid_t domid, if ( hardware_domid < 0 || hardware_domid >= DOMID_FIRST_RESERVED ) panic("The value of hardware_dom must be a valid domain ID\n"); - d->disable_migrate = true; old_hwdom = hardware_domain; hardware_domain = d; } @@ -452,9 +451,6 @@ struct domain *domain_create(domid_t domid, watchdog_domain_init(d); init_status |= INIT_watchdog; - if ( is_xenstore_domain(d) ) - d->disable_migrate = true; - d->iomem_caps = rangeset_new(d, "I/O Memory", RANGESETF_prettyprint_hex); d->irq_caps = rangeset_new(d, "Interrupts", 0); if ( !d->iomem_caps || !d->irq_caps ) diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index 9464a9058a..5c5e55ebcb 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -38,7 +38,7 @@ #include "hvm/save.h" #include "memory.h" -#define XEN_DOMCTL_INTERFACE_VERSION 0x00000012 +#define XEN_DOMCTL_INTERFACE_VERSION 0x00000013 /* * NB. xen_domctl.domain is an IN/OUT parameter for this operation. @@ -730,11 +730,6 @@ struct xen_domctl_hvmcontext_partial { XEN_GUEST_HANDLE_64(uint8) buffer; /* OUT: buffer to write record into */ }; -/* XEN_DOMCTL_disable_migrate */ -struct xen_domctl_disable_migrate { - uint32_t disable; /* IN: 1: disable migration and restore */ -}; - /* XEN_DOMCTL_gettscinfo */ /* XEN_DOMCTL_settscinfo */ @@ -1191,7 +1186,7 @@ struct xen_domctl { #define XEN_DOMCTL_gethvmcontext_partial 55 #define XEN_DOMCTL_vm_event_op 56 #define XEN_DOMCTL_mem_sharing_op 57 -#define XEN_DOMCTL_disable_migrate 58 +/* #define XEN_DOMCTL_disable_migrate 58 - Obsolete */ #define XEN_DOMCTL_gettscinfo 59 #define XEN_DOMCTL_settscinfo 60 #define XEN_DOMCTL_getpageframeinfo3 61 @@ -1242,7 +1237,6 @@ struct xen_domctl { struct xen_domctl_ioport_permission ioport_permission; struct xen_domctl_hypercall_init hypercall_init; struct xen_domctl_settimeoffset settimeoffset; - struct xen_domctl_disable_migrate disable_migrate; struct xen_domctl_tsc_info tsc_info; struct xen_domctl_hvmcontext hvmcontext; struct xen_domctl_hvmcontext_partial hvmcontext_partial; diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index ac53519d7f..e9ce43cc9a 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -401,8 +401,6 @@ struct domain bool is_privileged; /* Can this guest access the Xen console? */ bool is_console; - /* Non-migratable and non-restoreable? */ - bool disable_migrate; /* Is this guest being debugged by dom0? */ bool debugger_attached; /* diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index a314bf85ce..fab5d30c3a 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -710,7 +710,6 @@ static int flask_domctl(struct domain *d, int cmd) return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETDEBUGGING); case XEN_DOMCTL_subscribe: - case XEN_DOMCTL_disable_migrate: return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO); case XEN_DOMCTL_set_virq_handler: diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/access_vectors index b87c99ea98..fde5162c7e 100644 --- a/xen/xsm/flask/policy/access_vectors +++ b/xen/xsm/flask/policy/access_vectors @@ -176,7 +176,7 @@ class domain getpodtarget # XENMEM_set_pod_target setpodtarget -# XEN_DOMCTL_subscribe, XEN_DOMCTL_disable_migrate +# XEN_DOMCTL_subscribe set_misc_info # XEN_DOMCTL_set_virq_handler set_virq_handler -- generated by git-patchbot for /home/xen/git/xen.git#master
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |