linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/50] x86: Clean up and reorganize the E820 table handling code
@ 2017-01-28 22:11 Ingo Molnar
  2017-01-28 22:11 ` [PATCH 01/50] x86/boot/e820: Introduce arch/x86/include/asm/e820/types.h Ingo Molnar
                   ` (49 more replies)
  0 siblings, 50 replies; 65+ messages in thread
From: Ingo Molnar @ 2017-01-28 22:11 UTC (permalink / raw)
  To: linux-kernel
  Cc: Andrew Morton, Andy Lutomirski, Borislav Petkov, H . Peter Anvin,
	Linus Torvalds, Peter Zijlstra, Thomas Gleixner, Yinghai Lu

When reviewing an E820 patch two days ago I noticed that our E820 code
in arch/x86/kernel/e820.c has bitrotten quite a bit, and started
cleaning it up a bit.

Didn't suspect that I'd end up with 50 patches, but oh well ...

The code got the usual treatments to turn it into a modern, cleanly
structured kernel facility:

 - split the e820.h header split into asm/e820/types.h and asm/e820/api.h
   and moved most of it out of the UAPI export,

 - eliminated a number of header dependency hell related
   to the E820 code,

 - clarified and standardized the API names, the variable names, the
   overall code style and the comments,

 - cleaned up and modernized the various basic types used,

 - fixed a ton of comments and weird constructs and added comments
   where they were missing.

There's a lot more: see the individual patches for details. There's no
big functional changes, but the overall diffstat is pretty significant,
due to cleaning out of 10+ years of gradually accumulated cruft.

It should now be possible for someone to understand the code from first
principles, without too much hassle.

The patches can also be accessed in the following Git tree:

   git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.x86/boot

The code has been through a fair amount of testing, but only on a limited
number of test systems.

