From nobody Sat Nov 30 00:34:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1620757204; cv=none; d=zohomail.com; s=zohoarc; b=Jo8BLkoiyj5tRh22AO8HRuVwL6FYIhnj/EH/MPd10MJYoIV7YRJaoCpBusROfDC68dGJgs3uY7Xp95rFVQkUPmsv6GABgwpdkfVl1MmHPnsiBvBq74Xj0puJHcdkigjRnvh3mw+MF07chvUOdfe4+X82euYcvUwyv/xYBdkaDUw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620757204; 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; bh=lGkeq4Ejs6PJtcsCCAUpY903JDs54yIbxj+g3I6Miz0=; b=EyhpX/C2rRlAgkIZ0/wuxDlTI+DYYWXZ6EryaN3uOq3qUndtLRnTm9uJSX+0jbTwvRoKajOcEBGc0V0TRstCK8rUjqQcmNo43SY4nPoC7AKY1hHELWcHr5/DcotvgnvVFcRWdd+UGUdhMAHi8S2LZu+CCtfZ4czritG/v1UreCA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1620757204450334.74157220027814; Tue, 11 May 2021 11:20:04 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.125960.237090 (Exim 4.92) (envelope-from ) id 1lgWyy-0007jj-NK; Tue, 11 May 2021 18:19:48 +0000 Received: by outflank-mailman (output) from mailman id 125960.237090; Tue, 11 May 2021 18:19:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lgWyy-0007iS-GO; Tue, 11 May 2021 18:19:48 +0000 Received: by outflank-mailman (input) for mailman id 125960; Tue, 11 May 2021 18:19:47 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lgWyx-0007g6-HP for xen-devel@lists.xenproject.org; Tue, 11 May 2021 18:19:47 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 0b63d9b5-d94b-41d2-920f-8f6312662347; Tue, 11 May 2021 18:19:46 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 0b63d9b5-d94b-41d2-920f-8f6312662347 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1620757186; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SU7cgAQhk8vsTkLv/y2uGvNvL2Atz9xPDkxcsiAL/Ik=; b=DF2iR63RcPxEEgp5BdlmahraON9RvtLSzlhmj8WPmXh0+MnIZRjIrdP+ kvuXgjybqV6Rle9uoS7KhyILgYDjXzvrkLTS/S1rNKf5fdLt1HRyP4U0R YeXUsr2WToNHrUp00vq5gxznRf03UfQjiuGWtso8h194dTKBdCBPR9i2m 0=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: Js8J1Ottk9+P26tbK96orEpViIabgTRWSOozgof7eDuwY7XKgwVCvGH0wBVhvtSCELEnFH6OJ0 fBp22c5JAdwR7wDAGrXyMhkeEsMspYxwUf93ZrkIutqa4FMP7EGaPEZJAL3D8gqS9yq/c+jxDZ Il+RjeVW592GORgriTnu20gCMwlO175x/506AASueEQwnhscllpB1n1TqbbMz94191Y6RGxQjH YTxsahTYWhchKTcXO5fsX5eaVAaRvofo9uNw5FDs6chwZVMmWlqb9+y7Dd4odwuOeQGR4oRAZf j3E= X-SBRS: 5.1 X-MesageID: 43955845 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED IronPort-HdrOrdr: A9a23:7A/JIa6E+2oilrlqOQPXwPDXdLJyesId70hD6qhwISY6TiX+rb HWoB17726TtN9/YhEdcLy7VJVoBEmskKKdgrNhWotKPjOW21dARbsKheCJrgEIWReOktK1vZ 0QC5SWY+eQMbEVt6nHCXGDYrQd/OU= X-IronPort-AV: E=Sophos;i="5.82,291,1613451600"; d="scan'208";a="43955845" From: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= To: CC: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= , "Christian Lindig" , David Scott , "Ian Jackson" , Wei Liu , Juergen Gross Subject: [PATCH v2 16/17] tools/ocaml/xenstored: don't store domU's mfn of ring page Date: Tue, 11 May 2021 19:05:29 +0100 Message-ID: <49200c1e5de78257fc43e26f545651484dbe4ff0.1620755943.git.edvin.torok@citrix.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) This is a port of the following C xenstored commit 122b52230aa5b79d65e18b8b77094027faa2f8e2 tools/xenstore: don't store domU's= mfn of ring page in xenstored Backwards compat: accept a domain dump both with and without MFN. CC: Juergen Gross Signed-off-by: Edwin T=C3=B6r=C3=B6k --- tools/ocaml/xenstored/domain.ml | 7 ++----- tools/ocaml/xenstored/domains.ml | 6 +++--- tools/ocaml/xenstored/process.ml | 16 +++++----------- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/tools/ocaml/xenstored/domain.ml b/tools/ocaml/xenstored/domain= .ml index 82d7b1a7ef..960ebef218 100644 --- a/tools/ocaml/xenstored/domain.ml +++ b/tools/ocaml/xenstored/domain.ml @@ -22,7 +22,6 @@ let warn fmt =3D Logging.warn "domain" fmt type t =3D { id: Xenctrl.domid; - mfn: nativeint; interface: Xenmmap.t; eventchn: Event.t; mutable remote_port: int; @@ -40,7 +39,6 @@ type t =3D let is_dom0 d =3D d.id =3D 0 let get_id domain =3D domain.id let get_interface d =3D d.interface -let get_mfn d =3D d.mfn let get_remote_port d =3D d.remote_port let get_port d =3D d.port =20 @@ -61,7 +59,7 @@ let string_of_port =3D function | Some x -> string_of_int (Xeneventchn.to_int x) =20 let dump d chan =3D - fprintf chan "dom,%d,%nd,%d\n" d.id d.mfn d.remote_port + fprintf chan "dom,%d,%d\n" d.id d.remote_port =20 let notify dom =3D match dom.port with | None -> @@ -87,9 +85,8 @@ let close dom =3D Xenmmap.unmap dom.interface; () =20 -let make id mfn remote_port interface eventchn =3D { +let make id remote_port interface eventchn =3D { id =3D id; - mfn =3D mfn; remote_port =3D remote_port; interface =3D interface; eventchn =3D eventchn; diff --git a/tools/ocaml/xenstored/domains.ml b/tools/ocaml/xenstored/domai= ns.ml index d9cb693751..0dfeed193a 100644 --- a/tools/ocaml/xenstored/domains.ml +++ b/tools/ocaml/xenstored/domains.ml @@ -124,10 +124,10 @@ let cleanup doms =3D let resume _doms _domid =3D () =20 -let create doms domid mfn port =3D +let create doms domid port =3D let mapping =3D Gnt.(Gnttab.map_exn doms.gnttab { domid; ref =3D xenstore= } true) in let interface =3D Gnt.Gnttab.Local_mapping.to_pages doms.gnttab mapping in - let dom =3D Domain.make domid mfn port interface doms.eventchn in + let dom =3D Domain.make domid port interface doms.eventchn in Hashtbl.add doms.table domid dom; Domain.bind_interdomain dom; dom @@ -147,7 +147,7 @@ let create0 doms =3D port, interface ) in - let dom =3D Domain.make 0 Nativeint.zero port interface doms.eventchn in + let dom =3D Domain.make 0 port interface doms.eventchn in Hashtbl.add doms.table 0 dom; Domain.bind_interdomain dom; Domain.notify dom; diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/proce= ss.ml index 13b7153536..890970b8c5 100644 --- a/tools/ocaml/xenstored/process.ml +++ b/tools/ocaml/xenstored/process.ml @@ -235,10 +235,6 @@ let do_debug con t _domains cons data =3D | "watches" :: _ -> let watches =3D Connections.debug cons in Some (watches ^ "\000") - | "mfn" :: domid :: _ -> - let domid =3D int_of_string domid in - let con =3D Connections.find_domain cons domid in - may (fun dom -> Printf.sprintf "%nd\000" (Domain.get_mfn dom)) (Connecti= on.get_domain con) | _ -> None with _ -> None =20 @@ -554,15 +550,13 @@ let do_introduce con t domains cons data =3D let dom =3D if Domains.exist domains domid then begin let edom =3D Domains.find domains domid in - if (Domain.get_mfn edom) =3D mfn && (Connections.find_domain cons domid= ) !=3D con then begin - (* Use XS_INTRODUCE for recreating the xenbus event-channel. *) - edom.remote_port <- port; - Domain.bind_interdomain edom; - end; + (* Use XS_INTRODUCE for recreating the xenbus event-channel. *) + edom.remote_port <- port; + Domain.bind_interdomain edom; edom end else try - let ndom =3D Domains.create domains domid mfn port in + let ndom =3D Domains.create domains domid port in Connections.add_domain cons ndom; Connections.fire_spec_watches (Transaction.get_root t) cons Store.Path.= introduce_domain; ndom @@ -571,7 +565,7 @@ let do_introduce con t domains cons data =3D Logging.debug "process" "do_introduce: %s (%s)" (Printexc.to_string e)= bt; raise Invalid_Cmd_Args in - if (Domain.get_remote_port dom) <> port || (Domain.get_mfn dom) <> mfn th= en + if (Domain.get_remote_port dom) <> port then raise Domain_not_match =20 let do_release con t domains cons data =3D --=20 2.25.1