From patchwork Wed Mar 12 16:16:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 26151 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f199.google.com (mail-yk0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 403ED203AB for ; Wed, 12 Mar 2014 16:18:26 +0000 (UTC) Received: by mail-yk0-f199.google.com with SMTP id 200sf54727713ykr.2 for ; Wed, 12 Mar 2014 09:18:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :list-archive:content-type:content-transfer-encoding; bh=ahrpMqhYzlZ1aImWnP7Guq/86apwzhsBkssBZZqXLRQ=; b=fG3bT43PbDo5CbkR9/NqhQOwDYFCtiwSko6UnJbG3ZYq+xzgWtBLaFtZX8O+FLjbq3 33E/Ki194JsTGjrrXKrjN/CLhBIB9MDrVr2ZOm3xpvitep7yWT5vg6JRGD4TisGXelNt dBdlQYAYgbN8L6eEyfUpuD3arBnM6D2YRei6Dd+UOKR6wfohgZ5GKcuuxhnsYT/jZYWN z+eDMx4Zsx9LAT+oC0A0mNc0alJoM+9S5o3leSIQB3vmG2fJhosBu9FBvB81rbCb6zU6 6haAtiw2WMOmGAAMmRlfeRgkAOqDUGO8Zh2CvMF5UO/R2Xv+Twy1wJtvK81+VRdJikdR VqYA== X-Gm-Message-State: ALoCoQlQ8Oq5VQcOviLQjyAHvxve8F/FGXFNM1/XyrzoXl7Z+M7jd9d/NR9hHatFPURCCIAY77Im X-Received: by 10.52.29.16 with SMTP id f16mr16826423vdh.8.1394641105998; Wed, 12 Mar 2014 09:18:25 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.92.133 with SMTP id b5ls2538101qge.38.gmail; Wed, 12 Mar 2014 09:18:25 -0700 (PDT) X-Received: by 10.52.27.9 with SMTP id p9mr1811655vdg.28.1394641105799; Wed, 12 Mar 2014 09:18:25 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id j20si6929052vcx.94.2014.03.12.09.18.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 09:18:25 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id il7so5299096vcb.4 for ; Wed, 12 Mar 2014 09:18:25 -0700 (PDT) X-Received: by 10.52.136.180 with SMTP id qb20mr135605vdb.83.1394641105697; Wed, 12 Mar 2014 09:18:25 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp301398vck; Wed, 12 Mar 2014 09:18:25 -0700 (PDT) X-Received: by 10.58.37.232 with SMTP id b8mr1510183vek.27.1394641105381; Wed, 12 Mar 2014 09:18:25 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id xb4si3942083vdc.25.2014.03.12.09.18.24 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 12 Mar 2014 09:18:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WNlpY-0007J7-FQ; Wed, 12 Mar 2014 16:16:32 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WNlpX-0007Hu-4N for xen-devel@lists.xenproject.org; Wed, 12 Mar 2014 16:16:31 +0000 Received: from [193.109.254.147:20056] by server-12.bemta-14.messagelabs.com id E6/E7-17220-E5880235; Wed, 12 Mar 2014 16:16:30 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-6.tower-27.messagelabs.com!1394640989!1237650!1 X-Originating-IP: [209.85.212.174] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 30142 invoked from network); 12 Mar 2014 16:16:29 -0000 Received: from mail-wi0-f174.google.com (HELO mail-wi0-f174.google.com) (209.85.212.174) by server-6.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 12 Mar 2014 16:16:29 -0000 Received: by mail-wi0-f174.google.com with SMTP id d1so2643348wiv.1 for ; Wed, 12 Mar 2014 09:16:29 -0700 (PDT) X-Received: by 10.180.87.164 with SMTP id az4mr5007756wib.2.1394640988958; Wed, 12 Mar 2014 09:16:28 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id dk9sm70840335wjb.4.2014.03.12.09.16.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Mar 2014 09:16:27 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 12 Mar 2014 16:16:01 +0000 Message-Id: <1394640969-25583-7-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1394640969-25583-1-git-send-email-julien.grall@linaro.org> References: <1394640969-25583-1-git-send-email-julien.grall@linaro.org> Cc: stefano.stabellini@citrix.com, Daniel De Graaf , Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [RFC 06/14] xen/xsm: xsm_do_mca is x86 specific X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: xsm_do_mca is only used by x86. Only define the function for x86 to avoid usage on ARM. Signed-off-by: Julien Grall Cc: Daniel De Graaf Acked-by: Daniel De Graaf Acked-by: Ian Campbell --- xen/include/xsm/dummy.h | 12 ++++++------ xen/include/xsm/xsm.h | 12 ++++++------ xen/xsm/dummy.c | 2 +- xen/xsm/flask/hooks.c | 12 ++++++------ 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h index 76f9280..e722155 100644 --- a/xen/include/xsm/dummy.h +++ b/xen/include/xsm/dummy.h @@ -140,12 +140,6 @@ static XSM_INLINE int xsm_readconsole(XSM_DEFAULT_ARG uint32_t clear) return xsm_default_action(action, current->domain, NULL); } -static XSM_INLINE int xsm_do_mca(XSM_DEFAULT_VOID) -{ - XSM_ASSERT_ACTION(XSM_PRIV); - return xsm_default_action(action, current->domain, NULL); -} - static XSM_INLINE int xsm_alloc_security_domain(struct domain *d) { return 0; @@ -496,6 +490,12 @@ static XSM_INLINE int xsm_hvm_param_nested(XSM_DEFAULT_ARG struct domain *d) } #ifdef CONFIG_X86 +static XSM_INLINE int xsm_do_mca(XSM_DEFAULT_VOID) +{ + XSM_ASSERT_ACTION(XSM_PRIV); + return xsm_default_action(action, current->domain, NULL); +} + static XSM_INLINE int xsm_shadow_control(XSM_DEFAULT_ARG struct domain *d, uint32_t op) { XSM_ASSERT_ACTION(XSM_HOOK); diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 11218b6..15acb3b 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -61,7 +61,6 @@ struct xsm_operations { int (*domctl) (struct domain *d, int cmd); int (*sysctl) (int cmd); int (*readconsole) (uint32_t clear); - int (*do_mca) (void); int (*evtchn_unbound) (struct domain *d, struct evtchn *chn, domid_t id2); int (*evtchn_interdomain) (struct domain *d1, struct evtchn *chn1, @@ -139,6 +138,7 @@ struct xsm_operations { int (*hvm_param_nested) (struct domain *d); #ifdef CONFIG_X86 + int (*do_mca) (void); int (*shadow_control) (struct domain *d, uint32_t op); int (*hvm_set_pci_intx_level) (struct domain *d); int (*hvm_set_isa_irq_level) (struct domain *d); @@ -223,11 +223,6 @@ static inline int xsm_readconsole (xsm_default_t def, uint32_t clear) return xsm_ops->readconsole(clear); } -static inline int xsm_do_mca(xsm_default_t def) -{ - return xsm_ops->do_mca(); -} - static inline int xsm_evtchn_unbound (xsm_default_t def, struct domain *d1, struct evtchn *chn, domid_t id2) { @@ -524,6 +519,11 @@ static inline int xsm_hvm_param_nested (xsm_default_t def, struct domain *d) } #ifdef CONFIG_X86 +static inline int xsm_do_mca(xsm_default_t def) +{ + return xsm_ops->do_mca(); +} + static inline int xsm_shadow_control (xsm_default_t def, struct domain *d, uint32_t op) { return xsm_ops->shadow_control(d, op); diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c index 627edcc..b79e10f 100644 --- a/xen/xsm/dummy.c +++ b/xen/xsm/dummy.c @@ -38,7 +38,6 @@ void xsm_fixup_ops (struct xsm_operations *ops) set_to_dummy_if_null(ops, domctl); set_to_dummy_if_null(ops, sysctl); set_to_dummy_if_null(ops, readconsole); - set_to_dummy_if_null(ops, do_mca); set_to_dummy_if_null(ops, evtchn_unbound); set_to_dummy_if_null(ops, evtchn_interdomain); @@ -115,6 +114,7 @@ void xsm_fixup_ops (struct xsm_operations *ops) set_to_dummy_if_null(ops, remove_from_physmap); #ifdef CONFIG_X86 + set_to_dummy_if_null(ops, do_mca); set_to_dummy_if_null(ops, shadow_control); set_to_dummy_if_null(ops, hvm_set_pci_intx_level); set_to_dummy_if_null(ops, hvm_set_isa_irq_level); diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index 7329f31..65343f3 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -798,11 +798,6 @@ static int flask_readconsole(uint32_t clear) return domain_has_xen(current->domain, perms); } -static int flask_do_mca(void) -{ - return domain_has_xen(current->domain, XEN__MCA_OP); -} - static inline u32 resource_to_perm(uint8_t access) { if ( access ) @@ -1169,6 +1164,11 @@ static int flask_deassign_device(struct domain *d, uint32_t machine_bdf) #endif /* HAS_PASSTHROUGH && HAS_PCI */ #ifdef CONFIG_X86 +static int flask_do_mca(void) +{ + return domain_has_xen(current->domain, XEN__MCA_OP); +} + static int flask_shadow_control(struct domain *d, uint32_t op) { u32 perm; @@ -1472,7 +1472,6 @@ static struct xsm_operations flask_ops = { .domctl = flask_domctl, .sysctl = flask_sysctl, .readconsole = flask_readconsole, - .do_mca = flask_do_mca, .evtchn_unbound = flask_evtchn_unbound, .evtchn_interdomain = flask_evtchn_interdomain, @@ -1551,6 +1550,7 @@ static struct xsm_operations flask_ops = { #endif #ifdef CONFIG_X86 + .do_mca = flask_do_mca, .shadow_control = flask_shadow_control, .hvm_set_pci_intx_level = flask_hvm_set_pci_intx_level, .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,