]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
xen: Drop XEN_DOMCTL_suppress_spurious_page_faults
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 7 Aug 2019 11:49:37 +0000 (12:49 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 28 Aug 2019 17:28:31 +0000 (18:28 +0100)
This functionality is obsolete.  It was introduced by c/s 39407bed9c0 into
Xend, but never exposed in libxl.

While not explicitly limited to PV guests, this is PV-only by virtue of its
position in the pagefault handler.

Looking though the XenServer templates, this was used to work around bugs in
the 32bit RHEL/CentOS 4.{5..7} kernels (fixed in 4.8).  RHEL 4 as a major
version when out if support in 2017.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Wei Liu <wl@xen.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
tools/libxc/include/xenctrl.h
tools/libxc/xc_domain.c
tools/python/xen/lowlevel/xc/xc.c
xen/arch/x86/domctl.c
xen/arch/x86/traps.c
xen/include/asm-x86/domain.h
xen/include/public/domctl.h
xen/xsm/flask/hooks.c
xen/xsm/flask/policy/access_vectors

index 0ff6ed9e702fcfe2908dde3b7b70db8786e2954e..a36896034a88b30760393d5913874747697d71e3 100644 (file)
@@ -1787,9 +1787,6 @@ int xc_domain_set_machine_address_size(xc_interface *xch,
 int xc_domain_get_machine_address_size(xc_interface *xch,
                                       uint32_t domid);
 
-int xc_domain_suppress_spurious_page_faults(xc_interface *xch,
-                                         uint32_t domid);
-
 /* Set the target domain */
 int xc_domain_set_target(xc_interface *xch,
                          uint32_t domid,
index 05d771f2ceef6f2a67938d2f80c9c335068e6279..64ca513aaecc1c73b7a1c0e7c2d85f2f65b0a6ff 100644 (file)
@@ -2190,18 +2190,6 @@ int xc_domain_get_machine_address_size(xc_interface *xch, uint32_t domid)
     return rc == 0 ? domctl.u.address_size.size : rc;
 }
 
-int xc_domain_suppress_spurious_page_faults(xc_interface *xc, uint32_t domid)
-{
-    DECLARE_DOMCTL;
-
-    memset(&domctl, 0, sizeof(domctl));
-    domctl.domain = domid;
-    domctl.cmd    = XEN_DOMCTL_suppress_spurious_page_faults;
-
-    return do_domctl(xc, &domctl);
-
-}
-
 int xc_domain_debug_control(xc_interface *xc, uint32_t domid, uint32_t sop, uint32_t vcpu)
 {
     DECLARE_DOMCTL;
index 7f0358ba9ce20f57dd4e916a4f3ccc79bd8c4a1f..911d2881491971c22efcf9d0d920437e11b6bd2d 100644 (file)
@@ -786,22 +786,6 @@ static PyObject *pyxc_dom_set_machine_address_size(XcObject *self,
     Py_INCREF(zero);
     return zero;
 }
-
-static PyObject *pyxc_dom_suppress_spurious_page_faults(XcObject *self,
-                                                     PyObject *args,
-                                                     PyObject *kwds)
-{
-    uint32_t dom;
-
-    if (!PyArg_ParseTuple(args, "i", &dom))
-       return NULL;
-
-    if (xc_domain_suppress_spurious_page_faults(self->xc_handle, dom) != 0)
-       return pyxc_error_to_exception(self->xc_handle);
-
-    Py_INCREF(zero);
-    return zero;
-}
 #endif /* __i386__ || __x86_64__ */
 
 static PyObject *pyxc_gnttab_hvm_seed(XcObject *self,
@@ -2463,12 +2447,6 @@ static PyMethodDef pyxc_methods[] = {
       "Set maximum machine address size for this domain.\n"
       " dom [int]: Identifier of domain.\n"
       " width [int]: Maximum machine address width.\n" },
-
-    { "domain_suppress_spurious_page_faults",
-      (PyCFunction)pyxc_dom_suppress_spurious_page_faults,
-      METH_VARARGS, "\n"
-      "Do not propagate spurious page faults to this guest.\n"
-      " dom [int]: Identifier of domain.\n" },
 #endif
 
     { "dom_set_memshr", 
index 2d45e5b8a83de361b180cc60946eac3c677c4170..34a6f88b8acbfdebb32de4e994861308c2620fbd 100644 (file)
@@ -988,10 +988,6 @@ long arch_do_domctl(
         }
         break;
 
-    case XEN_DOMCTL_suppress_spurious_page_faults:
-        d->arch.suppress_spurious_page_faults = 1;
-        break;
-
 #ifdef CONFIG_HVM
     case XEN_DOMCTL_debug_op:
     {
index 23069e25eceb3761495f3b70ae45d9ce7027ccaa..d848ebb1c7016b577dbbb965cf676d3d8797698a 100644 (file)
@@ -1402,7 +1402,6 @@ void do_page_fault(struct cpu_user_regs *regs)
 {
     unsigned long addr, fixup;
     unsigned int error_code;
-    enum pf_type pf_type;
 
     addr = read_cr2();
 
@@ -1419,7 +1418,8 @@ void do_page_fault(struct cpu_user_regs *regs)
 
     if ( unlikely(!guest_mode(regs)) )
     {
-        pf_type = spurious_page_fault(addr, regs);
+        enum pf_type pf_type = spurious_page_fault(addr, regs);
+
         if ( (pf_type == smep_fault) || (pf_type == smap_fault) )
         {
             console_start_sync();
@@ -1452,20 +1452,6 @@ void do_page_fault(struct cpu_user_regs *regs)
               error_code, _p(addr));
     }
 
-    if ( unlikely(current->domain->arch.suppress_spurious_page_faults) )
-    {
-        pf_type = spurious_page_fault(addr, regs);
-        if ( (pf_type == smep_fault) || (pf_type == smap_fault))
-        {
-            printk(XENLOG_G_ERR "%pv fatal SM%cP violation\n",
-                   current, (pf_type == smep_fault) ? 'E' : 'A');
-
-            domain_crash(current->domain);
-        }
-        if ( pf_type != real_fault )
-            return;
-    }
-
     if ( unlikely(regs->error_code & PFEC_reserved_bit) )
         reserved_bit_page_fault(addr, regs);
 
index badf7c892363238c8a45f01d131c58d35fec06f8..9f3afd12bc28cf94f6234cc079034008939aab2f 100644 (file)
@@ -337,9 +337,6 @@ struct arch_domain
     /* Is shared-info page in 32-bit format? */
     bool_t has_32bit_shinfo;
 
-    /* Domain cannot handle spurious page faults? */
-    bool_t suppress_spurious_page_faults;
-
     /* Is PHYSDEVOP_eoi to automatically unmask the event channel? */
     bool_t auto_unmask;
 
index 19486d5e320ed3f3b47ca344ad6f16f0b18ca9bb..726ce675e872d6c0952973c4f190d26b2a9c31f4 100644 (file)
@@ -698,11 +698,6 @@ struct xen_domctl_subscribe {
 /* XEN_DOMCTL_set_machine_address_size */
 /* XEN_DOMCTL_get_machine_address_size */
 
-/*
- * Do not inject spurious page faults into this domain.
- */
-/* XEN_DOMCTL_suppress_spurious_page_faults */
-
 /* XEN_DOMCTL_debug_op */
 #define XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_OFF         0
 #define XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON          1
@@ -1172,7 +1167,7 @@ struct xen_domctl {
 #define XEN_DOMCTL_get_device_group              50
 #define XEN_DOMCTL_set_machine_address_size      51
 #define XEN_DOMCTL_get_machine_address_size      52
-#define XEN_DOMCTL_suppress_spurious_page_faults 53
+/* #define XEN_DOMCTL_suppress_spurious_page_faults 53 - Obsolete */
 #define XEN_DOMCTL_debug_op                      54
 #define XEN_DOMCTL_gethvmcontext_partial         55
 #define XEN_DOMCTL_vm_event_op                   56
index 791c1f66afc88b7665e9e92c884a1026ba5a30a7..fd5ec992cf59a29c043d6ee0ee7330247a768fa5 100644 (file)
@@ -712,7 +712,6 @@ static int flask_domctl(struct domain *d, int cmd)
 
     case XEN_DOMCTL_subscribe:
     case XEN_DOMCTL_disable_migrate:
-    case XEN_DOMCTL_suppress_spurious_page_faults:
         return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SET_MISC_INFO);
 
     case XEN_DOMCTL_set_virq_handler:
index 194d743a71a731837527c3ee6f1e67e9c987e3b4..c9ebd0f37e5afb91c285c692cce806be2b69d790 100644 (file)
@@ -176,8 +176,7 @@ class domain
     getpodtarget
 # XENMEM_set_pod_target
     setpodtarget
-# XEN_DOMCTL_subscribe, XEN_DOMCTL_disable_migrate,
-# XEN_DOMCTL_suppress_spurious_page_faults
+# XEN_DOMCTL_subscribe, XEN_DOMCTL_disable_migrate
     set_misc_info
 # XEN_DOMCTL_set_virq_handler
     set_virq_handler