From patchwork Fri Mar 21 15:22:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 26851 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3D2C4203AB for ; Fri, 21 Mar 2014 15:24:06 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id eb12sf9701773oac.7 for ; Fri, 21 Mar 2014 08:24:05 -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=U4B36cMBmwT851PWTdWb6hlufE7+rDpXtsRi1nvpgV8=; b=Xn+z5XS0zWHxKaGmZT6dt2paqPtqMG1qQiEy/o7s2/cQFNBKC4JOs9LP4NO9T6rGQT wrVv3n21N78BCAlGzNEVaRxBzMtVKMgujU9Sf8xAMZRYtlV/pe7ZLXK8WjmzqXS0bpy4 uBZ4jPyeUmbZ7Cb57U76dAb+AfN/A/y8JQr9l4gQdiUIsp6MzDrPjMN0FXwansqdoZHa HmqzEGeg8ROZVEBvYAmTOlFzimO4Jrt5WnarD7xukPI74UtGSSc2PbiMPJuYx6U16FQt w0MXnyX/eTErdUcWnhjBUd7oHEfYXiC0IP8HFw7RymWo6TZMI6f6tAOxdUhJ0I5kDILk mjJg== X-Gm-Message-State: ALoCoQmrMa7Zc5ACOoP7DFwcMkdToD6xphUSqnTTKhHs8or+SlaOlcxUtrKeEPjuxD3bbmJsnvyb X-Received: by 10.182.43.137 with SMTP id w9mr125587obl.29.1395415445819; Fri, 21 Mar 2014 08:24:05 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.31.37 with SMTP id e34ls629718qge.4.gmail; Fri, 21 Mar 2014 08:24:05 -0700 (PDT) X-Received: by 10.220.133.80 with SMTP id e16mr37896684vct.13.1395415445680; Fri, 21 Mar 2014 08:24:05 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id jl10si1196336veb.177.2014.03.21.08.24.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Mar 2014 08:24:05 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.176 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.176; Received: by mail-ve0-f176.google.com with SMTP id cz12so2728022veb.35 for ; Fri, 21 Mar 2014 08:24:05 -0700 (PDT) X-Received: by 10.58.247.193 with SMTP id yg1mr5576859vec.41.1395415445603; Fri, 21 Mar 2014 08:24:05 -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 i9csp39077vck; Fri, 21 Mar 2014 08:24:05 -0700 (PDT) X-Received: by 10.224.56.5 with SMTP id w5mr57765256qag.60.1395415445136; Fri, 21 Mar 2014 08:24:05 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id i5si2334190qcd.59.2014.03.21.08.24.04 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Mar 2014 08:24:05 -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 1WR1H6-00073z-HQ; Fri, 21 Mar 2014 15:22:24 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WR1H4-00072F-Jl for xen-devel@lists.xenproject.org; Fri, 21 Mar 2014 15:22:22 +0000 Received: from [85.158.137.68:49893] by server-14.bemta-3.messagelabs.com id 19/D2-30903-D295C235; Fri, 21 Mar 2014 15:22:21 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-4.tower-31.messagelabs.com!1395415340!2177810!1 X-Originating-IP: [74.125.83.48] 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 20244 invoked from network); 21 Mar 2014 15:22:21 -0000 Received: from mail-ee0-f48.google.com (HELO mail-ee0-f48.google.com) (74.125.83.48) by server-4.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 21 Mar 2014 15:22:21 -0000 Received: by mail-ee0-f48.google.com with SMTP id b57so1921914eek.35 for ; Fri, 21 Mar 2014 08:22:20 -0700 (PDT) X-Received: by 10.14.225.73 with SMTP id y49mr48200068eep.43.1395415340546; Fri, 21 Mar 2014 08:22:20 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id m8sm12218015eeg.11.2014.03.21.08.22.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Mar 2014 08:22:19 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Fri, 21 Mar 2014 15:22:12 +0000 Message-Id: <1395415334-31538-3-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395415334-31538-1-git-send-email-julien.grall@linaro.org> References: <1395415334-31538-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 v4 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.176 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 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;