All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] arm64: improved memory map handling for /dev/mem, ACPI etc
@ 2014-12-22 19:08 ` Ard Biesheuvel
  0 siblings, 0 replies; 56+ messages in thread
From: Ard Biesheuvel @ 2014-12-22 19:08 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-efi-u79uwXL29TY76Z2rM5mHXA,
	leif.lindholm-QSEj5FYQhm4dnm+yROfE0A,
	roy.franz-QSEj5FYQhm4dnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
	catalin.marinas-5wv7dgnIgG8, will.deacon-5wv7dgnIgG8,
	matt.fleming-ral2JQCrhuEAvxtiuMwx3w, bp-Gina5bIWoIWzQB+pC5nmwQ,
	dyoung-H+wXaHxf7aLQT0dZR+AlfA, msalter-H+wXaHxf7aLQT0dZR+AlfA,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A
  Cc: Ard Biesheuvel

This series was split off from the UEFI virtmap for kexec series that I posted
earlier today. The main purpose is to deal with the need to classify memory
ranges as RAM or non-RAM in a consistent and comprehensive manner. This series
applies on top of the other series.

Patch #1 avoids an early panic if the UEFI memory map is available but UEFI
support itself fails to initialize. In this case, there is no need to panic
early, and we have a better chance of being able to inform the user if we deal
with this error condition at a later time.

Patch #2 adds iomem resource registration of UEFI memory regions. This is
necessary because otherwise, drivers could potentially claim regions that
are in active use by the firmware. This applies to both MMIO (NOR flash, RTC)
and RAM ranges (runtime services code and data).

Patch #3-6 adds support to UEFI and non-UEFI code paths to record all memory
known to the system in the 'physmem' memblock table (if enabled). This fulfils
a need in the /dev/mem and (upcoming) ACPI layers to be able to classify ranges
as being backed by normal RAM even if they are not covered by the 'memory'
memblock table, and are hence not covered by the linear direct mapping.
The physmem code is pre-existing code that only needs minor tweaking to be made
suitable for this purpose.

Patch #7 enables the 'physmem' memblock table for arm64, and wires it into the
handling of /dev/mem mappings, both to decide whether it should be mapped as
MT_NORMAL, and whether read-write access can be allowed. (Non-RAM regions can
be mapped read-write as long as they are not claimed by a driver in the iomem
resource table. RAM regions can only be mapped read-only, and only if they are
not covered by the 'memory' memblock table, and hence not covered by the linear
mapping)

Finally, patch #8 changes the way the virtual memory map is handled by the
early UEFI code. Specifically, it memblock_remove()s rather than _reserves()
UEFI reserved RAM regions, so that they are removed entirely from the linear
mapping.

Ard Biesheuvel (8):
  arm64/efi: use UEFI memory map unconditionally if available
  arm64/efi: register UEFI reserved regions as iomem resources
  memblock: add physmem to memblock_dump_all() output
  memblock: introduce memblock_add_phys() and memblock_is_physmem()
  of: fdt: register physmem in early_init_dt_scan_memory()
  arm64/efi: register physmem in reserve_regions()
  arm64: use 'physmem' memblock to improve CONFIG_STRICT_DEVMEM handling
  arm64/efi: memblock_remove rather than _reserve UEFI reserved RAM

 arch/arm64/Kconfig       |  1 +
 arch/arm64/kernel/efi.c  | 82 +++++++++++++++++++++++++++++++++++++++---------
 arch/arm64/mm/mmap.c     |  2 +-
 arch/arm64/mm/mmu.c      | 15 ++++++++-
 drivers/of/fdt.c         |  1 +
 include/linux/memblock.h | 10 ++++++
 mm/memblock.c            | 18 +++++++++++
 7 files changed, 113 insertions(+), 16 deletions(-)

-- 
1.8.3.2

^ permalink raw reply	[flat|nested] 56+ messages in thread

end of thread, other threads:[~2015-01-12 10:46 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-22 19:08 [PATCH 0/8] arm64: improved memory map handling for /dev/mem, ACPI etc Ard Biesheuvel
2014-12-22 19:08 ` Ard Biesheuvel
     [not found] ` <1419275322-29811-1-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-12-22 19:08   ` [PATCH 1/8] arm64/efi: use UEFI memory map unconditionally if available Ard Biesheuvel
2014-12-22 19:08     ` Ard Biesheuvel
     [not found]     ` <1419275322-29811-2-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-01-06  9:04       ` Matt Fleming
2015-01-06  9:04         ` Matt Fleming
     [not found]         ` <20150106090407.GF3163-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2015-01-07 11:48           ` Ard Biesheuvel
