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: 1461841 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 32F7DDF264 for ; Sat, 15 Sep 2012 15:35:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751234Ab2IOPez (ORCPT ); Sat, 15 Sep 2012 11:34:55 -0400 Received: from mail-qa0-f53.google.com ([209.85.216.53]:41991 "EHLO mail-qa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752079Ab2IOPei (ORCPT ); Sat, 15 Sep 2012 11:34:38 -0400 Received: by mail-qa0-f53.google.com with SMTP id s11so598535qaa.19 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=TtPSDu1ENiKnQxqogRTwrr9raQKqk850Dy5hViIemFGISiAA3SqTWjiWIkgoi/KEKO L4BrW1JMLDV5SZc0y/7QdnYM22nNAXell4AsMI1i2LajIhPRlwSak5wbM+TMwtGLy4FA QyG6G/fKcWQTMOouOgTB0lXvVKh70fYIiPS0sZp9JaneIMzvbU3iHI7qnWxcqRoKi7lj USYbW4+9LhP7VqxNZTzwz8ZUjrc57hJkHnw1VpC62RNlvuN05omdFXEJgksHvOcJva0o J/JfilUMkpFlsmxpGzTV8M9NU+Hrab2Ps/sBcXLYy+Ce35gtSY0FAExNoyAq4BqcSFmx U48w== 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: ALoCoQnqt7D/I0Imos8/fnGOMhCEfDOCt+D36i8WK6zdW1FhXjF7h+AemFl4Xvyb6JCMsTGfizrF 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. */