From patchwork Thu Jan 24 16:52:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 2033961 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 DC8873FDBC for ; Thu, 24 Jan 2013 16:52:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752830Ab3AXQwd (ORCPT ); Thu, 24 Jan 2013 11:52:33 -0500 Received: from mail-oa0-f51.google.com ([209.85.219.51]:42636 "EHLO mail-oa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751141Ab3AXQwb (ORCPT ); Thu, 24 Jan 2013 11:52:31 -0500 Received: by mail-oa0-f51.google.com with SMTP id n12so10219894oag.10 for ; Thu, 24 Jan 2013 08:52:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:x-originating-ip:in-reply-to:references :date:message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=hXGxZTE+7dqiaihVvxS57iSifMP6MFe7EcP3rjQQrew=; b=PUPJpv+ys0Grv0I8E5x8pz1qvodg6h2U9HUvkXjbLNwSbpG3SScEomLofV06ZlKedq acvHQZegDkuMFlwULS/LRYwYUccn5Sh+b60v7/uvI68SL333SDR3Cctq7n0ccz2wUnmo ekvg02yWsV8Oq4ZcYKJtUvOozx+BAz9Ht7y0h89qsxGsRmSL3urpFFImwV0Po0C0shSK 5yBTuwcwBHLuJMRWA77dH5HMeZMRdGfW/kiPnK0g4bHKwtMCFFOfclvawF6idpN95Xd8 vhDB3fOEQs15JxtVRa+ABH677a1Dp1pdg4NgE2VL4T/FZe5IU1Pcs0HqW8eRoPEekWVc w1kA== MIME-Version: 1.0 X-Received: by 10.50.33.173 with SMTP id s13mr1928565igi.23.1359046350051; Thu, 24 Jan 2013 08:52:30 -0800 (PST) Received: by 10.64.37.70 with HTTP; Thu, 24 Jan 2013 08:52:29 -0800 (PST) X-Originating-IP: [72.80.83.148] In-Reply-To: <20130124154535.GD18233@arm.com> References: <20130116175716.29147.15348.stgit@ubuntu> <20130116175748.29147.91246.stgit@ubuntu> <20130124154535.GD18233@arm.com> Date: Thu, 24 Jan 2013 11:52:29 -0500 Message-ID: Subject: Re: [PATCH v6 04/15] KVM: ARM: Hypervisor initialization From: Christoffer Dall To: Catalin Marinas Cc: "kvm@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "kvmarm@lists.cs.columbia.edu" , Marc Zyngier , Marcelo Tosatti , Will Deacon X-Gm-Message-State: ALoCoQnaVlGVLnQZ52+u1X//FJZUJeUAj/UHOEwUJqpkRkx0F0NPfG2khM5p7QbwMfvwjzRIy39k Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Thu, Jan 24, 2013 at 10:45 AM, Catalin Marinas wrote: > On Wed, Jan 16, 2013 at 05:57:48PM +0000, Christoffer Dall wrote: >> --- a/arch/arm/include/asm/pgtable-3level-hwdef.h >> +++ b/arch/arm/include/asm/pgtable-3level-hwdef.h >> @@ -32,6 +32,9 @@ >> #define PMD_TYPE_SECT (_AT(pmdval_t, 1) << 0) >> #define PMD_BIT4 (_AT(pmdval_t, 0)) >> #define PMD_DOMAIN(x) (_AT(pmdval_t, 0)) >> +#define PMD_APTABLE_SHIFT (61) >> +#define PMD_APTABLE (_AT(pgdval_t, 3) << PGD_APTABLE_SHIFT) >> +#define PMD_PXNTABLE (_AT(pgdval_t, 1) << 59) > > Are these used anywhere? I grep'ed but couldn't find. While I'm fine > with keeping some hardware definitions for future use, I think here you > need to qualify these bits with some suffix to PMD_APTABLE. The APTable > are just a group of bits with different meaning (no write access etc.). > If you want to keep them as group of bits, you can add a _MASK suffix. > >> +static int init_hyp_mode(void) >> +{ >> + phys_addr_t init_phys_addr; >> + int cpu; >> + int err = 0; >> + >> + /* >> + * Allocate Hyp PGD and setup Hyp identity mapping >> + */ >> + err = kvm_mmu_init(); >> + if (err) >> + goto out_err; > > The comment is a bit misleading since kvm_mmu_init() simply checks > whether hyp_pgd has been initialised. The actual initialisation is done > by the idmap code. > This should fix it, thanks: --- -- 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/pgtable-3level-hwdef.h b/arch/arm/include/asm/pgtable-3level-hwdef.h index 432fa12..30fb12a 100644 --- a/arch/arm/include/asm/pgtable-3level-hwdef.h +++ b/arch/arm/include/asm/pgtable-3level-hwdef.h @@ -33,7 +33,7 @@ #define PMD_BIT4 (_AT(pmdval_t, 0)) #define PMD_DOMAIN(x) (_AT(pmdval_t, 0)) #define PMD_APTABLE_SHIFT (61) -#define PMD_APTABLE (_AT(pgdval_t, 3) << PGD_APTABLE_SHIFT) +#define PMD_APTABLE_MASK (_AT(pgdval_t, 3) << PGD_APTABLE_SHIFT) #define PMD_PXNTABLE (_AT(pgdval_t, 1) << 59) /* diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 2d30e3a..8354a6f 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -871,7 +871,7 @@ static int init_hyp_mode(void) int err = 0; /* - * Allocate Hyp PGD and setup Hyp identity mapping + * Make sure the Hyp identity map is ready for us. */ err = kvm_mmu_init(); if (err)