From patchwork Thu Jan 26 13:26:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Boris Ostrovsky X-Patchwork-Id: 9539253 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A0D1F604A0 for ; Thu, 26 Jan 2017 13:28:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2C16201BD for ; Thu, 26 Jan 2017 13:28:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 979852818E; Thu, 26 Jan 2017 13:28:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2B5F5201BD for ; Thu, 26 Jan 2017 13:28:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWk43-0000Zv-9J; Thu, 26 Jan 2017 13:26:11 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWk42-0000Zo-5d for xen-devel@lists.xenproject.org; Thu, 26 Jan 2017 13:26:10 +0000 Received: from [85.158.137.68] by server-13.bemta-3.messagelabs.com id 37/E0-25657-1F8F9885; Thu, 26 Jan 2017 13:26:09 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCIsWRWlGSWpSXmKPExsUyZ7p8oO6HH50 RBiuOm1l83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBkX3rUzFSyXrdi1TaaB8Y9kFyMXh5DARCaJ 3b9eMEM4vxkljry6zQbhbGSUmHBmDzuEs51R4tPcdUxdjJwcwgKhEo9n72IFsUUEvCQa1vyFK mpilLi97w1YO7NAJ6PEwi+zWECq2ASMJM4enc7YxcjBwStgK7FmuiZImEVAVaJx8gt2EFtUIF zi/ayFbCA2r4CgxMmZT8BaOQXcJb5dn8sMYjMLqEv8mXcJypaXaN46G8yWEDCUOP1wG+MERsF ZSNpnIWmZhaRlASPzKkb14tSistQiXQu9pKLM9IyS3MTMHF1DA2O93NTi4sT01JzEpGK95Pzc TYzA0GUAgh2MF9qdDzFKcjApifLe1O6MEOJLyk+pzEgszogvKs1JLT7EKMPBoSTB+/Y7UE6wK DU9tSItMwcYRTBpCQ4eJRFeRmAkCfEWFyTmFmemQ6ROMSpKifPygyQEQBIZpXlwbbDIvcQoKy XMywh0iBBPQWpRbmYJqvwrRnEORiVhiPE8mXklcNNfAS1mAlp8gbkdZHFJIkJKqoFxI3fkCW4 1/ux7DVfzJ2hMirU/Gnpvtg9DE1+9wyTx60/O8j3f90Es82SaVYK25+/iLSUb3i6smCrVI2q6 07VriVg307xZ9QWn7Tds2qkhOof5X8+3pqetQYtvJvHX/LSZZvx8b8zxXeKPP9qrVvj/1l18d tn2Oae/2LwN/O+25OyVztf8RV28SizFGYmGWsxFxYkAypaO0NcCAAA= X-Env-Sender: boris.ostrovsky@oracle.com X-Msg-Ref: server-8.tower-31.messagelabs.com!1485437166!82580576!1 X-Originating-IP: [156.151.31.81] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 16459 invoked from network); 26 Jan 2017 13:26:08 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-8.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 26 Jan 2017 13:26:08 -0000 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v0QDQ2DH009580 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Jan 2017 13:26:03 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v0QDQ2ha031601 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Jan 2017 13:26:02 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v0QDQ113015950; Thu, 26 Jan 2017 13:26:02 GMT Received: from dhcp-burlington7-2nd-B-east-10-152-55-162.usdhcp.oraclecorp.com (/10.152.20.106) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 26 Jan 2017 05:26:01 -0800 To: Paul Durrant , xen-devel@lists.xenproject.org References: <1485271630-1860-1-git-send-email-paul.durrant@citrix.com> <1485271630-1860-2-git-send-email-paul.durrant@citrix.com> From: Boris Ostrovsky Message-ID: Date: Thu, 26 Jan 2017 08:26:10 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1485271630-1860-2-git-send-email-paul.durrant@citrix.com> X-Source-IP: userv0021.oracle.com [156.151.31.71] Cc: Ian Jackson , Jennifer Herbert , Jan Beulich Subject: Re: [Xen-devel] [PATCH v8 1/8] public / x86: Introduce __HYPERCALL_dm_op... X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP On 01/24/2017 10:27 AM, Paul Durrant wrote: > ...as a set of hypercalls to be used by a device model. > > As stated in the new docs/designs/dm_op.markdown: > > "The aim of DMOP is to prevent a compromised device model from > compromising domains other then the one it is associated with. (And is > therefore likely already compromised)." > > See that file for further information. > > This patch simply adds the boilerplate for the hypercall. > > Signed-off-by: Paul Durrant > Suggested-by: Ian Jackson > Suggested-by: Jennifer Herbert > Acked-by: Daniel De Graaf > Acked-by: Wei Liu > Reviewed-by: Andrew Cooper This patch (and possibly others in the series) break FLASK-enabled build. First, this > diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h > index 95460af..b206f5a 100644 > --- a/xen/include/xsm/dummy.h > +++ b/xen/include/xsm/dummy.h > @@ -727,6 +727,12 @@ static XSM_INLINE int xsm_pmu_op (XSM_DEFAULT_ARG struct domain *d, unsigned int > } > } > > +static XSM_INLINE int xsm_dm_op(XSM_DEFAULT_ARG struct domain *d) > +{ > + XSM_ASSERT_ACTION(XSM_DM_PRIV); > + return xsm_default_action(action, current->domain, d); > +} > + > generates /home/build/xtt-x86_64/bootstrap/xen.git/xen/include/xsm/dummy.h:700: error: ‘xsm_dm_op’ defined but not used and I think needs And then make[4]: Entering directory `/home/build/xtt-x86_64/bootstrap/xen.git/xen/xsm/flask' gcc -m64 -DBUILD_ID -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -O1 -nostdinc -fno-builtin -fno-common -Werror -Wredundant-decls -Wno-pointer-arith -pipe -g -D__XEN__ -include /home/build/xtt-x86_64/bootstrap/xen.git/xen/include/xen/config.h '-D__OBJECT_FILE__="hooks.o"' -Wa,--strip-local-absolute -fno-omit-frame-pointer -MMD -MF ./.hooks.o.d -I/home/build/xtt-x86_64/bootstrap/xen.git/xen/include -I/home/build/xtt-x86_64/bootstrap/xen.git/xen/include/asm-x86/mach-generic -I/home/build/xtt-x86_64/bootstrap/xen.git/xen/include/asm-x86/mach-default '-D__OBJECT_LABEL__=xsm$flask$hooks.o' -msoft-float -fno-stack-protector -fno-exceptions -Wnested-externs -DHAVE_GAS_VMX -DHAVE_GAS_SSE4_2 -DHAVE_GAS_EPT -mno-red-zone -mno-sse -fpic -fno-asynchronous-unwind-tables -DGCC_HAS_VISIBILITY_ATTRIBUTE -I./include -c hooks.c -o hooks.o hooks.c: In function ‘flask_dm_op’: hooks.c:1613: error: ‘HVM__DM’ undeclared (first use in this function) hooks.c:1613: error: (Each undeclared identifier is reported only once hooks.c:1613: error: for each function it appears in.) hooks.c: At top level: hooks.c:1779: error: unknown field ‘hvm_set_pci_intx_level’ specified in initializer hooks.c:1779: error: ‘flask_hvm_set_pci_intx_level’ undeclared here (not in a function) hooks.c:1780: error: unknown field ‘hvm_set_isa_irq_level’ specified in initializer hooks.c:1780: error: ‘flask_hvm_set_isa_irq_level’ undeclared here (not in a function) hooks.c:1781: error: unknown field ‘hvm_set_pci_link_route’ specified in initializer hooks.c:1781: error: ‘flask_hvm_set_pci_link_route’ undeclared here (not in a function) make[4]: *** [hooks.o] Error 1 -boris diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c index 1f659c7..3cb5492 100644 --- a/xen/xsm/dummy.c +++ b/xen/xsm/dummy.c @@ -156,6 +156,7 @@ void __init xsm_fixup_ops (struct xsm_operations *ops) set_to_dummy_if_null(ops, ioport_permission); set_to_dummy_if_null(ops, ioport_mapping); set_to_dummy_if_null(ops, pmu_op); + set_to_dummy_if_null(ops, dm_op); #endif set_to_dummy_if_null(ops, xen_version); }