From nobody Tue Feb 10 07:41:12 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1580921507017214.26223044991502; Wed, 5 Feb 2020 08:51:47 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1izNtN-0000Q2-CA; Wed, 05 Feb 2020 16:51:09 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1izNtM-0000Pi-Cq for xen-devel@lists.xenproject.org; Wed, 05 Feb 2020 16:51:08 +0000 Received: from esa2.hc3370-68.iphmx.com (unknown [216.71.145.153]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id b1389f38-4837-11ea-915c-12813bfff9fa; Wed, 05 Feb 2020 16:51:02 +0000 (UTC) X-Inumbo-ID: b1389f38-4837-11ea-915c-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1580921463; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wt9JPNfDaTiVVEOj4fX5wmVP6nuaEv41Cj0T1A9EtMU=; b=BjIzVxWefP4IX1AepZEI+xbLm+JjOjtGxkeR41OJ30bU7lhxAfMFKbAq T82r5H6ptgCD1HNWbcyAJVipCoZdAhnQlHquu5iw8wd1sbL6fYMjgR/Cv p2HUr0SvWougmObOOzVeVTdKJ3k3BEKWy2AGxwsbD4SyNEi2jIazNP/6G g=; Authentication-Results: esa2.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 (zohomail.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 (esa2.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=esa2.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.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=esa2.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 ip4:168.245.78.127 ~all" Received-SPF: None (esa2.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=esa2.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: fNJAwZA3Zt6X/angS7jPEVClGH0loHKIrj+8woOELPJxB5EiV7TAuz1NDCijUKjZWyl019ldb5 h6muKODVdWQGyPVWaQGECl/tvH+HuVqjJ4q+wfvGw796IyXt9h05HBH9+hYxIeneQ5N7mNx7jk CaCO87UY675mpsaEIcKujRGDYI2W+IVnGdcEMbbEAaE3s3P522jsJJrX+XrYgNWAz0DQ5fkVaE xwqoqHuFaIqvkLmEUUD9YTPZ1iKXrOzNMwa2sPn6nxzJC5GHFOU5zVfHk3PVMfKb3zeU/8HaDr SH8= X-SBRS: 2.7 X-MesageID: 12001772 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,406,1574139600"; d="scan'208";a="12001772" From: Andrew Cooper To: Xen-devel Date: Wed, 5 Feb 2020 16:50:53 +0000 Message-ID: <20200205165056.11734-4-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200205165056.11734-1-andrew.cooper3@citrix.com> References: <20200205165056.11734-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 3/6] tools/python: Drop cpuid helpers 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: Andrew Cooper , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Wei Liu , Ian Jackson 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) These are believed-unused, and the underlying infrastructure is about to be rewritten completely. Signed-off-by: Andrew Cooper Acked-by: Ian Jackson Acked-by: Marek Marczykowski-G=C3=B3recki --- CC: Ian Jackson CC: Wei Liu CC: Marek Marczykowski-G=C3=B3recki --- tools/python/xen/lowlevel/xc/xc.c | 98 -----------------------------------= ---- 1 file changed, 98 deletions(-) diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/= xc/xc.c index a751e85910..ac0e26a742 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -694,84 +694,6 @@ static PyObject *pyxc_get_device_group(XcObject *self, return Pystr; } =20 -#if defined(__i386__) || defined(__x86_64__) -static void pyxc_dom_extract_cpuid(PyObject *config, - char **regs) -{ - const char *regs_extract[4] =3D { "eax", "ebx", "ecx", "edx" }; - PyObject *obj; - int i; - - memset(regs, 0, 4*sizeof(*regs)); - - if ( !PyDict_Check(config) ) - return; - - for ( i =3D 0; i < 4; i++ ) - if ( (obj =3D PyDict_GetItemString(config, regs_extract[i])) !=3D = NULL ) - regs[i] =3D PyBytes_AS_STRING(obj); -} - -static PyObject *pyxc_create_cpuid_dict(char **regs) -{ - const char *regs_extract[4] =3D { "eax", "ebx", "ecx", "edx" }; - PyObject *dict; - int i; - - dict =3D PyDict_New(); - for ( i =3D 0; i < 4; i++ ) - { - if ( regs[i] =3D=3D NULL ) - continue; - PyDict_SetItemString(dict, regs_extract[i], - PyBytes_FromString(regs[i])); - free(regs[i]); - regs[i] =3D NULL; - } - return dict; -} - -static PyObject *pyxc_dom_set_policy_cpuid(XcObject *self, - PyObject *args) -{ - int domid; - - if ( !PyArg_ParseTuple(args, "i", &domid) ) - return NULL; - - if ( xc_cpuid_apply_policy(self->xc_handle, domid, NULL, 0) ) - return pyxc_error_to_exception(self->xc_handle); - - Py_INCREF(zero); - return zero; -} - - -static PyObject *pyxc_dom_set_cpuid(XcObject *self, - PyObject *args) -{ - PyObject *sub_input, *config; - unsigned int domid, input[2]; - char *regs[4], *regs_transform[4]; - - if ( !PyArg_ParseTuple(args, "IIOO", &domid, - &input[0], &sub_input, &config) ) - return NULL; - - pyxc_dom_extract_cpuid(config, regs); - - input[1] =3D XEN_CPUID_INPUT_UNUSED; - if ( PyLong_Check(sub_input) ) - input[1] =3D PyLong_AsUnsignedLong(sub_input); - - if ( xc_cpuid_set(self->xc_handle, domid, input, (const char **)regs, - regs_transform) ) - return pyxc_error_to_exception(self->xc_handle); - - return pyxc_create_cpuid_dict(regs_transform); -} -#endif /* __i386__ || __x86_64__ */ - static PyObject *pyxc_gnttab_hvm_seed(XcObject *self, PyObject *args, PyObject *kwds) @@ -2406,26 +2328,6 @@ static PyMethodDef pyxc_methods[] =3D { "Inject debug keys into Xen.\n" " keys [str]: String of keys to inject.\n" }, =20 -#if defined(__i386__) || defined(__x86_64__) - { "domain_set_cpuid",=20 - (PyCFunction)pyxc_dom_set_cpuid,=20 - METH_VARARGS, "\n" - "Set cpuid response for an input and a domain.\n" - " dom [int]: Identifier of domain.\n" - " input [long]: Input for cpuid instruction (eax)\n" - " sub_input [long]: Second input (optional, may be None) for cpuid " - " instruction (ecx)\n" - " config [dict]: Dictionary of register\n\n" - "Returns: [int] 0 on success; exception on error.\n" }, - - { "domain_set_policy_cpuid",=20 - (PyCFunction)pyxc_dom_set_policy_cpuid,=20 - METH_VARARGS, "\n" - "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" }, -#endif - { "dom_set_memshr",=20 (PyCFunction)pyxc_dom_set_memshr, METH_VARARGS, "\n" --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel