diff mbox

[04/15] ARM: idmap: only initialize HYP idmap when HYP mode is available

Message ID 20120915153455.21241.27798.stgit@ubuntu (mailing list archive)
State New, archived
Headers show

Commit Message

Christoffer Dall Sept. 15, 2012, 3:34 p.m. UTC
From: Marc Zyngier <marc.zyngier@arm.com>

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/mm/idmap.c |    4 ++++
 1 file changed, 4 insertions(+)

Comments

Will Deacon Sept. 18, 2012, 1:03 p.m. UTC | #1
On Sat, Sep 15, 2012 at 04:34:55PM +0100, Christoffer Dall wrote:
> From: Marc Zyngier <marc.zyngier@arm.com>
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
>  arch/arm/mm/idmap.c |    4 ++++
>  1 file changed, 4 insertions(+)

Just fold this into the previous patch.

Will
Christoffer Dall Sept. 20, 2012, 12:11 a.m. UTC | #2
On Tue, Sep 18, 2012 at 9:03 AM, Will Deacon <will.deacon@arm.com> wrote:
> On Sat, Sep 15, 2012 at 04:34:55PM +0100, Christoffer Dall wrote:
>> From: Marc Zyngier <marc.zyngier@arm.com>
>>
>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>> ---
>>  arch/arm/mm/idmap.c |    4 ++++
>>  1 file changed, 4 insertions(+)
>
> Just fold this into the previous patch.
>
yep, that was silly.

Thanks,
-Christoffer
diff mbox

Patch

diff --git a/arch/arm/mm/idmap.c b/arch/arm/mm/idmap.c
index 7a944af..95e8d67 100644
--- a/arch/arm/mm/idmap.c
+++ b/arch/arm/mm/idmap.c
@@ -8,6 +8,7 @@ 
 #include <asm/pgtable.h>
 #include <asm/sections.h>
 #include <asm/system_info.h>
+#include <asm/virt.h>
 
 pgd_t *idmap_pgd;
 
@@ -149,6 +150,9 @@  EXPORT_SYMBOL_GPL(hyp_idmap_setup);
 
 static int __init hyp_init_static_idmap(void)
 {
+	if (!is_hyp_mode_available())
+		return 0;
+
 	hyp_pgd = kzalloc(PTRS_PER_PGD * sizeof(pgd_t), GFP_KERNEL);
 	if (!hyp_pgd)
 		return -ENOMEM;