From nobody Thu Mar 28 21:32:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=1562686205; cv=none; d=zoho.com; s=zohoarc; b=Umgi450XF3YQwLtFCmNEeZNzkfEviElEvZVQbD3hViJuH3jW3jPy/uI9TTmuTP+I3Z+UAwgS4913u1uvsu4M+mXAZXbetRdvBaOq21yZtCwy9HRu10Afw3EooBWlJCUqGN9FG4sFtJ/vnPsjT3qBjS2MWiy+QW0WP5ZGl9a1jyY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562686205; 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=2KQpn55Wks8IZK4r4sX8nVK0pvH5kfUr8hslvn0IsaM=; b=iw9GowyGX1tfFINFC1LVz4trkFbRX70wKx8iTxDAjTj/UJRO8FCPkTT49vdzKOEJ1/gMJ+1DZOpBzV/vP062C0cd3xkLY0PTsPgrfNgRcN4r7tosYyzuzUUqyQyUcaxshDtraaFHtyJqG38XIdMwo9yUCt1jiPIARzXq1EbLcUo= ARC-Authentication-Results: i=1; mx.zoho.com; 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 1562686205390745.0998059177995; Tue, 9 Jul 2019 08:30:05 -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 1hks39-0003gf-RF; Tue, 09 Jul 2019 15:28:59 +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 1hks38-0003gU-LC for xen-devel@lists.xenproject.org; Tue, 09 Jul 2019 15:28:58 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 43a55166-a25e-11e9-b546-637a9a85595a; Tue, 09 Jul 2019 15:28:55 +0000 (UTC) X-Inumbo-ID: 43a55166-a25e-11e9-b546-637a9a85595a Authentication-Results: esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.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=esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 8QVR43kiQrVwW5qxCQzor9FRCUgeBrh8LOiTgZ+Mo5egKylf8mQrYYWXuzXpNWEo6lOS2dx4fg +xiQjAdxbzaIl8d7fnaa9MI2/pWvhfObyrxhYpATQR4kq/AJzBTVv6i980+LC6lLjU5Gq/Nxim PRtsuzfGZz3tJ9CN1so7Tz9lpnYl6Xsst8Tm37DpkyEA9PPHEJMh7BF5HXobgoYbYTpP7O6e0u 8S090zoCE9f9hOUnVhAaMOdGJdfLP7RY6kWK+2gg0gWXk3XYG1Fx0rBi4MZsk1QG7CIUHtnc9j o/k= X-SBRS: 2.7 X-MesageID: 2812809 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,470,1557201600"; d="scan'208";a="2812809" From: Andrew Cooper To: Xen-devel Date: Tue, 9 Jul 2019 16:28:44 +0100 Message-ID: <20190709152845.18217-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190709152845.18217-1-andrew.cooper3@citrix.com> References: <20190709152845.18217-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 1/2] tools/xenstored: Make gnttab interface mandatory 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: Juergen Gross , Andrew Cooper , 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" xenstored currently requires an libxc and evtchn interface, but leaves the gnttab interface as optional. gnttab is ubiquitous these days, and in practice mandatory in all cases where xenstored isn't running as root in dom0 (due to the inability to foreign map by MFN). The toolstack has unconditionally set up grant details for many years now, and longterm it would be good to phase out the use of libxc. This requires that xenstored map the store ring by grant map, rather than foreign map. No practical change. Signed-off-by: Andrew Cooper Reviewed-by: Juergen Gross --- CC: Ian Jackson CC: Wei Liu CC: Juergen Gross --- tools/xenstore/xenstored_domain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_d= omain.c index fa6655033a..463ebba643 100644 --- a/tools/xenstore/xenstored_domain.c +++ b/tools/xenstore/xenstored_domain.c @@ -641,9 +641,9 @@ void domain_init(void) =20 *xgt_handle =3D xengnttab_open(NULL, 0); if (*xgt_handle =3D=3D NULL) - xprintf("WARNING: Failed to open connection to gnttab\n"); - else - talloc_set_destructor(xgt_handle, close_xgt_handle); + barf_perror("Failed to open connection to gnttab"); + + talloc_set_destructor(xgt_handle, close_xgt_handle); =20 xce_handle =3D xenevtchn_open(NULL, 0); =20 --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel From nobody Thu Mar 28 21:32:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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=1562686201; cv=none; d=zoho.com; s=zohoarc; b=nNqk9nrVe95LVWE3ncInbgqegapYU4Rm7izClikfDDzsyytFkuezXSDeSxLy1UvlsWXn54hZw3jobMxKy89qC3U73HWgSUbDFok0UTsNlMtucgKd6xRpCskI2ZKJQsDH7pt0elTQ/CNHz2zgPLULBhhBcwAl0y6MzOQYKsTFsJk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1562686201; 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=LLi35xkeuDWPX9a5xWxzm/5xYhlSDu1h5FV3e5hcMFY=; b=WoXb7kJzzgloyqNlI+Ha1u+RPUBdizPmvSTPNsA3t6mfKyjmPHXvg1lWnRGZOsFCg2X53MjwRn8W71GTrgIbUlFrQ0Ucbwqh0Zip/g95x4FkpNfUnYFDmO+ZSLaYZxXpp9prk5kpuZa0K6FQ9RTIsx0JOY7xLL5JtkAsmSfxE9c= ARC-Authentication-Results: i=1; mx.zoho.com; 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 1562686201904363.9741819721894; Tue, 9 Jul 2019 08:30:01 -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 1hks37-0003g1-HV; Tue, 09 Jul 2019 15:28:57 +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 1hks36-0003fw-DQ for xen-devel@lists.xenproject.org; Tue, 09 Jul 2019 15:28:56 +0000 Received: from esa4.hc3370-68.iphmx.com (unknown [216.71.155.144]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 4163b1f4-a25e-11e9-bcc5-2f39246d5fa5; Tue, 09 Jul 2019 15:28:52 +0000 (UTC) X-Inumbo-ID: 4163b1f4-a25e-11e9-bcc5-2f39246d5fa5 Authentication-Results: esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.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=esa4.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 (esa4.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=esa4.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: X9PVLOT/nknk00784RoO81mAL54xyeGww4xKJVQ5ldU1NMTWoRpSQE5FrTcFYgt8t25ybsgiTC lAVUymh9OydxWLHAo0LccrvJYNKFo3i+Ueb1YEpcq3OqSqHf4WD55vApLXS2pMgrwvzs8eKYl1 miouuI1l60CXF68fgXhrAp0E19J4ywNU5vMNE0jH8XsqgmtufhVBhgTCIIJAostynqLXiVdsMu fpTBB/jnzfFPh14hNAAQ4HgSOGYcC3tymytISkSciyw8MwghXHUXJ0t1X1ejgP0RaMUwH+MNfH 4A8= X-SBRS: 2.7 X-MesageID: 2812807 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.63,470,1557201600"; d="scan'208";a="2812807" From: Andrew Cooper To: Xen-devel Date: Tue, 9 Jul 2019 16:28:45 +0100 Message-ID: <20190709152845.18217-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190709152845.18217-1-andrew.cooper3@citrix.com> References: <20190709152845.18217-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 2/2] tools/xenstored: Drop mapping of the ring via foreign map 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: Juergen Gross , Andrew Cooper , 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" This is a vestigial remnent of the pre xenstored stub domain days. Foreign mapping via MFN is a privileged operation which is not necessary, because grant details are unconditionally set up during domain construction. In practice, this means xenstored never uses its ability to foreign map the ring. Drop the ability completely, which removes the penultimate use of the unstable libxc interface. Signed-off-by: Andrew Cooper Reviewed-by: Juergen Gross --- CC: Ian Jackson CC: Wei Liu CC: Juergen Gross --- tools/xenstore/xenstored_domain.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_d= omain.c index 463ebba643..c793543bb4 100644 --- a/tools/xenstore/xenstored_domain.c +++ b/tools/xenstore/xenstored_domain.c @@ -171,24 +171,16 @@ static int readchn(struct connection *conn, void *dat= a, unsigned int len) return len; } =20 -static void *map_interface(domid_t domid, unsigned long mfn) -{ - if (*xgt_handle !=3D NULL) { - /* this is the preferred method */ - return xengnttab_map_grant_ref(*xgt_handle, domid, - GNTTAB_RESERVED_XENSTORE, PROT_READ|PROT_WRITE); - } else { - return xc_map_foreign_range(*xc_handle, domid, - XC_PAGE_SIZE, PROT_READ|PROT_WRITE, mfn); - } +static void *map_interface(domid_t domid) +{ + return xengnttab_map_grant_ref(*xgt_handle, domid, + GNTTAB_RESERVED_XENSTORE, + PROT_READ|PROT_WRITE); } =20 static void unmap_interface(void *interface) { - if (*xgt_handle !=3D NULL) - xengnttab_unmap(*xgt_handle, interface, 1); - else - munmap(interface, XC_PAGE_SIZE); + xengnttab_unmap(*xgt_handle, interface, 1); } =20 static int destroy_domain(void *_domain) @@ -396,7 +388,7 @@ int do_introduce(struct connection *conn, struct buffer= ed_data *in) domain =3D find_domain_by_domid(domid); =20 if (domain =3D=3D NULL) { - interface =3D map_interface(domid, mfn); + interface =3D map_interface(domid); if (!interface) return errno; /* Hang domain off "in" until we're finished. */ --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel