From patchwork Sat Sep 15 15:34:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 1462111 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 72E61E00A6 for ; Sat, 15 Sep 2012 15:39:55 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TCuP7-0007lb-VF; Sat, 15 Sep 2012 15:35:34 +0000 Received: from mail-qa0-f49.google.com ([209.85.216.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TCuOX-0007gb-5T for linux-arm-kernel@lists.infradead.org; Sat, 15 Sep 2012 15:34:57 +0000 Received: by mail-qa0-f49.google.com with SMTP id k1so580016qaf.15 for ; Sat, 15 Sep 2012 08:34:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:date:message-id:in-reply-to:references:user-agent :mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=5q2Ft2g+h8BVspVw0PH4hShS8ra8gEjFu4BG+hTH51s=; b=PlRPdcyZDAmCFgVaCTfhQ9lwrmlMFIR6Cf6JghumJC9VuKtI4lbuN5AI68vv4T7pa8 SLMko0EjPj6/BDPPu+Rq6F7IcExRfPhc/IkhIvBj5Gn7EKjEjw2J8Rc7ZaVGR5nEMZ+B bgB5n0ryfsawmnlZVbpbclYImqxDdcqWTEuLEtE3/I+Im02JWK/jR/JTGcCAbTQ83LMv wm9bjsOefGI9Zf6gdpr5wiOc4wSBRiCnK+koevpFPs/YKYLRH7qptawYBv7hp+VcsqME f7SER1D6aHasx1l7HuRyRd7mwNSBSDjf6Nkcl6YHWwGRMYN/ZfftXKs+TrjPG2q7o/oh c4eg== Received: by 10.224.181.70 with SMTP id bx6mr15083600qab.79.1347723296963; Sat, 15 Sep 2012 08:34:56 -0700 (PDT) Received: from [127.0.1.1] (pool-72-80-83-148.nycmny.fios.verizon.net. [72.80.83.148]) by mx.google.com with ESMTPS id eh7sm6995514qab.13.2012.09.15.08.34.56 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 15 Sep 2012 08:34:56 -0700 (PDT) Subject: [PATCH 04/15] ARM: idmap: only initialize HYP idmap when HYP mode is available To: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu From: Christoffer Dall Date: Sat, 15 Sep 2012 11:34:55 -0400 Message-ID: <20120915153455.21241.27798.stgit@ubuntu> In-Reply-To: <20120915153359.21241.86002.stgit@ubuntu> References: <20120915153359.21241.86002.stgit@ubuntu> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnj2AFik+JCLKQwNS7EepooQmiNfXuMiXKK9ENYnmgsuyIvQTRehAp1/XGe60/xk8Lt6JXh X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.216.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Marc Zyngier Signed-off-by: Marc Zyngier --- arch/arm/mm/idmap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/mm/idmap.c b/arch/arm/mm/idmap.c index 7a944af..95e8d67 100644 --- a/arch/arm/mm/idmap.c +++ b/arch/arm/mm/idmap.c @@ -8,6 +8,7 @@ #include #include #include +#include pgd_t *idmap_pgd; @@ -149,6 +150,9 @@ EXPORT_SYMBOL_GPL(hyp_idmap_setup); static int __init hyp_init_static_idmap(void) { + if (!is_hyp_mode_available()) + return 0; + hyp_pgd = kzalloc(PTRS_PER_PGD * sizeof(pgd_t), GFP_KERNEL); if (!hyp_pgd) return -ENOMEM;