Ingo Molnar (50):
  x86/boot/e820: Introduce arch/x86/include/asm/e820/types.h
  x86/boot/e820: Clean up and improve comments in asm/e820/types.h
  x86/boot/e820: Move asm/e820.h to asm/e820/api.h
  x86/boot/e820: Split minimal UAPI types out into uapi/asm/e820/types.h
  x86/boot/e820: Clean up the E820_X_MAX definition
  x86/boot/e820: Remove spurious asm/e820/api.h inclusions
  x86/boot/e820: Remove assembly guard from asm/e820/types.h
  x86/boot/e820: Clean up asm/e820/api.h
  x86/boot/e820: Remove unnecessary __ASSEMBLY__ guard
  x86/boot/e820: Move HIGH_MEMORY define to asm/e820/types.h
  x86/boot/e820: Rename the basic e820 data types to 'struct e820_entry' and 'struct e820_array'
  x86/boot/e820: Remove unnecessary #include <linux/ioport.h> from asm/e820/api.h
  x86/boot/e820: Remove e820_mark_nosave_regions() definition uglies
  x86/boot/e820: Rename 'e820_map' variables to 'e820_array'
  x86/boot/e820: Rename everything to e820_table
  x86/boot/e820: Harmonize the 'struct e820_table' fields
  x86/boot/e820: Rename default_machine_specific_memory_setup() to e820__memory_setup_default()
  x86/boot/e820: Rename e820_table_saved to e820_table_firmware and improve the description
  x86/boot/e820: Basic cleanup of e820.c
  x86/boot/e820: Rename memblock_x86_fill() to e820__memblock_setup() and improve the explanations
  x86/boot/e820: Consolidate 'struct e820_entry *entry' local variable names
  x86/boot/e820: Convert printk(KERN_* ...) to pr_*()
  x86/boot/e820: Move the memblock_find_dma_reserve() function and rename it to memblock_set_dma_reserve()
  x86/boot/e820: Rename parse_e820_ext() to e820__memory_setup_extended()
  x86/boot/e820: Move e820_reserve_setup_data() to e820.c
  x86/boot/e820: Clarify the role of finish_e820_parsing() and rename it to e820__finish_early_params()
  x86/boot/e820: Rename early_reserve_e820() to e820__memblock_alloc() and document it
  x86/boot/e820: Rename update_e820() to e820__update_table()
  x86/boot/e820: Rename sanitize_e820_table() to e820__update_table()
  x86/boot/e820: Rename e820_any_mapped()/e820_all_mapped() to e820__mapped_any()/e820__mapped_all()
  x86/boot/e820: Rename e820_setup_gap() to e820__setup_pci_gap()
  x86/boot/e820: Create coherent API function names for E820 range operations
  x86/boot/e820: Rename e820_print_map() to e820__print_table()
  x86/boot/e820: Reorder the function prototypes in api.h
  x86/boot/e820: Simplify e820_reserve_resources()
  x86/boot/e820: Introduce 'enum e820_type'
  x86/boot/e820: Use 'enum e820_type' in 'struct e820_entry'
  x86/boot/e820: Use 'enum e820_type' when handling the e820 region type
  x86/boot/e820: Prefix the E820_* type names with "E820_TYPE_"
  x86/boot/e820: Clean up the E820 table size define names
  x86/boot/e820: Clean up and standardize sizeof() uses
  xen, x86/boot/e820: Simplify Xen's xen_e820_table construct
  x86/boot/e820: Simplify the e820__update_table() interface
  x86/boot/e820: Clean up __e820__update_table() et al
  x86/boot/e820: Document e820__reserve_setup_data()
  x86/boot/e820: Use bool in query APIs
  x86/boot/e820: Rename e820_reserve_resources*() to e820__reserve_resources*()
  x86/boot/e820: Rename e820_mark_nosave_regions() to e820__register_nosave_regions()
  x86/boot/e820: Remove unnecessary #include's
  x86/boot/e820: Rename the remaining E820 APIs to the e820__*() prefix

 Documentation/x86/zero-page.txt        |    6 +-
 arch/x86/boot/compressed/eboot.c       |   44 +--
 arch/x86/boot/compressed/kaslr.c       |    6 +-
 arch/x86/boot/header.S                 |    1 -
 arch/x86/boot/memory.c                 |    6 +-
 arch/x86/include/asm/acpi.h            |    2 +
 arch/x86/include/asm/e820.h            |   73 ----
 arch/x86/include/asm/e820/api.h        |   50 +++
 arch/x86/include/asm/e820/types.h      |   58 +++
 arch/x86/include/asm/gart.h            |    4 +-
 arch/x86/include/asm/mpspec.h          |    4 +-
 arch/x86/include/asm/pci_x86.h         |    2 +
 arch/x86/include/asm/pgtable.h         |    3 +-
 arch/x86/include/uapi/asm/bootparam.h  |    4 +-
 arch/x86/include/uapi/asm/e820/types.h |   55 +++
 arch/x86/kernel/acpi/boot.c            |    5 +-
 arch/x86/kernel/aperture_64.c          |   10 +-
 arch/x86/kernel/apic/apic.c            |    2 +-
 arch/x86/kernel/apic/apic_noop.c       |    2 +-
 arch/x86/kernel/apic/probe_32.c        |    2 +-
 arch/x86/kernel/apic/x2apic_uv_x.c     |    1 +
 arch/x86/kernel/cpu/centaur.c          |    2 +-
 arch/x86/kernel/cpu/mtrr/cleanup.c     |    6 +-
 arch/x86/kernel/cpu/mtrr/main.c        |    2 +-
 arch/x86/kernel/crash.c                |   23 +-
 arch/x86/kernel/e820.c                 | 1032 ++++++++++++++++++++++++++--------------------------
 arch/x86/kernel/early-quirks.c         |    4 +-
 arch/x86/kernel/head32.c               |    2 +-
 arch/x86/kernel/head64.c               |    2 +-
 arch/x86/kernel/kexec-bzimage64.c      |   18 +-
 arch/x86/kernel/mpparse.c              |    6 +-
 arch/x86/kernel/probe_roms.c           |    2 +-
 arch/x86/kernel/resource.c             |    8 +-
 arch/x86/kernel/setup.c                |   78 ++--
 arch/x86/kernel/tboot.c                |   16 +-
 arch/x86/kernel/x86_init.c             |    4 +-
 arch/x86/lguest/boot.c                 |    8 +-
 arch/x86/lib/kaslr.c                   |    2 +-
 arch/x86/mm/amdtopology.c              |    2 +-
 arch/x86/mm/init.c                     |   59 ++-
 arch/x86/mm/init_32.c                  |    2 +-
 arch/x86/mm/init_64.c                  |   26 +-
 arch/x86/mm/ioremap.c                  |    3 +-
 arch/x86/mm/kasan_init_64.c            |    5 +-
 arch/x86/mm/mmio-mod.c                 |    2 +-
 arch/x86/mm/numa.c                     |    2 +-
 arch/x86/mm/pageattr.c                 |    2 +-
 arch/x86/mm/pat.c                      |    3 +-
 arch/x86/mm/pgtable_32.c               |    2 +-
 arch/x86/mm/srat.c                     |    2 +-
 arch/x86/pci/i386.c                    |    4 +-
 arch/x86/pci/mmconfig-shared.c         |   22 +-
 arch/x86/pci/mmconfig_32.c             |    2 +-
 arch/x86/pci/mmconfig_64.c             |    2 +-
 arch/x86/pci/pcbios.c                  |    2 +
 arch/x86/platform/efi/efi.c            |   19 +-
 arch/x86/platform/efi/efi_64.c         |    2 +-
 arch/x86/platform/efi/quirks.c         |    8 +-
 arch/x86/power/hibernate_64.c          |   16 +-
 arch/x86/xen/mmu.c                     |    2 +-
 arch/x86/xen/setup.c                   |   97 +++--
 drivers/acpi/tables.c                  |    2 +-
 drivers/char/agp/amd64-agp.c           |    2 +-
 include/xen/page.h                     |    2 +-
 tools/lguest/lguest.c                  |    2 +-
 65 files changed, 989 insertions(+), 860 deletions(-)
 delete mode 100644 arch/x86/include/asm/e820.h
 create mode 100644 arch/x86/include/asm/e820/api.h
 create mode 100644 arch/x86/include/asm/e820/types.h
 create mode 100644 arch/x86/include/uapi/asm/e820/types.h

