From: Jes Sorensen <jes@wildopensource.com>
To: linux-ia64@vger.kernel.org
Subject: Re: 2.6.13-rc5 does not boot on Tiger4
Date: Mon, 08 Aug 2005 13:51:12 +0000 [thread overview]
Message-ID: <yq0ek948rlb.fsf@jaguar.mkp.net> (raw)
In-Reply-To: <jeoe8fyrfb.fsf@sykes.suse.de>
>>>>> "Tony" = Luck, Tony <tony.luck@intel.com> writes:
Tony> But it still doesn't really do what the comment claims it will
Tony> do. The "attribute" field is a bitmask ... most of the memory
Tony> that was dropped because of holes or incompatible attributes
Tony> within the same granule will also have other allowable
Tony> attributes. So final version of this should be checking
Tony> "md->attribute & EFI_MEMORY_UC" rather than "=".
Tony,
What about this then? I looked a bit further at treating the attribute
bit as a bitmask, however it doesn't really make sense as we can't
really use uncached memory which has the write protect bit set for
instance (I see those in the EFI mem map on the SN2). Worse is that I
have also seen regions marked both uncached and writeback which seems
pretty absurd, but to avoid getting trapped by these I think it's
safer to stick to using '='.
This patch is modelled on Alex's suggestion of using
is_available_memory().
Cheers,
Jes
Only grab uncached pages from the boot services data section to avoid
grabbing memory mapped IO regions by mistake. Regions which have other
attributes set besides the uncached bit are unsuitable as well
(eg. write protect etc).
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -409,6 +409,24 @@ efi_memmap_walk (efi_freemem_callback_t
}
}
+static inline int
+is_available_uc_memory (efi_memory_desc_t *md)
+{
+ if (!(md->attribute = EFI_MEMORY_UC))
+ return 0;
+
+ switch (md->type) {
+ case EFI_LOADER_CODE:
+ case EFI_LOADER_DATA:
+ case EFI_BOOT_SERVICES_CODE:
+ case EFI_BOOT_SERVICES_DATA:
+ case EFI_CONVENTIONAL_MEMORY:
+ return 1;
+ }
+
+ return 0;
+}
+
/*
* Walk the EFI memory map to pull out leftover pages in the lower
* memory regions which do not end up in the regular memory map and
@@ -431,7 +449,7 @@ efi_memmap_walk_uc (efi_freemem_callback
for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
md = p;
- if (md->attribute = EFI_MEMORY_UC) {
+ if (is_available_uc_memory(md)) {
start = PAGE_ALIGN(md->phys_addr);
end = PAGE_ALIGN((md->phys_addr+(md->num_pages << EFI_PAGE_SHIFT)) & PAGE_MASK);
if ((*callback)(start, end, NULL) < 0)
next prev parent reply other threads:[~2005-08-08 13:51 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-03 15:24 2.6.13-rc5 does not boot on Tiger4 Andreas Schwab
2005-08-03 17:17 ` Luck, Tony
2005-08-03 17:25 ` Luck, Tony
2005-08-04 1:42 ` Peter Chubb
2005-08-04 2:09 ` Keith Owens
2005-08-04 4:08 ` Peter Chubb
2005-08-04 4:24 ` Alex Williamson
2005-08-04 16:27 ` Bjorn Helgaas
2005-08-04 16:48 ` Andreas Schwab
2005-08-04 17:55 ` Luck, Tony
2005-08-04 18:23 ` Jes Sorensen
2005-08-05 0:02 ` Luck, Tony
2005-08-05 9:57 ` Andreas Schwab
2005-08-05 14:12 ` Jes Sorensen
2005-08-05 17:00 ` Alex Williamson
2005-08-05 17:02 ` Alex Williamson
2005-08-05 17:20 ` Luck, Tony
2005-08-05 17:49 ` Jes Sorensen
2005-08-08 13:51 ` Jes Sorensen [this message]
2005-08-08 16:37 ` Luck, Tony
2005-08-09 9:51 ` Jes Sorensen
2005-08-09 17:00 ` Luck, Tony
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=yq0ek948rlb.fsf@jaguar.mkp.net \
--to=jes@wildopensource.com \
--cc=linux-ia64@vger.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