Skip to content

RFC x86: Refactor the setup code to provide a base for embedded platforms

Thomas Gleixner linux-arch lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest32 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/32x86: Add platform_setup infrastructurearch/x86/include/asm/platform.h arch/x86/include/asm/setup.h arch/x86/kernel/Makefile +1 more+43 -10 replies
2/32x86: Add probe_roms to platform_setuparch/x86/include/asm/platform.h arch/x86/kernel/head32.c arch/x86/kernel/platform_setup.c +1 more+18 -312 replies
3/32x86: Add request_standard_resources to platform_setuparch/x86/include/asm/platform.h arch/x86/include/asm/setup.h arch/x86/kernel/head32.c +2 more+25 -130 replies
4/32x86: Add reserve_ebda_region to platform_setuparch/x86/include/asm/platform.h arch/x86/kernel/head32.c arch/x86/kernel/head64.c +1 more+7 -40 replies
5/32x86: Move memory_setup to platformarch/x86/include/asm/e820.h arch/x86/include/asm/paravirt.h arch/x86/include/asm/platform.h +8 more+11 -320 replies
6/32x86: Sanitize smp_record and move it to platform_setuparch/x86/include/asm/platform.h arch/x86/include/asm/setup.h arch/x86/kernel/apic/numaq_32.c +2 more+26 -80 replies
7/32x86: Move ioapic_ids_setup to platform_setuparch/x86/include/asm/io_apic.h arch/x86/include/asm/platform.h arch/x86/include/asm/setup.h +4 more+23 -170 replies
8/32x86: Move mpc_apic_id to platform_setuparch/x86/include/asm/mpspec.h arch/x86/include/asm/platform.h arch/x86/include/asm/setup.h +3 more+15 -70 replies
9/32x86: Move smp_read_mpc_oem to platform_setuparch/x86/include/asm/mpspec.h arch/x86/include/asm/platform.h arch/x86/include/asm/setup.h +3 more+13 -100 replies
10/32x86: Move mpc_oem_pci_bus to platform_setuparch/x86/include/asm/platform.h arch/x86/include/asm/setup.h arch/x86/kernel/apic/numaq_32.c +1 more+6 -40 replies
11/32x86: Move oem_bus_info to platform_setuparch/x86/include/asm/mpspec.h arch/x86/include/asm/platform.h arch/x86/include/asm/setup.h +3 more+18 -100 replies
12/32x86: Move get/find_smp_config to platform_setuparch/x86/include/asm/mpspec.h arch/x86/include/asm/platform.h arch/x86/include/asm/setup.h +5 more+36 -530 replies
13/32x86: Move pre_intr_init to platform_setuparch/x86/include/asm/irq.h arch/x86/include/asm/platform.h arch/x86/include/asm/setup.h +4 more+22 -310 replies
14/32x86: Move irq_init to platform_setuparch/x86/include/asm/irq.h arch/x86/include/asm/paravirt.h arch/x86/include/asm/platform.h +9 more+11 -420 replies
15/32x86: Move traps_init to platform_setuparch/x86/include/asm/platform.h arch/x86/include/asm/setup.h arch/x86/kernel/apic/numaq_32.c +4 more+8 -270 replies
16/32x86: Replace ARCH_SETUP by a proper platform functionarch/x86/include/asm/paravirt.h arch/x86/include/asm/platform.h arch/x86/kernel/paravirt.c +3 more+15 -94 replies
17/32x86: Move paravirt banner printout to platformarch/x86/include/asm/paravirt.h arch/x86/include/asm/platform.h arch/x86/kernel/paravirt.c +3 more+11 -110 replies
18/32x86: Move paravirt pagetable_setup to platformarch/x86/include/asm/paravirt.h arch/x86/include/asm/pgtable.h arch/x86/include/asm/pgtable_types.h +7 more+32 -460 replies
19/32x86: Move xen_post_allocator_init into xen_pagetable_setup_donearch/x86/include/asm/paravirt.h arch/x86/include/asm/setup.h arch/x86/kernel/setup.c +3 more+4 -190 replies
20/32x86: Move percpu clockevents setup to platformarch/x86/include/asm/apic.h arch/x86/include/asm/paravirt.h arch/x86/include/asm/platform.h +7 more+43 -280 replies
21/32x86: Add timer_init to platformarch/x86/include/asm/paravirt.h arch/x86/include/asm/platform.h arch/x86/include/asm/setup.h +13 more+54 -1141 reply
22/32x86: Remove do_timer hookarch/x86/include/asm/do_timer.h arch/x86/kernel/time_32.c+4 -190 replies
23/32x86: Prepare unification of time_32/64.carch/x86/kernel/time_32.c arch/x86/kernel/time_64.c+16 -390 replies
24/32x86: Simplify timer_ack magic in time_32.carch/x86/include/asm/timer.h arch/x86/kernel/time_32.c arch/x86/kernel/time_64.c+21 -40 replies
25/32x86: Remove mca bus ifdef from timer interruptarch/x86/kernel/time_32.c arch/x86/kernel/time_64.c+6 -210 replies
26/32x86: Make timer setup and global variables the same in time_32/64.carch/x86/kernel/time_32.c arch/x86/kernel/time_64.c+35 -110 replies
27/32x86: Move calibrate_cpu to tsc.carch/x86/include/asm/time.h arch/x86/kernel/time_32.c arch/x86/kernel/time_64.c +1 more+55 -560 replies
28/32x86: time_32/64.c unify profile_pcarch/x86/kernel/time_32.c arch/x86/kernel/time_64.c+11 -100 replies
29/32x86: Replace the now identical time_32/64.c by time.carch/x86/kernel/Makefile arch/x86/kernel/time.c arch/x86/kernel/time_32.c +1 more+121 -2410 replies
30/32x86: Move tsc_calibration to platformarch/x86/include/asm/hypervisor.h arch/x86/include/asm/paravirt.h arch/x86/include/asm/platform.h +14 more+42 -480 replies
31/32init: Move sched_clock_init after late_time_initinit/main.c+1 -10 replies
32/32x86: Move tsc_init to late_time_initarch/x86/kernel/time.c+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC patch 00/32] x86: Refactor the setup code to provide a base for embedded platforms

