From patchwork Sat Sep 15 15:34:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 1462131 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 704F33FC33 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 1TCuOT-0007gY-0u; Sat, 15 Sep 2012 15:34:53 +0000 Received: from mail-qc0-f177.google.com ([209.85.216.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TCuOF-0007fd-8Q for linux-arm-kernel@lists.infradead.org; Sat, 15 Sep 2012 15:34:40 +0000 Received: by qcsu28 with SMTP id u28so3767182qcs.36 for ; Sat, 15 Sep 2012 08:34:38 -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=i9bqsdDcR+NGVGezfMj6/6m9TuSEPVnoxgw0PWRz1bA=; b=K7hhiFvecvrgLsXUBVl7PFK6YDgw+1ikneCVzg81GFEMiJsa5z69NeTqpabHGQXMUc SWoR/JOk8nIJbJXTiLx5Vgb2/zYL2IbvM44/VHYAoHxRxtoPndBUJX4pqOsFA/beDKQK ROsSFscyk/XegstPwrqNSxoHnPj2VR0Oac8HUF9hZiA4PKrg4HfThZ3xAiDEhZJuymoL xT2dDg+rqKUhTWohabTfJuhODtYwNQP52NMgMZf6Cb8TKHeYxiCcjGSybRDamPikHso2 sr8nWxLQ1vPKHJwFMapDCB2fE0Y8BLn37WHk/YUzgyC+xnGhQPJQw9NMM1fJZKynXpZI 0NkA== Received: by 10.224.31.210 with SMTP id z18mr15157191qac.95.1347723277988; Sat, 15 Sep 2012 08:34:37 -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 et6sm6998275qab.8.2012.09.15.08.34.37 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 15 Sep 2012 08:34:37 -0700 (PDT) Subject: [PATCH 01/15] ARM: add mem_type prot_pte accessor 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:36 -0400 Message-ID: <20120915153436.21241.95691.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: ALoCoQnQaClH7kChUZBvFt7nqhcdWbCoofzOZnUdXYLNAD5hdPGIhtn58IJvAENwXv3U1Dw/IaB3 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.177 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 The KVM hypervisor mmu code requires access to the mem_type prot_pte field when setting up page tables pointing to a device. Unfortunately, the mem_type structure is opaque. Add an accessor (get_mem_type_prot_pte()) to retrieve the prot_pte value. Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm/include/asm/mach/map.h | 1 + arch/arm/mm/mmu.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h index a6efcdd..3787c9f 100644 --- a/arch/arm/include/asm/mach/map.h +++ b/arch/arm/include/asm/mach/map.h @@ -37,6 +37,7 @@ extern void iotable_init(struct map_desc *, int); struct mem_type; extern const struct mem_type *get_mem_type(unsigned int type); +extern pteval_t get_mem_type_prot_pte(unsigned int type); /* * external interface to remap single page with appropriate type */ diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 4c2d045..76bf4f5 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -301,6 +301,12 @@ const struct mem_type *get_mem_type(unsigned int type) } EXPORT_SYMBOL(get_mem_type); +pteval_t get_mem_type_prot_pte(unsigned int type) +{ + return get_mem_type(type)->prot_pte; +} +EXPORT_SYMBOL(get_mem_type_prot_pte); + /* * Adjust the PMD section entries according to the CPU in use. */