From patchwork Fri Mar 21 13:05:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 26833 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6B96E20143 for ; Fri, 21 Mar 2014 13:05:56 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id lg15sf5474539vcb.7 for ; Fri, 21 Mar 2014 06:05:56 -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=AZ6DIrl1P19FsSnI86Oz4IvyX/W+uuK4gajzXLHEh9k=; b=EeoF93TUj/PIl2s/zt0uKVuhhPoErSIjfPffp5dOXEnNTaaibs/3+deKf1Mi+Lo33R fO6Bv0tffoVgT9xxoNcizoTwqMiJhLNQCSHTBxzF5XKknRprnG2G8XwRC+dzgE3c1tqH mdinTnywK34nOntbl1CH+aY4URLGDe9GUDv3LLeh7kvbPxZkJfIITvnUOq0PqV0Euz/8 uc9wIljrJ3c4y040clLv/xBI3igPqoCPbE0To0OgPyHq1L0N8lUSlhVIzoDrqb6lXZeV kymVL0u+siVE9tOYzxc+nX5qqRylLq7Uha8d5q+cQ2XVxaucRS+LEeCVbqDopg6sl9sW yKLg== X-Gm-Message-State: ALoCoQlzcc4bCWlAIB1q60sJoX9Vpiub7jG2yDrV85ncr/ZokPhp+HnbKCOgJEOTDRjawfzXMbHs X-Received: by 10.58.46.204 with SMTP id x12mr10344483vem.19.1395407155923; Fri, 21 Mar 2014 06:05:55 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.33 with SMTP id q30ls171268qgd.99.gmail; Fri, 21 Mar 2014 06:05:55 -0700 (PDT) X-Received: by 10.58.185.145 with SMTP id fc17mr38117463vec.14.1395407155817; Fri, 21 Mar 2014 06:05:55 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id av10si1121399ved.36.2014.03.21.06.05.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Mar 2014 06:05:55 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.169 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.169; Received: by mail-ve0-f169.google.com with SMTP id pa12so2550585veb.28 for ; Fri, 21 Mar 2014 06:05:55 -0700 (PDT) X-Received: by 10.58.185.145 with SMTP id fc17mr38117458vec.14.1395407155709; Fri, 21 Mar 2014 06:05:55 -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 i9csp29257vck; Fri, 21 Mar 2014 06:05:55 -0700 (PDT) X-Received: by 10.220.164.80 with SMTP id d16mr36853712vcy.15.1395407155224; Fri, 21 Mar 2014 06:05:55 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id b4si1100692vck.115.2014.03.21.06.05.54 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Mar 2014 06:05:55 -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 1WQz8T-0007VH-3l; Fri, 21 Mar 2014 13:05:21 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WQz8R-0007UH-PL for xen-devel@lists.xenproject.org; Fri, 21 Mar 2014 13:05:19 +0000 Received: from [193.109.254.147:37719] by server-9.bemta-14.messagelabs.com id F1/00-03644-F093C235; Fri, 21 Mar 2014 13:05:19 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-8.tower-27.messagelabs.com!1395407116!3276882!1 X-Originating-IP: [74.125.83.47] 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 14903 invoked from network); 21 Mar 2014 13:05:16 -0000 Received: from mail-ee0-f47.google.com (HELO mail-ee0-f47.google.com) (74.125.83.47) by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 21 Mar 2014 13:05:16 -0000 Received: by mail-ee0-f47.google.com with SMTP id b15so1790448eek.6 for ; Fri, 21 Mar 2014 06:05:16 -0700 (PDT) X-Received: by 10.14.7.65 with SMTP id 41mr2006213eeo.100.1395407116595; Fri, 21 Mar 2014 06:05:16 -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.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Mar 2014 06:05:15 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Fri, 21 Mar 2014 13:05:07 +0000 Message-Id: <1395407109-19153-3-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: stefano.stabellini@citrix.com, Daniel De Graaf , Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [PATCH v3 2/4] xen/xsm: Add xsm_core_init function 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.169 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: This function contains non-specific architecture code (mostly the tail of xsm_multiboot_init). It will be used later to avoid code duplication. Signed-off-by: Julien Grall Acked-by: Ian Campbell Cc: Daniel De Graaf Acked-by: Daniel De Graaf --- Changes in v2: - Patch added --- xen/xsm/xsm_core.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c index 11a9ca7..24b0ff4 100644 --- a/xen/xsm/xsm_core.c +++ b/xen/xsm/xsm_core.c @@ -43,6 +43,21 @@ static void __init do_xsm_initcalls(void) } } +static int __init xsm_core_init(void) +{ + if ( verify(&dummy_xsm_ops) ) + { + printk("%s could not verify " + "dummy_xsm_ops structure.\n", __FUNCTION__); + return -EIO; + } + + xsm_ops = &dummy_xsm_ops; + do_xsm_initcalls(); + + return 0; +} + #ifdef CONFIG_MULTIBOOT int __init xsm_multiboot_init(unsigned long *module_map, const multiboot_info_t *mbi, @@ -63,16 +78,7 @@ int __init xsm_multiboot_init(unsigned long *module_map, } } - if ( verify(&dummy_xsm_ops) ) - { - bootstrap_map(NULL); - printk("%s could not verify " - "dummy_xsm_ops structure.\n", __FUNCTION__); - return -EIO; - } - - xsm_ops = &dummy_xsm_ops; - do_xsm_initcalls(); + ret = xsm_core_init(); bootstrap_map(NULL); return 0;