From patchwork Mon Mar 17 14:05:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 26368 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3C897202FA for ; Mon, 17 Mar 2014 14:07:32 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id f11sf12206340qae.7 for ; Mon, 17 Mar 2014 07:07:31 -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=ZPOoanzBliLYxV46HsrAGdc4oAqtuD6KBRbmQx6zZZs=; b=JDha+Lquz5k7qBW9/miBq5qt+VMaN4maTLWK/GSJ5fuAu44sGzTC7hxMZakhyB3DeW eBefLCVc2cUokXfIntoiWTOw88axeWsb6mkwpp7JaU1B2Z1ktabY5qpvFdoEAGSVZ2On gs1wqRhEi3j0Z2FICVR8p1ddxTQ/HrISN1lF5youdoDaohxnrpIraSyvseLsl/FLzrpa jGx2eCINBf+tiAGkbIZ5nkgChaFklOEvu/NVMHal6vLwr/Wi7t6A1H1uVAaB27NuFU50 YoXWyq9feFbOHD5FZMl7x102WvbjqhJ6ttLOjgHlc6XxOjj0NzfopQ4ysGOhYIRcrm5M NRmw== X-Gm-Message-State: ALoCoQm+DXjjFeHnBMc+vVc4Yp841G4h/zendFCUYqfpy42u6Nn7ai+8zI4O/OOn9f3cBfe2fyN9 X-Received: by 10.58.195.202 with SMTP id ig10mr9893032vec.38.1395065251971; Mon, 17 Mar 2014 07:07:31 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.40.11 with SMTP id w11ls1660632qgw.42.gmail; Mon, 17 Mar 2014 07:07:31 -0700 (PDT) X-Received: by 10.220.88.204 with SMTP id b12mr19808002vcm.3.1395065251852; Mon, 17 Mar 2014 07:07:31 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id dd4si5270640vcb.145.2014.03.17.07.07.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Mar 2014 07:07:31 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id jw12so5829148veb.13 for ; Mon, 17 Mar 2014 07:07:31 -0700 (PDT) X-Received: by 10.220.106.84 with SMTP id w20mr20098264vco.18.1395065251761; Mon, 17 Mar 2014 07:07:31 -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 i9csp130038vck; Mon, 17 Mar 2014 07:07:31 -0700 (PDT) X-Received: by 10.140.47.20 with SMTP id l20mr27319529qga.9.1395065251316; Mon, 17 Mar 2014 07:07:31 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id f6si8591051qap.168.2014.03.17.07.07.30 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 17 Mar 2014 07:07:31 -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 1WPYBS-0002ID-FE; Mon, 17 Mar 2014 14:06:30 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WPYBQ-0002Fh-Sr for xen-devel@lists.xenproject.org; Mon, 17 Mar 2014 14:06:29 +0000 Received: from [85.158.143.35:35795] by server-2.bemta-4.messagelabs.com id A4/10-06539-06107235; Mon, 17 Mar 2014 14:06:24 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-9.tower-21.messagelabs.com!1395065183!2615488!1 X-Originating-IP: [74.125.83.46] 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 17479 invoked from network); 17 Mar 2014 14:06:24 -0000 Received: from mail-ee0-f46.google.com (HELO mail-ee0-f46.google.com) (74.125.83.46) by server-9.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 17 Mar 2014 14:06:24 -0000 Received: by mail-ee0-f46.google.com with SMTP id t10so4092435eei.5 for ; Mon, 17 Mar 2014 07:06:23 -0700 (PDT) X-Received: by 10.14.224.6 with SMTP id w6mr24248731eep.60.1395065183737; Mon, 17 Mar 2014 07:06:23 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id x3sm39716538eep.17.2014.03.17.07.06.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Mar 2014 07:06:22 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 17 Mar 2014 14:05:56 +0000 Message-Id: <1395065165-15915-7-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395065165-15915-1-git-send-email-julien.grall@linaro.org> References: <1395065165-15915-1-git-send-email-julien.grall@linaro.org> Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [PATCH v2 06/15] 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.128.182 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 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,