public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Matthew Garrett <mjg@redhat.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, mjg@redhat.com, hpa@zytor.com,
	mingo@redhat.com, tglx@linutronix.de, hpa@linux.intel.com
Subject: [tip:x86/efi] x86, efi: Ensure that the entirity of a region is mapped
Date: Mon, 9 May 2011 23:18:03 GMT	[thread overview]
Message-ID: <tip-935a638241b0658b9749edd060f972575f9d4a78@git.kernel.org> (raw)
In-Reply-To: <1304623186-18261-5-git-send-email-mjg@redhat.com>

Commit-ID:  935a638241b0658b9749edd060f972575f9d4a78
Gitweb:     http://git.kernel.org/tip/935a638241b0658b9749edd060f972575f9d4a78
Author:     Matthew Garrett <mjg@redhat.com>
AuthorDate: Thu, 5 May 2011 15:19:46 -0400
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Mon, 9 May 2011 12:14:45 -0700

x86, efi: Ensure that the entirity of a region is mapped

It's possible for init_memory_mapping() to fail to map the entire region
if it crosses a boundary, so ensure that we complete the mapping.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Link: http://lkml.kernel.org/r/1304623186-18261-5-git-send-email-mjg@redhat.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/platform/efi/efi_64.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c
index 94d6b39..2649426 100644
--- a/arch/x86/platform/efi/efi_64.c
+++ b/arch/x86/platform/efi/efi_64.c
@@ -89,8 +89,10 @@ 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);
-	if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size)
-		return NULL;
+	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);
+	}
 
 	return (void __iomem *)__va(phys_addr);
 }

  reply	other threads:[~2011-05-09 23:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-05 19:19 [PATCH 1/5] efi: Remove virtual-mode SetVirtualAddressMap call Matthew Garrett
2011-05-05 19:19 ` [PATCH 2/5] efi: Consolidate EFI nx control Matthew Garrett
2011-05-09 23:16   ` [tip:x86/efi] x86, " tip-bot for Matthew Garrett
2011-05-05 19:19 ` [PATCH 3/5] efi: Merge contiguous memory regions of the same type and attribute Matthew Garrett
2011-05-09 23:17   ` [tip:x86/efi] x86, " tip-bot for Matthew Garrett
2011-05-05 19:19 ` [PATCH 4/5] efi: Pass a minimal map to SetVirtualAddressMap() Matthew Garrett
2011-05-09 23:17   ` [tip:x86/efi] x86, " tip-bot for Matthew Garrett
2011-05-05 19:19 ` [PATCH 5/5] efi: Ensure that the entirity of a region is mapped Matthew Garrett
2011-05-09 23:18   ` tip-bot for Matthew Garrett [this message]
2011-05-09 23:16 ` [tip:x86/efi] x86, efi: Remove virtual-mode SetVirtualAddressMap call tip-bot for Matthew Garrett

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=tip-935a638241b0658b9749edd060f972575f9d4a78@git.kernel.org \
    --to=mjg@redhat.com \
    --cc=hpa@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /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