From: lauraa@codeaurora.org (Laura Abbott)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCHv3 10/11] arm: Use for_each_potential_vmalloc_area
Date: Thu, 2 Jan 2014 13:53:28 -0800 [thread overview]
Message-ID: <1388699609-18214-11-git-send-email-lauraa@codeaurora.org> (raw)
In-Reply-To: <1388699609-18214-1-git-send-email-lauraa@codeaurora.org>
With CONFIG_INTERMIX_VMALLOC it is no longer the case that all
vmalloc is contained between VMALLOC_START and VMALLOC_END.
Some portions of code still rely on operating on all those regions
however. Use for_each_potential_vmalloc_area where appropriate to
do whatever is necessary to those regions.
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
---
arch/arm/kvm/mmu.c | 12 ++++++++----
arch/arm/mm/ioremap.c | 12 ++++++++----
arch/arm/mm/mmu.c | 9 +++++++--
3 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 58090698..4d2ca7e 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -225,16 +225,20 @@ void free_boot_hyp_pgd(void)
void free_hyp_pgds(void)
{
unsigned long addr;
+ int i;
+ unsigned long vstart, unsigned long vend;
free_boot_hyp_pgd();
mutex_lock(&kvm_hyp_pgd_mutex);
if (hyp_pgd) {
- for (addr = PAGE_OFFSET; virt_addr_valid(addr); addr += PGDIR_SIZE)
- unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
- for (addr = VMALLOC_START; is_vmalloc_addr((void*)addr); addr += PGDIR_SIZE)
- unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
+ for_each_potential_nonvmalloc_area(&vstart, &vend, &i)
+ for (addr = vstart; addr < vend; addr += PGDIR_SIZE)
+ unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
+ for_each_potential_vmalloc_area(&vstart, &vend, &i)
+ for (addr = vstart; addr < vend; addr += PGDIR_SIZE)
+ unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
kfree(hyp_pgd);
hyp_pgd = NULL;
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index ad92d4f..892bc82 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -115,13 +115,17 @@ EXPORT_SYMBOL(ioremap_page);
void __check_vmalloc_seq(struct mm_struct *mm)
{
unsigned int seq;
+ int i;
+ unsigned long vstart, vend;
do {
seq = init_mm.context.vmalloc_seq;
- memcpy(pgd_offset(mm, VMALLOC_START),
- pgd_offset_k(VMALLOC_START),
- sizeof(pgd_t) * (pgd_index(VMALLOC_END) -
- pgd_index(VMALLOC_START)));
+
+ for_each_potential_vmalloc_area(&vstart, &vend, &i)
+ memcpy(pgd_offset(mm, vstart),
+ pgd_offset_k(vstart),
+ sizeof(pgd_t) * (pgd_index(vend) -
+ pgd_index(vstart)));
mm->context.vmalloc_seq = seq;
} while (seq != init_mm.context.vmalloc_seq);
}
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 55bd742..af8e43c 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -1217,6 +1217,8 @@ static void __init devicemaps_init(const struct machine_desc *mdesc)
struct map_desc map;
unsigned long addr;
void *vectors;
+ unsigned long vstart, vend;
+ int i;
/*
* Allocate the vector page early.
@@ -1225,8 +1227,11 @@ static void __init devicemaps_init(const struct machine_desc *mdesc)
early_trap_init(vectors);
- for (addr = VMALLOC_START; addr; addr += PMD_SIZE)
- pmd_clear(pmd_off_k(addr));
+
+ for_each_potential_vmalloc_area(&vstart, &vend, &i)
+ for (addr = vstart; addr < vend; addr += PMD_SIZE) {
+ pmd_clear(pmd_off_k(addr));
+ }
/*
* Map the kernel if it is XIP.
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
WARNING: multiple messages have this Message-ID (diff)
From: Laura Abbott <lauraa@codeaurora.org>
To: Andrew Morton <akpm@linux-foundation.org>,
Kyungmin Park <kmpark@infradead.org>, Dave Hansen <dave@sr71.net>,
linux-mm@kvack.org, Russell King <linux@arm.linux.org.uk>
Cc: linux-kernel@vger.kernel.org,
Laura Abbott <lauraa@codeaurora.org>,
kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu,
linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCHv3 10/11] arm: Use for_each_potential_vmalloc_area
Date: Thu, 2 Jan 2014 13:53:28 -0800 [thread overview]
Message-ID: <1388699609-18214-11-git-send-email-lauraa@codeaurora.org> (raw)
In-Reply-To: <1388699609-18214-1-git-send-email-lauraa@codeaurora.org>
With CONFIG_INTERMIX_VMALLOC it is no longer the case that all
vmalloc is contained between VMALLOC_START and VMALLOC_END.
Some portions of code still rely on operating on all those regions
however. Use for_each_potential_vmalloc_area where appropriate to
do whatever is necessary to those regions.
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
---
arch/arm/kvm/mmu.c | 12 ++++++++----
arch/arm/mm/ioremap.c | 12 ++++++++----
arch/arm/mm/mmu.c | 9 +++++++--
3 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 58090698..4d2ca7e 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -225,16 +225,20 @@ void free_boot_hyp_pgd(void)
void free_hyp_pgds(void)
{
unsigned long addr;
+ int i;
+ unsigned long vstart, unsigned long vend;
free_boot_hyp_pgd();
mutex_lock(&kvm_hyp_pgd_mutex);
if (hyp_pgd) {
- for (addr = PAGE_OFFSET; virt_addr_valid(addr); addr += PGDIR_SIZE)
- unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
- for (addr = VMALLOC_START; is_vmalloc_addr((void*)addr); addr += PGDIR_SIZE)
- unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
+ for_each_potential_nonvmalloc_area(&vstart, &vend, &i)
+ for (addr = vstart; addr < vend; addr += PGDIR_SIZE)
+ unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
+ for_each_potential_vmalloc_area(&vstart, &vend, &i)
+ for (addr = vstart; addr < vend; addr += PGDIR_SIZE)
+ unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
kfree(hyp_pgd);
hyp_pgd = NULL;
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index ad92d4f..892bc82 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -115,13 +115,17 @@ EXPORT_SYMBOL(ioremap_page);
void __check_vmalloc_seq(struct mm_struct *mm)
{
unsigned int seq;
+ int i;
+ unsigned long vstart, vend;
do {
seq = init_mm.context.vmalloc_seq;
- memcpy(pgd_offset(mm, VMALLOC_START),
- pgd_offset_k(VMALLOC_START),
- sizeof(pgd_t) * (pgd_index(VMALLOC_END) -
- pgd_index(VMALLOC_START)));
+
+ for_each_potential_vmalloc_area(&vstart, &vend, &i)
+ memcpy(pgd_offset(mm, vstart),
+ pgd_offset_k(vstart),
+ sizeof(pgd_t) * (pgd_index(vend) -
+ pgd_index(vstart)));
mm->context.vmalloc_seq = seq;
} while (seq != init_mm.context.vmalloc_seq);
}
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 55bd742..af8e43c 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -1217,6 +1217,8 @@ static void __init devicemaps_init(const struct machine_desc *mdesc)
struct map_desc map;
unsigned long addr;
void *vectors;
+ unsigned long vstart, vend;
+ int i;
/*
* Allocate the vector page early.
@@ -1225,8 +1227,11 @@ static void __init devicemaps_init(const struct machine_desc *mdesc)
early_trap_init(vectors);
- for (addr = VMALLOC_START; addr; addr += PMD_SIZE)
- pmd_clear(pmd_off_k(addr));
+
+ for_each_potential_vmalloc_area(&vstart, &vend, &i)
+ for (addr = vstart; addr < vend; addr += PMD_SIZE) {
+ pmd_clear(pmd_off_k(addr));
+ }
/*
* Map the kernel if it is XIP.
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Laura Abbott <lauraa@codeaurora.org>
To: Andrew Morton <akpm@linux-foundation.org>,
Kyungmin Park <kmpark@infradead.org>, Dave Hansen <dave@sr71.net>,
linux-mm@kvack.org, Russell King <linux@arm.linux.org.uk>
Cc: linux-kernel@vger.kernel.org,
Laura Abbott <lauraa@codeaurora.org>,
kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu,
linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCHv3 10/11] arm: Use for_each_potential_vmalloc_area
Date: Thu, 2 Jan 2014 13:53:28 -0800 [thread overview]
Message-ID: <1388699609-18214-11-git-send-email-lauraa@codeaurora.org> (raw)
In-Reply-To: <1388699609-18214-1-git-send-email-lauraa@codeaurora.org>
With CONFIG_INTERMIX_VMALLOC it is no longer the case that all
vmalloc is contained between VMALLOC_START and VMALLOC_END.
Some portions of code still rely on operating on all those regions
however. Use for_each_potential_vmalloc_area where appropriate to
do whatever is necessary to those regions.
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
---
arch/arm/kvm/mmu.c | 12 ++++++++----
arch/arm/mm/ioremap.c | 12 ++++++++----
arch/arm/mm/mmu.c | 9 +++++++--
3 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 58090698..4d2ca7e 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -225,16 +225,20 @@ void free_boot_hyp_pgd(void)
void free_hyp_pgds(void)
{
unsigned long addr;
+ int i;
+ unsigned long vstart, unsigned long vend;
free_boot_hyp_pgd();
mutex_lock(&kvm_hyp_pgd_mutex);
if (hyp_pgd) {
- for (addr = PAGE_OFFSET; virt_addr_valid(addr); addr += PGDIR_SIZE)
- unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
- for (addr = VMALLOC_START; is_vmalloc_addr((void*)addr); addr += PGDIR_SIZE)
- unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
+ for_each_potential_nonvmalloc_area(&vstart, &vend, &i)
+ for (addr = vstart; addr < vend; addr += PGDIR_SIZE)
+ unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
+ for_each_potential_vmalloc_area(&vstart, &vend, &i)
+ for (addr = vstart; addr < vend; addr += PGDIR_SIZE)
+ unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE);
kfree(hyp_pgd);
hyp_pgd = NULL;
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index ad92d4f..892bc82 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -115,13 +115,17 @@ EXPORT_SYMBOL(ioremap_page);
void __check_vmalloc_seq(struct mm_struct *mm)
{
unsigned int seq;
+ int i;
+ unsigned long vstart, vend;
do {
seq = init_mm.context.vmalloc_seq;
- memcpy(pgd_offset(mm, VMALLOC_START),
- pgd_offset_k(VMALLOC_START),
- sizeof(pgd_t) * (pgd_index(VMALLOC_END) -
- pgd_index(VMALLOC_START)));
+
+ for_each_potential_vmalloc_area(&vstart, &vend, &i)
+ memcpy(pgd_offset(mm, vstart),
+ pgd_offset_k(vstart),
+ sizeof(pgd_t) * (pgd_index(vend) -
+ pgd_index(vstart)));
mm->context.vmalloc_seq = seq;
} while (seq != init_mm.context.vmalloc_seq);
}
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 55bd742..af8e43c 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -1217,6 +1217,8 @@ static void __init devicemaps_init(const struct machine_desc *mdesc)
struct map_desc map;
unsigned long addr;
void *vectors;
+ unsigned long vstart, vend;
+ int i;
/*
* Allocate the vector page early.
@@ -1225,8 +1227,11 @@ static void __init devicemaps_init(const struct machine_desc *mdesc)
early_trap_init(vectors);
- for (addr = VMALLOC_START; addr; addr += PMD_SIZE)
- pmd_clear(pmd_off_k(addr));
+
+ for_each_potential_vmalloc_area(&vstart, &vend, &i)
+ for (addr = vstart; addr < vend; addr += PMD_SIZE) {
+ pmd_clear(pmd_off_k(addr));
+ }
/*
* Map the kernel if it is XIP.
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
next prev parent reply other threads:[~2014-01-02 21:53 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-02 21:53 [RFC PATCHv3 00/11] Intermix Lowmem and vmalloc Laura Abbott
2014-01-02 21:53 ` Laura Abbott
2014-01-02 21:53 ` [RFC PATCHv3 01/11] mce: acpi/apei: Use get_vm_area directly Laura Abbott
2014-01-02 21:53 ` Laura Abbott
2014-01-03 2:33 ` Chen, Gong
2014-01-02 21:53 ` [RFC PATCHv3 02/11] iommu/omap: " Laura Abbott
2014-01-02 21:53 ` Laura Abbott
2014-01-03 2:40 ` Chen, Gong
2014-01-02 21:53 ` [RFC PATCHv3 03/11] percpu: use VMALLOC_TOTAL instead of VMALLOC_END - VMALLOC_START Laura Abbott
2014-01-02 21:53 ` Laura Abbott
2014-01-12 3:39 ` Tejun Heo
2014-01-12 3:39 ` Tejun Heo
2014-01-02 21:53 ` [RFC PATCHv3 04/11] dm: Use VMALLOC_TOTAL instead of VMALLCO_END " Laura Abbott
2014-01-02 21:53 ` Laura Abbott
2014-01-02 21:53 ` [RFC PATCHv3 05/11] staging: lustre: Use is_vmalloc_addr Laura Abbott
2014-01-02 21:53 ` Laura Abbott
2014-01-02 21:53 ` [RFC PATCHv3 06/11] arm: use is_vmalloc_addr Laura Abbott
2014-01-02 21:53 ` Laura Abbott
2014-01-02 21:53 ` Laura Abbott
2014-01-02 22:13 ` Dave Hansen
2014-01-02 22:13 ` Dave Hansen
2014-01-02 22:13 ` Dave Hansen
2014-01-02 21:53 ` [RFC PATCHv3 07/11] arm: mm: Add iotable_init_novmreserve Laura Abbott
2014-01-02 21:53 ` Laura Abbott
2014-01-02 21:53 ` Laura Abbott
2014-01-02 21:53 ` [RFC PATCHv3 08/11] mm/vmalloc.c: Allow lowmem to be tracked in vmalloc Laura Abbott
2014-01-02 21:53 ` Laura Abbott
2014-01-02 21:53 ` [RFC PATCHv3 09/11] arm: mm: Track lowmem " Laura Abbott
2014-01-02 21:53 ` Laura Abbott
2014-01-02 21:53 ` Laura Abbott
2014-01-02 21:53 ` Laura Abbott [this message]
2014-01-02 21:53 ` [RFC PATCHv3 10/11] arm: Use for_each_potential_vmalloc_area Laura Abbott
2014-01-02 21:53 ` Laura Abbott
2014-01-02 21:53 ` [RFC PATCHv3 11/11] fs/proc/kcore.c: " Laura Abbott
2014-01-02 21:53 ` Laura Abbott
2014-01-03 18:23 ` [RFC PATCHv3 00/11] Intermix Lowmem and vmalloc Dave Hansen
2014-01-03 22:08 ` Laura Abbott
2014-01-03 22:08 ` Laura Abbott
2014-01-04 7:31 ` Minchan Kim
2014-01-04 7:31 ` Minchan Kim
2014-01-06 19:08 ` Laura Abbott
2014-01-06 19:08 ` Laura Abbott
2014-01-08 2:52 ` Minchan Kim
2014-01-08 2:52 ` Minchan Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1388699609-18214-11-git-send-email-lauraa@codeaurora.org \
--to=lauraa@codeaurora.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.