From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoffer Dall Subject: [PATCH v9 01/16] ARM: add mem_type prot_pte accessor Date: Tue, 03 Jul 2012 04:59:20 -0400 Message-ID: <20120703085920.27746.12269.stgit@ubuntu> References: <20120703085841.27746.82730.stgit@ubuntu> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: tech@virtualopensystems.com To: android-virt@lists.cs.columbia.edu, kvm@vger.kernel.org Return-path: Received: from mail-qa0-f46.google.com ([209.85.216.46]:47376 "EHLO mail-qa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752231Ab2GCI7W (ORCPT ); Tue, 3 Jul 2012 04:59:22 -0400 Received: by qadb17 with SMTP id b17so2419395qad.19 for ; Tue, 03 Jul 2012 01:59:21 -0700 (PDT) In-Reply-To: <20120703085841.27746.82730.stgit@ubuntu> Sender: kvm-owner@vger.kernel.org List-ID: From: Marc Zyngier The KVM hypervisor mmu code requires 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 e5dad60..f7439e7 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. */