From patchwork Thu Aug 16 15:28:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 1333471 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 333AD3FC33 for ; Thu, 16 Aug 2012 15:28:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932564Ab2HPP2K (ORCPT ); Thu, 16 Aug 2012 11:28:10 -0400 Received: from mail-qa0-f46.google.com ([209.85.216.46]:42299 "EHLO mail-qa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754354Ab2HPP2I (ORCPT ); Thu, 16 Aug 2012 11:28:08 -0400 Received: by qaas11 with SMTP id s11so661176qaa.19 for ; Thu, 16 Aug 2012 08:28:08 -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=I+Z2EJzkudyLFQo+cu9WOcm+mHjD3J6P2KfUs3i+EonCQnZOjy4lE1zVdvuyAORVDd lqXj9ghfPi2b3vMiZfEAB/m8JM3kpGTtl9kfhBT99zU3yq+/Cw2APH3awwXZ7F/A9i4P Xo6/MakmGs8a08I6kXnoI8dDHhSiHfRngvauMvjzuDS9pypal/cDRXS5giEMxsWyis0L lhQa2WkiAbIsdXm5BT0zjV/mpXjaNAwPuMJMWVyVBr0wGr0YOAD1fwtNKSDP00MssPiI E4E0LR0rWFU0HXr5gfaQ6yVtKJ5BHQMC6G+skazYMyecWzTsEp03qlxn+/a2kZanvwKC tawg== Received: by 10.224.176.195 with SMTP id bf3mr3930679qab.55.1345130888067; Thu, 16 Aug 2012 08:28:08 -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 hq10sm7003037qab.1.2012.08.16.08.28.06 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 16 Aug 2012 08:28:07 -0700 (PDT) Subject: [PATCH v10 01/14] ARM: add mem_type prot_pte accessor To: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org From: Christoffer Dall Date: Thu, 16 Aug 2012 11:28:05 -0400 Message-ID: <20120816152805.21484.59988.stgit@ubuntu> In-Reply-To: <20120816152637.21484.65421.stgit@ubuntu> References: <20120816152637.21484.65421.stgit@ubuntu> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmayrIDc3AdnXh6JyF3X4IlNl5fpQb4XgGhxK8HoYtTpNT20V8vu2cFFG/+RYIGs2NiqJNH 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 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 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. */