[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH for-4.15 v2] xen/dmop: Strip __XEN_TOOLS__ header guard from public API


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Wed, 10 Mar 2021 15:07:22 +0000
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>
  • Delivery-date: Wed, 10 Mar 2021 15:08:01 +0000
  • Ironport-hdrordr: A9a23:/ZREaamuNTdVcEQ4QEk+Mr6Hd+fpDfPFiWdD5ilNYBxZY6Wkvu izgfUW0gL1gj4NWHcm3euNIrWEXGm0z/4FgrU5F7GkQQXgpS+UPJhvhLGStQHINg/f0qpm1a lme7VjE9GYNykZse/W6BS1euxM/PCp66at7N2z815IbSVHL55t9B14DAHzKCxLbS1LH4AwGp bZxucvnUvWRV0tYs62BmYIUoH4zrWh/q7OWwIMBBIs9WC14w+A1biSKXel9yZbeRZ/hYwv63 HClBb0j5/Tzc2T+1v38l6W1ZVfldf6o+Eze/Cku4w0ARGpojntSahdd5e+nBYTydvfomoCoZ 3tiDNlF/s21F/rREGShnLWqkTd+Qdry1THjWWAiX/Gp8HkQT4hT/BKg5lUaHLimgIdleA58I lum1iBv55yCx7dmSjmo+fFTAtrkE2vyEBS2tI7vjhnSo0ZZ6ZWrYsDuGhcF5ANB2bG84AoHu V0Zfuslcp+QBeidHbesXBowNuwGk4rFhPDb0QessyRyVFt7QNE5npd/dcYmHgY8pI7Vt165/ /ZKOBWmKpVTskQBJgNdNspcI+MJUHmBTnNN2+TJlqPLtB9B1v976TZzZ9wyOWjeJkjxIY/lp LbQDpjxBQPUnOrM+Ki9tlm9Q3MXXWcUF3Wu7xjzqk8gJLQbv7KNjCOU18nmcfImYRiPuTrH8 ydFbgTJt2LFxqKJa95mzfQdrMXFFwlFOoSgdo/U0LmmLOzFqTa8tb1XdyWGKDgCl8fKwfCK0 pGZhffDuNa4HumX3fp6SKhI0/FSwjE8ZV8HLOyxZl19KE9crBp9iAuzXqSwOalQAcywJAeTQ 9CB5/JvryyoHW/4GrEhl8ZTiZ1PwJl6LvtVG4PiwcWP139Yd84yqCiUFEX2HOGIyl2RN/NHD heoExq+bm2I4b4/1FFN/u3dmiQj3Z7ngPCc6sh
  • Ironport-sdr: AkBwGd5Ey2RN+frF5Iv39Nmoqw0SAZemf2wQN7ng9D2kDgNykfGlSuHHiQELjWVR6YdWX8u9UC 1mV+YXVRepoza3fpurI+augkOFMahAAmOKYps8iSa4us5G57bl8cv2MeZABTEHXDKyBVVN7KVY 5USMM9GP9KxkE+LG+QXVI94bhr78U2Hp3FyepfEO81/r8aEDT9aLsOdEDOa/HbItiic6DrDfZX DShJ0umqcPqA2TaYlB6lE3tcx+lIncH69QeQpfjQpjarDsU8YVzvkxLIN0pwFUTC1GP1GhWvrp ud0=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Exactly as with c/s f40e1c52e4, this is inappropriate for a stable library.

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 <andrew.cooper3@xxxxxxxxxx>
Release-Acked-by: Ian Jackson <iwj@xxxxxxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Wei Liu <wl@xxxxxxx>
CC: Paul Durrant <paul@xxxxxxx>
CC: Ian Jackson <iwj@xxxxxxxxxxxxxx>

v2:
 * Patch dmop.pandoc as well.

For 4.15.  This is a build fix, even if current staging can't spot the
breakage.

These two issues highlight that libxendevcemodel.h has never been checked
since its introduction, because the checking logic only saw an empty file.
---
 docs/designs/dmop.pandoc         | 10 +++++++---
 tools/libs/devicemodel/private.h |  2 --
 xen/include/public/hvm/dm_op.h   |  5 -----
 3 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/docs/designs/dmop.pandoc b/docs/designs/dmop.pandoc
index 8e9f95af47..336be64397 100644
--- a/docs/designs/dmop.pandoc
+++ b/docs/designs/dmop.pandoc
@@ -4,9 +4,13 @@ DMOP
 Introduction
 ------------
 
-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 therefore
-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.
+
+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.
 
 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/private.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
 
-#define __XEN_TOOLS__ 1
-
 #include <xentoollog.h>
 #include <xendevicemodel.h>
 #include <xencall.h>
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__
 
 #include "../xen.h"
-
-#if defined(__XEN__) || defined(__XEN_TOOLS__)
-
 #include "../event_channel.h"
 
 #ifndef uint64_aligned_t
@@ -491,8 +488,6 @@ struct xen_dm_op {
     } u;
 };
 
-#endif /* __XEN__ || __XEN_TOOLS__ */
-
 struct xen_dm_op_buf {
     XEN_GUEST_HANDLE(void) h;
     xen_ulong_t size;
-- 
2.11.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.