The recently posted Moorestown support patches finally indicate the arrival of the embedded nightmare to arch/x86.

Moorestown is a SoC with a x86 core and a bunch of random peripherals glued around it. It finally gets rid of legacy hardware like PIT, 8042 et. al. but on the other hand it introduces the full embedded horror by adding random peripheral IP cores as an replacement which are glued onto the x86 CPU with duct tape and other nasty tricks.

The most remarkable achievement is the PIT replacement AHBT timer which is originally an ARM AMBA based IP core and provides random timer readout and other fancy features. It's the final prove that Intel HW folks are unable to design a working timer. Sigh, I eventually hoped that we see something usable in that area after a decade of suffering. :(

Anyway. We want to support Moorestown & Co. nevertheless, but as we have seen from the initial patches it needs to fiddle in the guts of the x86 setup code. Most of the points where it interferes are already covered by x86_quirks or paravirt modifications, but we cannot use either of those to do sane multi platform support.

The following patch series refactors the setup related x86_quirks and the setup related paravirt hooks and puts them into an extensible platform_setup infrastructure to provide a proper base for adding the Moorestown modifications. As a side effect it also unifies time_32/64.c and removes some leftovers of the pre arch/x86 era.

Note, this is not a replacement for paravirt_ops. It is just replacing the setup related paravirt stuff so it can be reused for other platforms though I have to say that it removes a fair amount of obscurity which was introduced by paravirt & Co.

The total result of this overhaul is:

 arch/x86/include/asm/do_timer.h                |   16 --
 arch/x86/kernel/time_32.c                      |  137 -------------------------
 arch/x86/kernel/time_64.c                      |  135 ------------------------
 linux-2.6/arch/x86/include/asm/apic.h          |    3 
 linux-2.6/arch/x86/include/asm/e820.h          |    2 
 linux-2.6/arch/x86/include/asm/hypervisor.h    |    2 
 linux-2.6/arch/x86/include/asm/io_apic.h       |    3 
 linux-2.6/arch/x86/include/asm/irq.h           |    3 
 linux-2.6/arch/x86/include/asm/mpspec.h        |   40 ++++++-
 linux-2.6/arch/x86/include/asm/paravirt.h      |   63 -----------
 linux-2.6/arch/x86/include/asm/pgtable.h       |   10 -
 linux-2.6/arch/x86/include/asm/pgtable_types.h |    4 
 linux-2.6/arch/x86/include/asm/platform.h      |  130 +++++++++++++++++++++++
 linux-2.6/arch/x86/include/asm/setup.h         |   45 --------
 linux-2.6/arch/x86/include/asm/time.h          |    3 
 linux-2.6/arch/x86/include/asm/timer.h         |   14 --
 linux-2.6/arch/x86/include/asm/tsc.h           |    3 
 linux-2.6/arch/x86/include/asm/vmware.h        |    2 
 linux-2.6/arch/x86/kernel/Makefile             |    4 
 linux-2.6/arch/x86/kernel/apic/apic.c          |    3 
 linux-2.6/arch/x86/kernel/apic/io_apic.c       |   11 --
 linux-2.6/arch/x86/kernel/apic/numaq_32.c      |   55 ++++------
 linux-2.6/arch/x86/kernel/cpu/hypervisor.c     |   14 +-
 linux-2.6/arch/x86/kernel/cpu/vmware.c         |   35 +++---
 linux-2.6/arch/x86/kernel/e820.c               |   19 ---
 linux-2.6/arch/x86/kernel/head32.c             |   11 +-
 linux-2.6/arch/x86/kernel/head64.c             |    3 
 linux-2.6/arch/x86/kernel/irqinit.c            |   36 +-----
 linux-2.6/arch/x86/kernel/kvmclock.c           |    7 -
 linux-2.6/arch/x86/kernel/mpparse.c            |   75 ++++---------
 linux-2.6/arch/x86/kernel/paravirt.c           |   34 ------
 linux-2.6/arch/x86/kernel/platform_setup.c     |   73 +++++++++++++
 linux-2.6/arch/x86/kernel/setup.c              |  111 ++------------------
 linux-2.6/arch/x86/kernel/smpboot.c            |    4 
 linux-2.6/arch/x86/kernel/time.c               |  120 +++++++++++++++++++++
 linux-2.6/arch/x86/kernel/traps.c              |    5 
 linux-2.6/arch/x86/kernel/tsc.c                |   69 ++++++++++--
 linux-2.6/arch/x86/kernel/visws_quirks.c       |   56 +++-------
 linux-2.6/arch/x86/kernel/vmi_32.c             |    9 -
 linux-2.6/arch/x86/kernel/vmiclock_32.c        |    2 
 linux-2.6/arch/x86/lguest/boot.c               |    9 -
 linux-2.6/arch/x86/xen/enlighten.c             |   23 ++--
 linux-2.6/arch/x86/xen/irq.c                   |    5 
 linux-2.6/arch/x86/xen/mmu.c                   |   16 ++
 linux-2.6/arch/x86/xen/mmu.h                   |    2 
 linux-2.6/arch/x86/xen/xen-ops.h               |    2 
 linux-2.6/init/main.c                          |    2 
 47 files changed, 622 insertions(+), 808 deletions(-)

Thanks,

tglx