From nobody Mon May 6 01:18:46 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=1615469086; cv=none; d=zohomail.com; s=zohoarc; b=cEkNidyMRwzLH6Am18jFz7aScz0Gacsc0DLMuAieMiV2j5UOi/jwmxUHEkUKMeqCqvf6KPERjlYL/dBk8VIqfrDsU6V/DWrXwIjy0l7IYKReF2/KU+aqVgHtBT79sq/P5/hrOZHREK4pln5pcK6RPrvO+KIGotGh/9Rn+Hjxm0E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615469086; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=DQh4XbjOuNspI35DIH/yji1C3CPte87QKIVddJdshh0=; b=hwLVe7g1GYJlTieOI9REb/MRIWHyPShZWt7wEbkAQ8ZFj9QEMh/P1UqQEKGHDJ3pgDw9zhLtMYU8LUEB22UymNMwUJ89YHkYdVzX5/whvFNPO5ZHHzyYhCu0qtW5pnvZF3dhLLiOKM58U2UNkMmVGpYKi/JvQkysqvsPe/Sx7bU= 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 1615469086952424.807679918022; Thu, 11 Mar 2021 05:24:46 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.96537.182693 (Exim 4.92) (envelope-from ) id 1lKLIc-0005DV-9T; Thu, 11 Mar 2021 13:24:22 +0000 Received: by outflank-mailman (output) from mailman id 96537.182693; Thu, 11 Mar 2021 13:24:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lKLIc-0005DO-6c; Thu, 11 Mar 2021 13:24:22 +0000 Received: by outflank-mailman (input) for mailman id 96537; Thu, 11 Mar 2021 13:24:21 +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.92) (envelope-from ) id 1lKLIb-0005DJ-0u for xen-devel@lists.xenproject.org; Thu, 11 Mar 2021 13:24:21 +0000 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id c22d0991-3472-460f-945e-79071deafbc7; Thu, 11 Mar 2021 13:24:20 +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: c22d0991-3472-460f-945e-79071deafbc7 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1615469060; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=tHuesWFQA7Mchpj7f9p42VhfotJUCO8dFEjaWBOOtbk=; b=JiaM2ZbWnbL4o0Je2XryioliSioJddRy5DwXMYPUd4G531PnUwI5mjvE lKshG0Pn8D3mAN+33H1CXfWAkkaPrXqSQqyR7+awEFubi0okZMwVDfZHZ GUlr/N20xqm9B8o1J73aIazz7FwK4Q51wKJCvX0MyJJnF9OUDS1gNCfpA 8=; Authentication-Results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: dUgzisvD0S1vEDYgMEc8CmpC7u30st7aWwqcP/AXZ3LPIdkqYqSYlvxMNKdt8y15OUEfnizyL+ ZZvWQnY5PtLlrptKZjNMYKvOGbPcnMnfgpTiuUKsw+0Ilw3a1RRUg24MA8IEKmge+3yZAHdOLX tdVOHpkHyfVaf057qqJiqaVHusW53Q3n969+YPWNEuCHTnaSZ/SZwJglsJZoEstCEtrZLWyc1v p5cMCfr4EBAxlH3mcGI/qCQMHzL8f2Fql8iE95puSMIS8ULDlggnRXheg8ckubxUr+olRvLpRe VwY= X-SBRS: 4.0 X-MesageID: 39228458 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED IronPort-HdrOrdr: A9a23:TEhs7aNpDdmDn8BcTxP155DYdL4zR+YMi2QD/1xtSBBTb8yTn9 2vmvNe7hPvlDMNQhgb9OyoEqPoexPh3LRy5pQcOqrnYRn+tAKTXeVfxKbB4xmlIS3x8eZByb xtGpIVNPTcBUV35PyU3CCWCNAlqePozImNpcPzi0hgVhtrbaYI1XYdNi++HldtTAdLQboVfa DshfZvnDardXQJYsnTPBBsM9TrnNHXiIngJScPGh9P0mKzpAm14733GQXw5GZ9bxpzx94ZkF TtokjCyYiI99q6zRLd0GG71eUqpPLRjuFtKebJpswcKjDHghulaoJ7S9S5zUwIidDq0nkGup 3hpAohItRS5hrqDx6IiCqo4SbM+nIP7GLv0lCRi3eLm72GeBsKT/BvqKgcVzmx0TtGgPhMlJ hl8kjcir9sSTTHpyj578igbWAQqmOE5UAMvMRWs2ZSSuIlGdlshL1axmx5OrEaEhn37Yg2ed Medv301bJtfVSWY2uxhBgX/PWcGnA6HhKxSkMfoMCi0z9PgHBjz0cDrfZv5ks9yA== X-IronPort-AV: E=Sophos;i="5.81,240,1610427600"; d="scan'208";a="39228458" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , Paul Durrant , Ian Jackson Subject: [PATCH for-4.15 v3] xen/dmop: Strip __XEN_TOOLS__ header guard from public ABI Date: Thu, 11 Mar 2021 13:24:00 +0000 Message-ID: <20210311132400.24411-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) __XEN_TOOLS__ is really there to separate the unstable from stable hypercal= ls. Exactly as with c/s f40e1c52e4, stable interfaces shouldn't contain this guard. That change actually broke the build with: include/xendevicemodel.h:52:5: error: unknown type name 'ioservid_t' ioservid_t *id); ^ as libxendevicemodel.h now uses a type it can't see a typedef for. However, nothing noticed because the header.chk logic is also broken (fixed subsequently). Strip the guard from the public header, and remove compensation from devicemodel's private.h. Fix the dmop design doc to discuss both reasons behind the the ABI design. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich Release-Acked-by: Ian Jackson Reviewed-by: Paul Durrant --- CC: Jan Beulich CC: Roger Pau Monn=C3=A9 CC: Wei Liu CC: Paul Durrant CC: Ian Jackson v3: * Clarifications to the commit message, and dmop.pandoc v2: * Patch dmop.pandoc as well. --- docs/designs/dmop.pandoc | 12 +++++++++--- tools/libs/devicemodel/private.h | 2 -- xen/include/public/hvm/dm_op.h | 5 ----- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/docs/designs/dmop.pandoc b/docs/designs/dmop.pandoc index 8e9f95af47..49e52b1bcc 100644 --- a/docs/designs/dmop.pandoc +++ b/docs/designs/dmop.pandoc @@ -4,9 +4,15 @@ DMOP Introduction ------------ =20 -The aim of DMOP is to prevent a compromised device model from compromising -domains other than the one it is providing emulation for (which is therefo= re -likely already compromised). +The DMOP hypercall has a new ABI design to solve problems in the Xen +ecosystem. First, the ABI is fully stable, to reduce the coupling between +device models and the version of Xen. Specifically, device model software +using DMOP (be it user, stub domain or kernel software) need not be recomp= iled +to match the version of the running hypervisor. + +Secondly, for device models in userspace, the ABI is designed specifically= to +allow a kernel to audit the memory ranges used, without having to know the +internal structure of sub-ops. =20 The problem occurs when you a device model issues an hypercall that includes references to user memory other than the operation structure diff --git a/tools/libs/devicemodel/private.h b/tools/libs/devicemodel/priv= ate.h index c4a225f8af..c24f3396bb 100644 --- a/tools/libs/devicemodel/private.h +++ b/tools/libs/devicemodel/private.h @@ -1,8 +1,6 @@ #ifndef XENDEVICEMODEL_PRIVATE_H #define XENDEVICEMODEL_PRIVATE_H =20 -#define __XEN_TOOLS__ 1 - #include #include #include diff --git a/xen/include/public/hvm/dm_op.h b/xen/include/public/hvm/dm_op.h index ef7fbc0d3d..fa3f083fed 100644 --- a/xen/include/public/hvm/dm_op.h +++ b/xen/include/public/hvm/dm_op.h @@ -25,9 +25,6 @@ #define __XEN_PUBLIC_HVM_DM_OP_H__ =20 #include "../xen.h" - -#if defined(__XEN__) || defined(__XEN_TOOLS__) - #include "../event_channel.h" =20 #ifndef uint64_aligned_t @@ -491,8 +488,6 @@ struct xen_dm_op { } u; }; =20 -#endif /* __XEN__ || __XEN_TOOLS__ */ - struct xen_dm_op_buf { XEN_GUEST_HANDLE(void) h; xen_ulong_t size; --=20 2.11.0