2015-01-07 11:48             ` Ard Biesheuvel
     [not found]             ` <CAKv+Gu_q5wFhjb8M7VptVtHfm5vfp6_YiqN_XoTs9qV5=8OOdg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-12 10:46               ` Matt Fleming
2015-01-12 10:46                 ` Matt Fleming
2015-01-09 15:41       ` Will Deacon
2015-01-09 15:41         ` Will Deacon
2014-12-22 19:08   ` [PATCH 2/8] arm64/efi: register UEFI reserved regions as iomem resources Ard Biesheuvel
2014-12-22 19:08     ` Ard Biesheuvel
     [not found]     ` <1419275322-29811-3-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-01-06  9:13       ` Matt Fleming
2015-01-06  9:13         ` Matt Fleming
     [not found]         ` <20150106091322.GG3163-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2015-01-07 11:53           ` Ard Biesheuvel
2015-01-07 11:53             ` Ard Biesheuvel
2014-12-22 19:08   ` [PATCH 3/8] memblock: add physmem to memblock_dump_all() output Ard Biesheuvel
2014-12-22 19:08     ` Ard Biesheuvel
2015-01-06  9:15     ` Matt Fleming
2015-01-06  9:15       ` Matt Fleming
2015-01-06  9:15       ` Matt Fleming
2014-12-22 19:08   ` [PATCH 4/8] memblock: introduce memblock_add_phys() and memblock_is_physmem() Ard Biesheuvel
2014-12-22 19:08     ` Ard Biesheuvel
2015-01-06  9:19     ` Matt Fleming
2015-01-06  9:19       ` Matt Fleming
2015-01-06  9:19       ` Matt Fleming
2014-12-22 19:08   ` [PATCH 5/8] of: fdt: register physmem in early_init_dt_scan_memory() Ard Biesheuvel
2014-12-22 19:08     ` Ard Biesheuvel
2014-12-22 19:08   ` [PATCH 6/8] arm64/efi: register physmem in reserve_regions() Ard Biesheuvel
2014-12-22 19:08     ` Ard Biesheuvel
2014-12-22 19:08   ` [PATCH 7/8] arm64: use 'physmem' memblock to improve CONFIG_STRICT_DEVMEM handling Ard Biesheuvel
2014-12-22 19:08     ` Ard Biesheuvel
     [not found]     ` <1419275322-29811-8-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-01-09 15:38       ` Will Deacon
2015-01-09 15:38         ` Will Deacon
2014-12-22 19:08   ` [PATCH 8/8] arm64/efi: memblock_remove rather than _reserve UEFI reserved RAM Ard Biesheuvel
2014-12-22 19:08     ` Ard Biesheuvel
2014-12-26  9:35   ` [PATCH 0/8] arm64: improved memory map handling for /dev/mem, ACPI etc Dave Young
2014-12-26  9:35     ` Dave Young
     [not found]     ` <20141226093528.GA26133-4/PLUo9XfK/1wF9wiOj0lkEOCMrvLtNR@public.gmane.org>
2014-12-29  9:22       ` Ard Biesheuvel
2014-12-29  9:22         ` Ard Biesheuvel
     [not found]         ` <CAKv+Gu_1VCJK7y5U9H-mhjjN6AFW8+SGvbKUZfuzx6qGEpVg0A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-30  9:25           ` Dave Young
2014-12-30  9:25             ` Dave Young
     [not found]             ` <20141230092514.GF2457-4/PLUo9XfK/1wF9wiOj0lkEOCMrvLtNR@public.gmane.org>
2014-12-30 13:21               ` Ard Biesheuvel
2014-12-30 13:21                 ` Ard Biesheuvel
     [not found]                 ` <CAKv+Gu_Ou6Fv7-AUcpbUJAijwEJ8=PCB1mQU3mCfctLFAMhu_w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-04  8:19                   ` Dave Young
2015-01-04  8:19                     ` Dave Young
     [not found]                     ` <20150104081905.GA6231-4/PLUo9XfK/1wF9wiOj0lkEOCMrvLtNR@public.gmane.org>
2015-01-05  9:18                       ` Ard Biesheuvel
2015-01-05  9:18                         ` Ard Biesheuvel
     [not found]                         ` <CAKv+Gu-P7AeMNveZMe814FgrEr_z26vaYKWa=borKoPSc76Y6g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-06  8:16                           ` Dave Young
2015-01-06  8:16                             ` Dave Young
     [not found]                             ` <20150106081635.GE2113-4/PLUo9XfK/1wF9wiOj0lkEOCMrvLtNR@public.gmane.org>
2015-01-07 11:41                               ` Ard Biesheuvel
2015-01-07 11:41                                 ` Ard Biesheuvel
     [not found]                                 ` <CAKv+Gu9DQLZnvNyF0qdk5jSH6=NvdsKYTX+E46U=kGRzCEfwHg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-08  1:29                                   ` Dave Young
2015-01-08  1:29                                     ` Dave Young

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.