-- 
2.7.4

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

end of thread, other threads:[~2017-02-01  8:56 UTC | newest]

Thread overview: 65+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-28 22:11 [PATCH 00/50] x86: Clean up and reorganize the E820 table handling code Ingo Molnar
2017-01-28 22:11 ` [PATCH 01/50] x86/boot/e820: Introduce arch/x86/include/asm/e820/types.h Ingo Molnar
2017-01-29 17:13   ` Sam Ravnborg
2017-01-30  7:58     ` Ingo Molnar
2017-01-31  5:41       ` Sam Ravnborg
2017-01-31 16:35         ` Ingo Molnar
2017-01-31 17:22           ` Sam Ravnborg
2017-01-31 18:00             ` Ingo Molnar
2017-01-31 18:04               ` Joe Perches
2017-01-31 19:17               ` Sam Ravnborg
2017-02-01  8:56                 ` Ingo Molnar
2017-01-28 22:11 ` [PATCH 02/50] x86/boot/e820: Clean up and improve comments in asm/e820/types.h Ingo Molnar
2017-01-28 22:11 ` [PATCH 03/50] x86/boot/e820: Move asm/e820.h to asm/e820/api.h Ingo Molnar
2017-01-28 22:11 ` [PATCH 04/50] x86/boot/e820: Split minimal UAPI types out into uapi/asm/e820/types.h Ingo Molnar
2017-01-28 22:11 ` [PATCH 05/50] x86/boot/e820: Clean up the E820_X_MAX definition Ingo Molnar
2017-01-28 22:11 ` [PATCH 06/50] x86/boot/e820: Remove spurious asm/e820/api.h inclusions Ingo Molnar
2017-01-28 22:11 ` [PATCH 07/50] x86/boot/e820: Remove assembly guard from asm/e820/types.h Ingo Molnar
2017-01-28 22:11 ` [PATCH 08/50] x86/boot/e820: Clean up asm/e820/api.h Ingo Molnar
2017-01-28 22:11 ` [PATCH 09/50] x86/boot/e820: Remove unnecessary __ASSEMBLY__ guard Ingo Molnar
2017-01-28 22:11 ` [PATCH 10/50] x86/boot/e820: Move HIGH_MEMORY define to asm/e820/types.h Ingo Molnar
2017-01-28 22:11 ` [PATCH 11/50] x86/boot/e820: Rename the basic e820 data types to 'struct e820_entry' and 'struct e820_array' Ingo Molnar
2017-01-28 22:11 ` [PATCH 12/50] x86/boot/e820: Remove unnecessary #include <linux/ioport.h> from asm/e820/api.h Ingo Molnar
2017-01-28 22:11 ` [PATCH 13/50] x86/boot/e820: Remove e820_mark_nosave_regions() definition uglies Ingo Molnar
2017-01-28 22:11 ` [PATCH 14/50] x86/boot/e820: Rename 'e820_map' variables to 'e820_array' Ingo Molnar
2017-01-28 22:11 ` [PATCH 15/50] x86/boot/e820: Rename everything to e820_table Ingo Molnar
2017-01-28 22:11 ` [PATCH 16/50] x86/boot/e820: Harmonize the 'struct e820_table' fields Ingo Molnar
2017-01-28 22:11 ` [PATCH 17/50] x86/boot/e820: Rename default_machine_specific_memory_setup() to e820__memory_setup_default() Ingo Molnar
2017-01-28 22:11 ` [PATCH 18/50] x86/boot/e820: Rename e820_table_saved to e820_table_firmware and improve the description Ingo Molnar
2017-01-28 22:11 ` [PATCH 19/50] x86/boot/e820: Basic cleanup of e820.c Ingo Molnar
2017-01-28 22:11 ` [PATCH 20/50] x86/boot/e820: Rename memblock_x86_fill() to e820__memblock_setup() and improve the explanations Ingo Molnar
2017-01-28 22:11 ` [PATCH 21/50] x86/boot/e820: Consolidate 'struct e820_entry *entry' local variable names Ingo Molnar
2017-01-28 22:11 ` [PATCH 22/50] x86/boot/e820: Convert printk(KERN_* ...) to pr_*() Ingo Molnar
2017-01-28 22:59   ` Joe Perches
2017-01-28 22:11 ` [PATCH 23/50] x86/boot/e820: Move the memblock_find_dma_reserve() function and rename it to memblock_set_dma_reserve() Ingo Molnar
2017-01-28 22:11 ` [PATCH 24/50] x86/boot/e820: Rename parse_e820_ext() to e820__memory_setup_extended() Ingo Molnar
2017-01-28 22:11 ` [PATCH 25/50] x86/boot/e820: Move e820_reserve_setup_data() to e820.c Ingo Molnar
2017-01-28 22:11 ` [PATCH 26/50] x86/boot/e820: Clarify the role of finish_e820_parsing() and rename it to e820__finish_early_params() Ingo Molnar
2017-01-28 22:11 ` [PATCH 27/50] x86/boot/e820: Rename early_reserve_e820() to e820__memblock_alloc() and document it Ingo Molnar
2017-01-28 22:11 ` [PATCH 28/50] x86/boot/e820: Rename update_e820() to e820__update_table() Ingo Molnar
2017-01-28 22:11 ` [PATCH 29/50] x86/boot/e820: Rename sanitize_e820_table() " Ingo Molnar
2017-01-28 22:11 ` [PATCH 30/50] x86/boot/e820: Rename e820_any_mapped()/e820_all_mapped() to e820__mapped_any()/e820__mapped_all() Ingo Molnar
2017-01-28 22:11 ` [PATCH 31/50] x86/boot/e820: Rename e820_setup_gap() to e820__setup_pci_gap() Ingo Molnar
2017-01-28 22:11 ` [PATCH 32/50] x86/boot/e820: Create coherent API function names for E820 range operations Ingo Molnar
2017-01-28 22:11 ` [PATCH 33/50] x86/boot/e820: Rename e820_print_map() to e820__print_table() Ingo Molnar
2017-01-28 22:11 ` [PATCH 34/50] x86/boot/e820: Reorder the function prototypes in api.h Ingo Molnar
2017-01-28 22:11 ` [PATCH 35/50] x86/boot/e820: Simplify e820_reserve_resources() Ingo Molnar
2017-01-28 22:11 ` [PATCH 36/50] x86/boot/e820: Introduce 'enum e820_type' Ingo Molnar
2017-01-28 22:11 ` [PATCH 37/50] x86/boot/e820: Use 'enum e820_type' in 'struct e820_entry' Ingo Molnar
2017-01-28 23:07   ` Linus Torvalds
2017-01-29  9:19     ` Ingo Molnar
2017-01-29 12:38       ` [PATCH] x86/boot/e820: Separate the E820 ABI structures from the in-kernel structures Ingo Molnar
2017-01-29 18:53       ` [PATCH 37/50] x86/boot/e820: Use 'enum e820_type' in 'struct e820_entry' Linus Torvalds
2017-01-28 22:11 ` [PATCH 38/50] x86/boot/e820: Use 'enum e820_type' when handling the e820 region type Ingo Molnar
2017-01-28 22:12 ` [PATCH 39/50] x86/boot/e820: Prefix the E820_* type names with "E820_TYPE_" Ingo Molnar
2017-01-28 22:12 ` [PATCH 40/50] x86/boot/e820: Clean up the E820 table size define names Ingo Molnar
2017-01-28 22:12 ` [PATCH 41/50] x86/boot/e820: Clean up and standardize sizeof() uses Ingo Molnar
2017-01-28 22:12 ` [PATCH 42/50] xen, x86/boot/e820: Simplify Xen's xen_e820_table construct Ingo Molnar
2017-01-28 22:12 ` [PATCH 43/50] x86/boot/e820: Simplify the e820__update_table() interface Ingo Molnar
2017-01-28 22:12 ` [PATCH 44/50] x86/boot/e820: Clean up __e820__update_table() et al Ingo Molnar
2017-01-28 22:12 ` [PATCH 45/50] x86/boot/e820: Document e820__reserve_setup_data() Ingo Molnar
2017-01-28 22:12 ` [PATCH 46/50] x86/boot/e820: Use bool in query APIs Ingo Molnar
2017-01-28 22:12 ` [PATCH 47/50] x86/boot/e820: Rename e820_reserve_resources*() to e820__reserve_resources*() Ingo Molnar
2017-01-28 22:12 ` [PATCH 48/50] x86/boot/e820: Rename e820_mark_nosave_regions() to e820__register_nosave_regions() Ingo Molnar
2017-01-28 22:12 ` [PATCH 49/50] x86/boot/e820: Remove unnecessary #include's Ingo Molnar
2017-01-28 22:12 ` [PATCH 50/50] x86/boot/e820: Rename the remaining E820 APIs to the e820__*() prefix Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).