From patchwork Tue Jul 3 08:59:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 1149481 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 676C740134 for ; Tue, 3 Jul 2012 08:59:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752796Ab2GCI7X (ORCPT ); Tue, 3 Jul 2012 04:59:23 -0400 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) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=SGQC+O+NAxFfxDZhoMEE9B/03S1FxsiGcRGLYKOsjDM=; b=AZkGXFuafIaVAXyGD+3n2mW+Kc6YVmcNiU5on827RLjGO2siJ6zc5bcI97tZOg4ZCv ft7RBNXBEJxtMZI9SiUBEEOyPbKrpsoSpCj1LNquRiOz4UAz6SJUL4phWAmzrPrEHRVA /WueIG3Ld5I/c+6cuifGQIilVAa8JAghwDPgAGe43BfAVIGZ6SSFE4gKTSEI63Hm1kfN CYaM/DO5Npd1/ni3asOJHB5dV2UZQvPS2mnfEP7asv7xiBI6+AZ25opZVPu8XzPAxwlI mbBUTzczZQUSevhiyX6gaV0qR+XVmWb0LiqXP7HRodggG0eCAR+uts0bxtHv5i/rJKkD MPLA== Received: by 10.224.213.4 with SMTP id gu4mr28667595qab.0.1341305961622; Tue, 03 Jul 2012 01:59:21 -0700 (PDT) Received: from [127.0.1.1] (fireball.cs.columbia.edu. [128.59.13.10]) by mx.google.com with ESMTPS id o7sm24367656qaq.17.2012.07.03.01.59.20 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 Jul 2012 01:59:21 -0700 (PDT) Subject: [PATCH v9 01/16] ARM: add mem_type prot_pte accessor To: android-virt@lists.cs.columbia.edu, kvm@vger.kernel.org From: Christoffer Dall Cc: tech@virtualopensystems.com Date: Tue, 03 Jul 2012 04:59:20 -0400 Message-ID: <20120703085920.27746.12269.stgit@ubuntu> In-Reply-To: <20120703085841.27746.82730.stgit@ubuntu> References: <20120703085841.27746.82730.stgit@ubuntu> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQl1FvDg7xU/WU1nohggNHYCOsrwnRoHTe1KqYphom86UvqircLf4wXUYBeWQkAugVZNJOqh Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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(+) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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. */