From nobody Fri Apr 26 20:09:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1565693715; cv=none; d=zoho.com; s=zohoarc; b=Q+Ma5eSqQ1ykDuusjzpGniH1xE/QjDBlJAkmQVrjCf0oPh0irPEfYRDim3LTWjBWIAs5QsacmySiiLXEYwYvBCRRyrxS9oixaMAhmMsVgR6qtZEQbxiF/PaXGY1YRig0nHD20Jlg1pN1JUH6CyNfbTXOV3BP01OBscxKN8ke0uA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565693715; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=kqFGcjV9kYQaqdaFfLe4/S8bT33Ss7voyvLIWnqFbGI=; b=nD/Hk56+EysLglJLgrgle3D4unf8hDGzifmnmmmRPPQBAYYL9O6b1waisit22WOq6+o8G5v0cMbdvY5fmvV4z+muTaNsoHl+Ya3+5unDnpWS+eRFrFdEMy1xGNRtJaO9czUdta0bRwCWbwy1b07QUJzRfwy3kmvn2L69pcZqCt8= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1565693715744872.860491697325; Tue, 13 Aug 2019 03:55:15 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hxURH-0002WU-Ri; Tue, 13 Aug 2019 10:54:03 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hxURG-0002WE-9o for xen-devel@lists.xenproject.org; Tue, 13 Aug 2019 10:54:02 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id a7ef2938-bdb8-11e9-8480-87d50183c77c; Tue, 13 Aug 2019 10:54:00 +0000 (UTC) X-Inumbo-ID: a7ef2938-bdb8-11e9-8480-87d50183c77c DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1565693640; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=el/bTUrQqo3YJVk4otEeJweQpzhPzFJ8h1/GmBe5cQk=; b=TcS676c3rLtodcSb0YpclTX8A4d55jBg27z5LpKrygXloI2pbCKpIekS ckF5jhzb9MaDrfm4oHVbF7a7KNmX2a0L59OdbK5z1+bTXYlp0cG1mHzyJ ndkmQYH6FZsas8+tVAfshxOi09hGYvIE+B2S2oXPs+7rRIA0mI3D1TFbU M=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: Rkr9VNets/ZK8/RHJZhjBWdGWMh2TC+F3Elc7IYCRs5hDTpQvZToNsROe4xM+fnsDuFIRYv/Wm 4cX5t5xjueRwil8+Eojtjkn/DUk25yUpm+Zd0TZgxBmSBIW/EECCEnPDDD+NjqwhSsZqf0a1hX TRfnoKyWxhjD7873c9nvBL6zlztgGJT1XIs0CSEIYwh0gYovUmDpsgSqxXwMWiJMT30vE5fPpa HYq0JKDTE9M7MbxoEdTpgYgmdTgOiPvCERQeeDHuTwj23KUcyul8FZnrG+xqU6K9tnCfC4zpL3 82M= X-SBRS: 2.7 X-MesageID: 4208595 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,381,1559534400"; d="scan'208";a="4208595" From: Andrew Cooper To: Xen-devel Date: Tue, 13 Aug 2019 11:53:51 +0100 Message-ID: <20190813105352.32412-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190813105352.32412-1-andrew.cooper3@citrix.com> References: <20190813105352.32412-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 1/2] xen: Drop XEN_DOMCTL_suppress_spurious_page_faults X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Andrew Cooper , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Jan Beulich , Ian Jackson , Daniel De Graaf , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 Acked-by: Marek Marczykowski-G=C3=B3recki Acked-by: Wei Liu Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Ian Jackson CC: Marek Marczykowski-G=C3=B3recki CC: Daniel De Graaf --- tools/libxc/include/xenctrl.h | 3 --- tools/libxc/xc_domain.c | 12 ------------ tools/python/xen/lowlevel/xc/xc.c | 22 ---------------------- xen/arch/x86/domctl.c | 4 ---- xen/arch/x86/traps.c | 14 -------------- xen/include/asm-x86/domain.h | 3 --- xen/include/public/domctl.h | 7 +------ xen/xsm/flask/hooks.c | 1 - xen/xsm/flask/policy/access_vectors | 3 +-- 9 files changed, 2 insertions(+), 67 deletions(-) diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h index 0ff6ed9e70..a36896034a 100644 --- a/tools/libxc/include/xenctrl.h +++ b/tools/libxc/include/xenctrl.h @@ -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); =20 -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, diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c index 05d771f2ce..64ca513aae 100644 --- a/tools/libxc/xc_domain.c +++ b/tools/libxc/xc_domain.c @@ -2190,18 +2190,6 @@ int xc_domain_get_machine_address_size(xc_interface = *xch, uint32_t domid) return rc =3D=3D 0 ? domctl.u.address_size.size : rc; } =20 -int xc_domain_suppress_spurious_page_faults(xc_interface *xc, uint32_t dom= id) -{ - DECLARE_DOMCTL; - - memset(&domctl, 0, sizeof(domctl)); - domctl.domain =3D domid; - domctl.cmd =3D 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; diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/= xc/xc.c index 188bfa34da..7e831a26a7 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -786,22 +786,6 @@ static PyObject *pyxc_dom_set_machine_address_size(XcO= bject *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) !=3D= 0) - return pyxc_error_to_exception(self->xc_handle); - - Py_INCREF(zero); - return zero; -} #endif /* __i386__ || __x86_64__ */ =20 static PyObject *pyxc_gnttab_hvm_seed(XcObject *self, @@ -2436,12 +2420,6 @@ static PyMethodDef pyxc_methods[] =3D { "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 =20 { "dom_set_memshr",=20 diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 2d45e5b8a8..34a6f88b8a 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -988,10 +988,6 @@ long arch_do_domctl( } break; =20 - case XEN_DOMCTL_suppress_spurious_page_faults: - d->arch.suppress_spurious_page_faults =3D 1; - break; - #ifdef CONFIG_HVM case XEN_DOMCTL_debug_op: { diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 23069e25ec..350903add5 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -1452,20 +1452,6 @@ void do_page_fault(struct cpu_user_regs *regs) error_code, _p(addr)); } =20 - if ( unlikely(current->domain->arch.suppress_spurious_page_faults) ) - { - pf_type =3D spurious_page_fault(addr, regs); - if ( (pf_type =3D=3D smep_fault) || (pf_type =3D=3D smap_fault)) - { - printk(XENLOG_G_ERR "%pv fatal SM%cP violation\n", - current, (pf_type =3D=3D smep_fault) ? 'E' : 'A'); - - domain_crash(current->domain); - } - if ( pf_type !=3D real_fault ) - return; - } - if ( unlikely(regs->error_code & PFEC_reserved_bit) ) reserved_bit_page_fault(addr, regs); =20 diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h index 933b85901f..8523c3f5e0 100644 --- a/xen/include/asm-x86/domain.h +++ b/xen/include/asm-x86/domain.h @@ -339,9 +339,6 @@ struct arch_domain /* Is shared-info page in 32-bit format? */ bool_t has_32bit_shinfo; =20 - /* 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; =20 diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index 19486d5e32..726ce675e8 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -698,11 +698,6 @@ struct xen_domctl_subscribe { /* XEN_DOMCTL_set_machine_address_size */ /* XEN_DOMCTL_get_machine_address_size */ =20 -/* - * 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 diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index 791c1f66af..fd5ec992cf 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -712,7 +712,6 @@ static int flask_domctl(struct domain *d, int cmd) =20 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); =20 case XEN_DOMCTL_set_virq_handler: diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/acc= ess_vectors index 194d743a71..c9ebd0f37e 100644 --- a/xen/xsm/flask/policy/access_vectors +++ b/xen/xsm/flask/policy/access_vectors @@ -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 --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Fri Apr 26 20:09:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1565693720; cv=none; d=zoho.com; s=zohoarc; b=USDD41zUT5Hgj0uTUmJ/CvIVcn5sKK0ZKaoR4potoH4Gfn3TA9E5X++ZBqhVMWOOF714hb0nEj7FBhmoZ+pfKCIgB3TugEhXn6klSiZk6GNzQ17IQZyIknJvt1KNc159ipRMRsedXWlWrm/Ypgkh2jhnuddonuMXqrQoMCH0b2Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565693720; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=TBLh3vElXpid7IdqeCUUSs9hHkqPP2vrmfbqCUuXqQk=; b=VMuG0Ak5e4QOKZTOqvLdfetUHTeXJyRgLY6KkCJJwuU6OQ8wLMvLzMoIe1LnN9hyWtyR7xB0sLeAwDQ0RdMOC2c/4NFTrLUv+CtUMjzH9J46n35ZKbLD/lxvL6LvIGBMCnAwXgtqb9SAPwfLzW0yCHfvrbEWiV+uAFF4Jj0n5AQ= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 15656937202961012.907057605073; Tue, 13 Aug 2019 03:55:20 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hxURI-0002Wq-Ia; Tue, 13 Aug 2019 10:54:04 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hxURH-0002WP-In for xen-devel@lists.xenproject.org; Tue, 13 Aug 2019 10:54:03 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id a92ba39e-bdb8-11e9-9fcc-27bbbe29133e; Tue, 13 Aug 2019 10:54:02 +0000 (UTC) X-Inumbo-ID: a92ba39e-bdb8-11e9-9fcc-27bbbe29133e DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1565693642; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=p+gI0ZKyLHYvavp9A9GRbSgdMOeMaOJ2xE7mKOy3I3Y=; b=I3i2xbjHYYuo0NRl0r8waLiKm3Dq4YLGUtdFoaKAJmcf6HftTAPyq+kZ paNHbEOCgE3WWwR/iHIAMeYt7oHnzcixuv6uvUn3+ydG+ef4ZOMVNamGt nMccJ01mFeSOYTZ5Ttj8BLErJhGojqP6uFr9a7Ygt5dsfu+1t9twgCHEM k=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: H8y8SNDjGC9Q7vYu9uqReRjuu903JkZ4Rl0u7QgahrMHg486HYbpb0zZWgQYXQPWqQZBeFagHc hpn1FSchmmnfVkphZL3eUmFiO2wu6tf4j4G/yYIgg3PEd3op5FHHmwWr5FE6dc8ZP+4Sd7v8ji K1m/oq6WDbnH/dMxeb9qaXwZOJoAVp0AjeSX99moQzY+TjnAgOiDNYRlKwmh1jQaeIc1af3REB jLXjg7uxBsQIGKOSmtuWNPL9kHqNyK4AkVNFQtUZGAHb6MdxyZyhOzty9VLwzncAdHFuRN1tSO jNU= X-SBRS: 2.7 X-MesageID: 4208596 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,381,1559534400"; d="scan'208";a="4208596" From: Andrew Cooper To: Xen-devel Date: Tue, 13 Aug 2019 11:53:52 +0100 Message-ID: <20190813105352.32412-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190813105352.32412-1-andrew.cooper3@citrix.com> References: <20190813105352.32412-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 2/2] xen: Drop XEN_DOMCTL_{get, set}_machine_address_size X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Andrew Cooper , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Rob Hoes , Christian Lindig , Jan Beulich , Ian Jackson , Daniel De Graaf , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This functionality is obsolete. It was introduced by c/s 41296317a31 into Xend, but was never exposed in libxl. Nothing limits this to PV guests, but it makes no sense for HVM guests. Looking through the XenServer templates, this was used to work around bugs = in the 32bit RHEL/CentOS 4.7 and 4.8 kernels (fixed in 4.9) and RHEL/CentOS/OEL 5.2 and 5.3 kernels (fixed in 5.4). RHEL 4 as a major version went out of support in 2017, whereas the 5.2/5.3 kernels went out of support when 5.4 w= as released in 2009. Signed-off-by: Andrew Cooper Acked-by: Christian Lindig Acked-by: Marek Marczykowski-G=C3=B3recki Acked-by: Wei Liu Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Ian Jackson CC: Marek Marczykowski-G=C3=B3recki CC: Daniel De Graaf CC: Christian Lindig CC: Rob Hoes There may be some resulting simplifications which can be made to the heap allocator, but that involves untangling the other address clamping logic first. --- tools/libxc/include/xenctrl.h | 6 ------ tools/libxc/xc_domain.c | 29 ----------------------------- tools/ocaml/libs/xc/xenctrl.ml | 5 ----- tools/ocaml/libs/xc/xenctrl.mli | 5 ----- tools/ocaml/libs/xc/xenctrl_stubs.c | 26 -------------------------- tools/python/xen/lowlevel/xc/xc.c | 23 ----------------------- xen/arch/x86/domctl.c | 12 ------------ xen/include/public/domctl.h | 11 ++--------- xen/xsm/flask/hooks.c | 2 -- xen/xsm/flask/policy/access_vectors | 4 ++-- 10 files changed, 4 insertions(+), 119 deletions(-) diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h index a36896034a..c92386aab8 100644 --- a/tools/libxc/include/xenctrl.h +++ b/tools/libxc/include/xenctrl.h @@ -1781,12 +1781,6 @@ int xc_domain_unbind_pt_spi_irq(xc_interface *xch, uint16_t vspi, uint16_t spi); =20 -int xc_domain_set_machine_address_size(xc_interface *xch, - uint32_t domid, - unsigned int width); -int xc_domain_get_machine_address_size(xc_interface *xch, - uint32_t domid); - /* Set the target domain */ int xc_domain_set_target(xc_interface *xch, uint32_t domid, diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c index 64ca513aae..e544218d2e 100644 --- a/tools/libxc/xc_domain.c +++ b/tools/libxc/xc_domain.c @@ -2161,35 +2161,6 @@ int xc_domain_subscribe_for_suspend( return do_domctl(xch, &domctl); } =20 -int xc_domain_set_machine_address_size(xc_interface *xch, - uint32_t domid, - unsigned int width) -{ - DECLARE_DOMCTL; - - memset(&domctl, 0, sizeof(domctl)); - domctl.domain =3D domid; - domctl.cmd =3D XEN_DOMCTL_set_machine_address_size; - domctl.u.address_size.size =3D width; - - return do_domctl(xch, &domctl); -} - - -int xc_domain_get_machine_address_size(xc_interface *xch, uint32_t domid) -{ - DECLARE_DOMCTL; - int rc; - - memset(&domctl, 0, sizeof(domctl)); - domctl.domain =3D domid; - domctl.cmd =3D XEN_DOMCTL_get_machine_address_size; - - rc =3D do_domctl(xch, &domctl); - - return rc =3D=3D 0 ? domctl.u.address_size.size : rc; -} - int xc_domain_debug_control(xc_interface *xc, uint32_t domid, uint32_t sop= , uint32_t vcpu) { DECLARE_DOMCTL; diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml index a57130a3c3..35958b94d5 100644 --- a/tools/ocaml/libs/xc/xenctrl.ml +++ b/tools/ocaml/libs/xc/xenctrl.ml @@ -241,11 +241,6 @@ external domain_set_memmap_limit: handle -> domid -> i= nt64 -> unit external domain_memory_increase_reservation: handle -> domid -> int64 -> u= nit =3D "stub_xc_domain_memory_increase_reservation" =20 -external domain_set_machine_address_size: handle -> domid -> int -> unit - =3D "stub_xc_domain_set_machine_address_size" -external domain_get_machine_address_size: handle -> domid -> int - =3D "stub_xc_domain_get_machine_address_size" - external domain_cpuid_set: handle -> domid -> (int64 * (int64 option)) -> string option array -> string option array diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.= mli index 476bbecb90..6c4268d453 100644 --- a/tools/ocaml/libs/xc/xenctrl.mli +++ b/tools/ocaml/libs/xc/xenctrl.mli @@ -202,11 +202,6 @@ val pages_to_mib : int64 -> int64 external watchdog : handle -> int -> int32 -> int =3D "stub_xc_watchdog" =20 -external domain_set_machine_address_size: handle -> domid -> int -> unit - =3D "stub_xc_domain_set_machine_address_size" -external domain_get_machine_address_size: handle -> domid -> int - =3D "stub_xc_domain_get_machine_address_size" - external domain_cpuid_set: handle -> domid -> (int64 * (int64 option)) -> string option array -> string option array diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenc= trl_stubs.c index c4fdc58b2d..2e1b29ce33 100644 --- a/tools/ocaml/libs/xc/xenctrl_stubs.c +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c @@ -759,32 +759,6 @@ CAMLprim value stub_xc_domain_memory_increase_reservat= ion(value xch, CAMLreturn(Val_unit); } =20 -CAMLprim value stub_xc_domain_set_machine_address_size(value xch, - value domid, - value width) -{ - CAMLparam3(xch, domid, width); - uint32_t c_domid =3D _D(domid); - int c_width =3D Int_val(width); - - int retval =3D xc_domain_set_machine_address_size(_H(xch), c_domid, c_wid= th); - if (retval) - failwith_xc(_H(xch)); - CAMLreturn(Val_unit); -} - -CAMLprim value stub_xc_domain_get_machine_address_size(value xch, - value domid) -{ - CAMLparam2(xch, domid); - int retval; - - retval =3D xc_domain_get_machine_address_size(_H(xch), _D(domid)); - if (retval < 0) - failwith_xc(_H(xch)); - CAMLreturn(Val_int(retval)); -} - CAMLprim value stub_xc_domain_cpuid_set(value xch, value domid, value input, value config) diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/= xc/xc.c index 7e831a26a7..f0430ca85e 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -770,22 +770,6 @@ static PyObject *pyxc_dom_set_cpuid(XcObject *self, =20 return pyxc_create_cpuid_dict(regs_transform); } - -static PyObject *pyxc_dom_set_machine_address_size(XcObject *self, - PyObject *args, - PyObject *kwds) -{ - uint32_t dom, width; - - if (!PyArg_ParseTuple(args, "ii", &dom, &width)) - return NULL; - - if (xc_domain_set_machine_address_size(self->xc_handle, dom, width) != =3D 0) - return pyxc_error_to_exception(self->xc_handle); - - Py_INCREF(zero); - return zero; -} #endif /* __i386__ || __x86_64__ */ =20 static PyObject *pyxc_gnttab_hvm_seed(XcObject *self, @@ -2413,13 +2397,6 @@ static PyMethodDef pyxc_methods[] =3D { "Set the default cpuid policy for a domain.\n" " dom [int]: Identifier of domain.\n\n" "Returns: [int] 0 on success; exception on error.\n" }, - - { "domain_set_machine_address_size", - (PyCFunction)pyxc_dom_set_machine_address_size, - METH_VARARGS, "\n" - "Set maximum machine address size for this domain.\n" - " dom [int]: Identifier of domain.\n" - " width [int]: Maximum machine address width.\n" }, #endif =20 { "dom_set_memshr",=20 diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 34a6f88b8a..1e98fc8009 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -643,18 +643,6 @@ long arch_do_domctl( ASSERT_UNREACHABLE(); break; =20 - case XEN_DOMCTL_set_machine_address_size: - if ( d->tot_pages > 0 ) - ret =3D -EBUSY; - else - d->arch.physaddr_bitsize =3D domctl->u.address_size.size; - break; - - case XEN_DOMCTL_get_machine_address_size: - domctl->u.address_size.size =3D d->arch.physaddr_bitsize; - copyback =3D true; - break; - case XEN_DOMCTL_sendtrigger: { struct vcpu *v; diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index 726ce675e8..72d5133cba 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -691,13 +691,6 @@ struct xen_domctl_subscribe { uint32_t port; /* IN */ }; =20 -/* - * Define the maximum machine address size which should be allocated - * to a guest. - */ -/* XEN_DOMCTL_set_machine_address_size */ -/* XEN_DOMCTL_get_machine_address_size */ - /* XEN_DOMCTL_debug_op */ #define XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_OFF 0 #define XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON 1 @@ -1165,8 +1158,8 @@ struct xen_domctl { #define XEN_DOMCTL_unbind_pt_irq 48 #define XEN_DOMCTL_set_cpuid 49 #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_set_machine_address_size 51 - Obsolete */ +/* #define XEN_DOMCTL_get_machine_address_size 52 - Obsolete */ /* #define XEN_DOMCTL_suppress_spurious_page_faults 53 - Obsolete */ #define XEN_DOMCTL_debug_op 54 #define XEN_DOMCTL_gethvmcontext_partial 55 diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index fd5ec992cf..6800f2d9a0 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -684,11 +684,9 @@ static int flask_domctl(struct domain *d, int cmd) return current_has_perm(d, SECCLASS_HVM, HVM__GETHVMC); =20 case XEN_DOMCTL_set_address_size: - case XEN_DOMCTL_set_machine_address_size: return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__SETADDRSIZE); =20 case XEN_DOMCTL_get_address_size: - case XEN_DOMCTL_get_machine_address_size: return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETADDRSIZE); =20 case XEN_DOMCTL_mem_sharing_op: diff --git a/xen/xsm/flask/policy/access_vectors b/xen/xsm/flask/policy/acc= ess_vectors index c9ebd0f37e..76f3d60ddd 100644 --- a/xen/xsm/flask/policy/access_vectors +++ b/xen/xsm/flask/policy/access_vectors @@ -166,9 +166,9 @@ class domain set_target # SCHEDOP_remote_shutdown shutdown -# XEN_DOMCTL_set{,_machine}_address_size +# XEN_DOMCTL_set_address_size setaddrsize -# XEN_DOMCTL_get{,_machine}_address_size +# XEN_DOMCTL_get_address_size getaddrsize # XEN_DOMCTL_sendtrigger trigger --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel