From patchwork Fri Mar 21 13:05:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 26835 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 989B2206F3 for ; Fri, 21 Mar 2014 13:07:00 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id r5sf5395489qcx.9 for ; Fri, 21 Mar 2014 06:06:59 -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=/R7j8E4uP5qlgH+KSIWWwk5zOyZszDOkYLGc0MgaPJA=; b=cZb4Z6vgu1+GLQ4ZOUi6eCje5nvwld80NRdIU04DcF3WleBcAkteyAtO0MuPEacdzL Ihy8X7B9v28DcI4RBtFwt72Sr9+p1EHNAojaBKgtjsvf5LMGqosQUt5dMvlu0F2Rt7+s z5cv2bN4qsPSAppw/SzEYRCPYDNl7fDxtbaQ8DxVm1JiC19+Q62wc1ylTn709J0bYoUc tJeBrzHWgXiZObz/f62NyQ70xYV7E1DFRBNNph4YXt2pA6wwLHh7dSLnkHP/iMM8tX++ KFWBzuaWPp5nfRxfDe3WvmRFr9w+/Q+4xzfDWmfG9B3Y5NyaNBYHSuI4zsCk9iqsmCqD gfkg== X-Gm-Message-State: ALoCoQl9BB4cSRcBd4Ll8Dq5JFI+/HxtZ6UR3Sxi8gtF3jLWTwSvuLd7kZxkgfjGefb9wC1YA9NS X-Received: by 10.236.105.170 with SMTP id k30mr15957371yhg.30.1395407219914; Fri, 21 Mar 2014 06:06:59 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.81.8 with SMTP id e8ls687581qgd.39.gmail; Fri, 21 Mar 2014 06:06:59 -0700 (PDT) X-Received: by 10.58.91.101 with SMTP id cd5mr36711150veb.5.1395407219804; Fri, 21 Mar 2014 06:06:59 -0700 (PDT) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id p8si1112370vef.176.2014.03.21.06.06.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Mar 2014 06:06:59 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.179 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.179; Received: by mail-ve0-f179.google.com with SMTP id db12so2454410veb.24 for ; Fri, 21 Mar 2014 06:06:59 -0700 (PDT) X-Received: by 10.52.164.175 with SMTP id yr15mr268770vdb.59.1395407219527; Fri, 21 Mar 2014 06:06:59 -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 i9csp29332vck; Fri, 21 Mar 2014 06:06:59 -0700 (PDT) X-Received: by 10.224.87.193 with SMTP id x1mr57907016qal.70.1395407218480; Fri, 21 Mar 2014 06:06:58 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id q42si3038081qga.131.2014.03.21.06.06.58 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Mar 2014 06:06:58 -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 1WQz8S-0007Um-Lm; Fri, 21 Mar 2014 13:05:20 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WQz8P-0007TA-9C for xen-devel@lists.xenproject.org; Fri, 21 Mar 2014 13:05:17 +0000 Received: from [85.158.139.211:2905] by server-9.bemta-5.messagelabs.com id CE/86-04350-C093C235; Fri, 21 Mar 2014 13:05:16 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-8.tower-206.messagelabs.com!1395407115!2317217!1 X-Originating-IP: [74.125.83.45] 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 944 invoked from network); 21 Mar 2014 13:05:15 -0000 Received: from mail-ee0-f45.google.com (HELO mail-ee0-f45.google.com) (74.125.83.45) by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 21 Mar 2014 13:05:15 -0000 Received: by mail-ee0-f45.google.com with SMTP id d17so1794021eek.4 for ; Fri, 21 Mar 2014 06:05:15 -0700 (PDT) X-Received: by 10.15.43.77 with SMTP id w53mr47679254eev.10.1395407115266; Fri, 21 Mar 2014 06:05:15 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id w12sm11444707eez.36.2014.03.21.06.05.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Mar 2014 06:05:14 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Fri, 21 Mar 2014 13:05:06 +0000 Message-Id: <1395407109-19153-2-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395407109-19153-1-git-send-email-julien.grall@linaro.org> References: <1395407109-19153-1-git-send-email-julien.grall@linaro.org> Cc: Keir Fraser , ian.campbell@citrix.com, Julien Grall , tim@xen.org, stefano.stabellini@citrix.com, Jan Beulich , Daniel De Graaf Subject: [Xen-devel] [PATCH v3 1/4] xen/xsm: Don't use multiboot by default to initialize XSM 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.179 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: Multiboot protocol is only used by x86. When XSM support for ARM will be introduced, another way will be used to retrieve the policy blob. Introduce CONFIG_MULTIBOOT to compile XSM specific multiboot code and rename xsm_init into xsm_multiboot_init to avoid confusion. Signed-off-by: Julien Grall Acked-by: Jan Beulich Acked-by: Daniel De Graaf Acked-by: Ian Campbell Cc: Keir Fraser --- xen/arch/x86/setup.c | 2 +- xen/include/asm-x86/config.h | 2 ++ xen/include/xsm/xsm.h | 23 +++++++++++++++-------- xen/xsm/xsm_core.c | 9 ++++++--- xen/xsm/xsm_policy.c | 10 +++++++--- 5 files changed, 31 insertions(+), 15 deletions(-) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 4dbf2b7..e9c2c51 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -1251,7 +1251,7 @@ void __init noreturn __start_xen(unsigned long mbi_p) bitmap_fill(module_map, mbi->mods_count); __clear_bit(0, module_map); /* Dom0 kernel is always first */ - xsm_init(module_map, mbi, bootstrap_map); + xsm_multiboot_init(module_map, mbi, bootstrap_map); microcode_grab_module(module_map, mbi, bootstrap_map); diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h index 99d0e2c..24f95a3 100644 --- a/xen/include/asm-x86/config.h +++ b/xen/include/asm-x86/config.h @@ -52,6 +52,8 @@ #define CONFIG_KEXEC 1 #define CONFIG_WATCHDOG 1 +#define CONFIG_MULTIBOOT 1 + #define HZ 100 #define OPT_CONSOLE_STR "vga" diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 15acb3b..4863e41 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -643,11 +643,15 @@ static inline int xsm_map_gmfn_foreign (xsm_default_t def, struct domain *d, str #endif /* XSM_NO_WRAPPERS */ -extern int xsm_init(unsigned long *module_map, const multiboot_info_t *mbi, - void *(*bootstrap_map)(const module_t *)); -extern int xsm_policy_init(unsigned long *module_map, - const multiboot_info_t *mbi, - void *(*bootstrap_map)(const module_t *)); +#ifdef CONFIG_MULTIBOOT +extern int xsm_multiboot_init(unsigned long *module_map, + const multiboot_info_t *mbi, + void *(*bootstrap_map)(const module_t *)); +extern int xsm_multiboot_policy_init(unsigned long *module_map, + const multiboot_info_t *mbi, + void *(*bootstrap_map)(const module_t *)); +#endif + extern int register_xsm(struct xsm_operations *ops); extern int unregister_xsm(struct xsm_operations *ops); @@ -658,12 +662,15 @@ extern void xsm_fixup_ops(struct xsm_operations *ops); #include -static inline int xsm_init (unsigned long *module_map, - const multiboot_info_t *mbi, - void *(*bootstrap_map)(const module_t *)) +#ifdef CONFIG_MULTIBOOT +static inline int xsm_multiboot_init (unsigned long *module_map, + const multiboot_info_t *mbi, + void *(*bootstrap_map)(const module_t *)) { return 0; } +#endif + #endif /* XSM_ENABLE */ #endif /* __XSM_H */ diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c index b16c071..11a9ca7 100644 --- a/xen/xsm/xsm_core.c +++ b/xen/xsm/xsm_core.c @@ -43,8 +43,10 @@ static void __init do_xsm_initcalls(void) } } -int __init xsm_init(unsigned long *module_map, const multiboot_info_t *mbi, - void *(*bootstrap_map)(const module_t *)) +#ifdef CONFIG_MULTIBOOT +int __init xsm_multiboot_init(unsigned long *module_map, + const multiboot_info_t *mbi, + void *(*bootstrap_map)(const module_t *)) { int ret = 0; @@ -52,7 +54,7 @@ int __init xsm_init(unsigned long *module_map, const multiboot_info_t *mbi, if ( XSM_MAGIC ) { - ret = xsm_policy_init(module_map, mbi, bootstrap_map); + ret = xsm_multiboot_policy_init(module_map, mbi, bootstrap_map); if ( ret ) { bootstrap_map(NULL); @@ -75,6 +77,7 @@ int __init xsm_init(unsigned long *module_map, const multiboot_info_t *mbi, return 0; } +#endif int register_xsm(struct xsm_operations *ops) { diff --git a/xen/xsm/xsm_policy.c b/xen/xsm/xsm_policy.c index 0186f30..3d5f66a 100644 --- a/xen/xsm/xsm_policy.c +++ b/xen/xsm/xsm_policy.c @@ -19,15 +19,18 @@ */ #include +#ifdef CONFIG_MULTIBOOT #include +#endif #include char *__initdata policy_buffer = NULL; u32 __initdata policy_size = 0; -int __init xsm_policy_init(unsigned long *module_map, - const multiboot_info_t *mbi, - void *(*bootstrap_map)(const module_t *)) +#ifdef CONFIG_MULTIBOOT +int __init xsm_multiboot_policy_init(unsigned long *module_map, + const multiboot_info_t *mbi, + void *(*bootstrap_map)(const module_t *)) { int i; module_t *mod = (module_t *)__va(mbi->mods_addr); @@ -65,3 +68,4 @@ int __init xsm_policy_init(unsigned long *module_map, return rc; } +#endif