mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jacob Shin <jacob.shin@amd.com>
To: X86-ML <x86@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Yinghai Lu <yinghai@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
	Andreas Herrmann <andreas.herrmann3@amd.com>,
	Jacob Shin <jacob.shin@amd.com>
Subject: [PATCH 3/5] x86: Keep track of direct mapped pfn ranges
Date: Thu, 9 Aug 2012 16:23:07 -0500	[thread overview]
Message-ID: <1344547389-4599-4-git-send-email-jacob.shin@amd.com> (raw)
In-Reply-To: <1344547389-4599-1-git-send-email-jacob.shin@amd.com>

Update later calls to init_memory_mapping to keep track of direct mapped
pfn ranges.

Signed-off-by: Jacob Shin <jacob.shin@amd.com>
---
 arch/x86/kernel/amd_gart_64.c  |    4 +++-
 arch/x86/mm/init_64.c          |    3 +--
 arch/x86/platform/efi/efi_64.c |    2 ++
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/amd_gart_64.c b/arch/x86/kernel/amd_gart_64.c
index e663112..5ac26b9 100644
--- a/arch/x86/kernel/amd_gart_64.c
+++ b/arch/x86/kernel/amd_gart_64.c
@@ -770,7 +770,9 @@ int __init gart_iommu_init(void)
 
 	if (end_pfn > max_low_pfn_mapped) {
 		start_pfn = (aper_base>>PAGE_SHIFT);
-		init_memory_mapping(start_pfn<<PAGE_SHIFT, end_pfn<<PAGE_SHIFT);
+		end_pfn = init_memory_mapping(start_pfn<<PAGE_SHIFT,
+					      end_pfn<<PAGE_SHIFT);
+		add_pfn_range_mapped(start_pfn, end_pfn);
 	}
 
 	pr_info("PCI-DMA: using GART IOMMU.\n");
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 2b6b4a3..cbed965 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -662,8 +662,7 @@ int arch_add_memory(int nid, u64 start, u64 size)
 	int ret;
 
 	last_mapped_pfn = init_memory_mapping(start, start + size);
-	if (last_mapped_pfn > max_pfn_mapped)
-		max_pfn_mapped = last_mapped_pfn;
+	add_pfn_range_mapped(start_pfn, last_mapped_pfn);
 
 	ret = __add_pages(nid, zone, start_pfn, nr_pages);
 	WARN_ON_ONCE(ret);
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c
index ac3aa54..e822c89 100644
--- a/arch/x86/platform/efi/efi_64.c
+++ b/arch/x86/platform/efi/efi_64.c
@@ -90,6 +90,8 @@ void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size,
 		return ioremap(phys_addr, size);
 
 	last_map_pfn = init_memory_mapping(phys_addr, phys_addr + size);
+	add_pfn_range_mapped(phys_addr >> PAGE_SHIFT, last_map_pfn);
+
 	if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size) {
 		unsigned long top = last_map_pfn << PAGE_SHIFT;
 		efi_ioremap(top, size - (top - phys_addr), type);
-- 
1.7.9.5



  parent reply	other threads:[~2012-08-09 21:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-09 21:23 [PATCH 0/5] Only create direct mappings for E820_RAM regions Jacob Shin
2012-08-09 21:23 ` [PATCH 1/5] x86: Only direct map addresses that are marked as E820_RAM Jacob Shin
2012-08-09 22:03   ` Yinghai Lu
2012-08-11 18:36     ` H. Peter Anvin
2012-08-13 14:11       ` Jacob Shin
2012-08-11 19:49   ` Tejun Heo
2012-08-13 14:31     ` Jacob Shin
2012-08-09 21:23 ` [PATCH 2/5] x86: find_early_table_space based on memory ranges that are being mapped Jacob Shin
2012-08-11 19:56   ` Tejun Heo
2012-08-09 21:23 ` Jacob Shin [this message]
2012-08-11 19:57   ` [PATCH 3/5] x86: Keep track of direct mapped pfn ranges Tejun Heo
2012-08-09 21:23 ` [PATCH 4/5] x86: Fixup code testing if a pfn is direct mapped Jacob Shin
2012-08-09 21:23 ` [PATCH 5/5] x86: Move enabling of PSE and PGE out of init_memory_mapping Jacob Shin
2012-08-11 20:01   ` Tejun Heo
2012-08-13  7:34     ` Borislav Petkov
2012-08-13 23:20       ` Tejun Heo
2012-08-14  8:49         ` Borislav Petkov
2012-08-14 19:52           ` Jacob Shin
2012-08-14 20:20             ` Tejun Heo
2012-08-11 19:51 ` [PATCH 0/5] Only create direct mappings for E820_RAM regions Tejun Heo
2012-08-13 21:46 [PATCH V2 0/5] x86: Create direct mappings for E820_RAM only Jacob Shin
2012-08-13 21:47 ` [PATCH 3/5] x86: Keep track of direct mapped pfn ranges Jacob Shin
2012-08-13 22:09   ` Tejun Heo

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=1344547389-4599-4-git-send-email-jacob.shin@amd.com \
    --to=jacob.shin@amd.com \
    --cc=andreas.herrmann3@amd.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@kernel.org \
    --cc=yinghai@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome