Commit 9f2a4301 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'core-headers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull header cleanup from Ingo Molnar:
 "This is a treewide cleanup, mostly (but not exclusively) with x86
  impact, which breaks implicit dependencies on the asm/realtime.h
  header and finally removes it from asm/acpi.h"

* 'core-headers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/ACPI/sleep: Move acpi_get_wakeup_address() into sleep.c, remove <asm/realmode.h> from <asm/acpi.h>
  ACPI/sleep: Convert acpi_wakeup_address into a function
  x86/ACPI/sleep: Remove an unnecessary include of asm/realmode.h
  ASoC: Intel: Skylake: Explicitly include linux/io.h for virt_to_phys()
  vmw_balloon: Explicitly include linux/io.h for virt_to_phys()
  virt: vbox: Explicitly include linux/io.h to pick up various defs
  efi/capsule-loader: Explicitly include linux/io.h for page_to_phys()
  perf/x86/intel: Explicitly include asm/io.h to use virt_to_phys()
  x86/kprobes: Explicitly include vmalloc.h for set_vm_flush_reset_perms()
  x86/ftrace: Explicitly include vmalloc.h for set_vm_flush_reset_perms()
  x86/boot: Explicitly include realmode.h to handle RM reservations
  x86/efi: Explicitly include realmode.h to handle RM trampoline quirk
  x86/platform/intel/quark: Explicitly include linux/io.h for virt_to_phys()
  x86/setup: Enhance the comments
  x86/setup: Clean up the header portion of setup.c
parents b0be0eff 96078642
...@@ -38,7 +38,10 @@ int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); ...@@ -38,7 +38,10 @@ int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
/* Low-level suspend routine. */ /* Low-level suspend routine. */
extern int acpi_suspend_lowlevel(void); extern int acpi_suspend_lowlevel(void);
extern unsigned long acpi_wakeup_address; static inline unsigned long acpi_get_wakeup_address(void)
{
return 0;
}
/* /*
* Record the cpei override flag and current logical cpu. This is * Record the cpei override flag and current logical cpu. This is
......
...@@ -42,8 +42,6 @@ int acpi_lapic; ...@@ -42,8 +42,6 @@ int acpi_lapic;
unsigned int acpi_cpei_override; unsigned int acpi_cpei_override;
unsigned int acpi_cpei_phys_cpuid; unsigned int acpi_cpei_phys_cpuid;
unsigned long acpi_wakeup_address = 0;
#define ACPI_MAX_PLATFORM_INTERRUPTS 256 #define ACPI_MAX_PLATFORM_INTERRUPTS 256
/* Array to record platform interrupt vectors for generic interrupt routing. */ /* Array to record platform interrupt vectors for generic interrupt routing. */
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <asm/perf_event.h> #include <asm/perf_event.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
#include <asm/insn.h> #include <asm/insn.h>
#include <asm/io.h>
#include "../perf_event.h" #include "../perf_event.h"
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/mmu.h> #include <asm/mmu.h>
#include <asm/mpspec.h> #include <asm/mpspec.h>
#include <asm/realmode.h>
#include <asm/x86_init.h> #include <asm/x86_init.h>
#ifdef CONFIG_ACPI_APEI #ifdef CONFIG_ACPI_APEI
...@@ -62,7 +61,7 @@ static inline void acpi_disable_pci(void) ...@@ -62,7 +61,7 @@ static inline void acpi_disable_pci(void)
extern int (*acpi_suspend_lowlevel)(void); extern int (*acpi_suspend_lowlevel)(void);
/* Physical address to resume after wakeup */ /* Physical address to resume after wakeup */
#define acpi_wakeup_address ((unsigned long)(real_mode_header->wakeup_start)) unsigned long acpi_get_wakeup_address(void);
/* /*
* Check if the CPU can handle C2 and deeper * Check if the CPU can handle C2 and deeper
......
...@@ -26,6 +26,17 @@ unsigned long acpi_realmode_flags; ...@@ -26,6 +26,17 @@ unsigned long acpi_realmode_flags;
static char temp_stack[4096]; static char temp_stack[4096];
#endif #endif
/**
* acpi_get_wakeup_address - provide physical address for S3 wakeup
*
* Returns the physical address where the kernel should be resumed after the
* system awakes from S3, e.g. for programming into the firmware waking vector.
*/
unsigned long acpi_get_wakeup_address(void)
{
return ((unsigned long)(real_mode_header->wakeup_start));
}
/** /**
* x86_acpi_enter_sleep_state - enter sleep state * x86_acpi_enter_sleep_state - enter sleep state
* @state: Sleep state to enter. * @state: Sleep state to enter.
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Variables and functions used by the code in sleep.c * Variables and functions used by the code in sleep.c
*/ */
#include <asm/realmode.h> #include <linux/linkage.h>
extern unsigned long saved_video_mode; extern unsigned long saved_video_mode;
extern long saved_magic; extern long saved_magic;
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/memory.h> #include <linux/memory.h>
#include <linux/vmalloc.h>
#include <trace/syscall.h> #include <trace/syscall.h>
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <linux/frame.h> #include <linux/frame.h>
#include <linux/kasan.h> #include <linux/kasan.h>
#include <linux/moduleloader.h> #include <linux/moduleloader.h>
#include <linux/vmalloc.h>
#include <asm/text-patching.h> #include <asm/text-patching.h>
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
......
...@@ -2,130 +2,53 @@ ...@@ -2,130 +2,53 @@
/* /*
* Copyright (C) 1995 Linus Torvalds * Copyright (C) 1995 Linus Torvalds
* *
* Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999 * This file contains the setup_arch() code, which handles the architecture-dependent
* * parts of early kernel initialization.
* Memory region support
* David Parsons <orc@pell.chi.il.us>, July-August 1999
*
* Added E820 sanitization routine (removes overlapping memory regions);
* Brian Moyle <bmoyle@mvista.com>, February 2001
*
* Moved CPU detection code to cpu/${cpu}.c
* Patrick Mochel <mochel@osdl.org>, March 2002
*
* Provisions for empty E820 memory regions (reported by certain BIOSes).
* Alex Achenbach <xela@slit.de>, December 2002.
*
*/
/*
* This file handles the architecture-dependent parts of initialization
*/ */
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/mmzone.h>
#include <linux/screen_info.h>
#include <linux/ioport.h>
#include <linux/acpi.h>
#include <linux/sfi.h>
#include <linux/apm_bios.h>
#include <linux/initrd.h>
#include <linux/memblock.h>
#include <linux/seq_file.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/root_dev.h> #include <linux/crash_dump.h>
#include <linux/highmem.h> #include <linux/dmi.h>
#include <linux/export.h>
#include <linux/efi.h> #include <linux/efi.h>
#include <linux/init.h> #include <linux/init_ohci1394_dma.h>
#include <linux/edd.h> #include <linux/initrd.h>
#include <linux/iscsi_ibft.h> #include <linux/iscsi_ibft.h>
#include <linux/nodemask.h> #include <linux/memblock.h>
#include <linux/kexec.h>
#include <linux/dmi.h>
#include <linux/pfn.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <asm/pci-direct.h> #include <linux/root_dev.h>
#include <linux/init_ohci1394_dma.h> #include <linux/sfi.h>
#include <linux/kvm_para.h>
#include <linux/dma-contiguous.h>
#include <xen/xen.h>
#include <uapi/linux/mount.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/stddef.h>
#include <linux/unistd.h>
#include <linux/ptrace.h>
#include <linux/user.h>
#include <linux/delay.h>
#include <linux/kallsyms.h>
#include <linux/cpufreq.h>
#include <linux/dma-mapping.h>
#include <linux/ctype.h>
#include <linux/uaccess.h>
#include <linux/percpu.h>
#include <linux/crash_dump.h>
#include <linux/tboot.h> #include <linux/tboot.h>
#include <linux/jiffies.h>
#include <linux/mem_encrypt.h>
#include <linux/sizes.h>
#include <linux/usb/xhci-dbgp.h> #include <linux/usb/xhci-dbgp.h>
#include <video/edid.h>
#include <asm/mtrr.h> #include <uapi/linux/mount.h>
#include <xen/xen.h>
#include <asm/apic.h> #include <asm/apic.h>
#include <asm/realmode.h>
#include <asm/e820/api.h>
#include <asm/mpspec.h>
#include <asm/setup.h>
#include <asm/efi.h>
#include <asm/timer.h>
#include <asm/i8259.h>
#include <asm/sections.h>
#include <asm/io_apic.h>
#include <asm/ist.h>
#include <asm/setup_arch.h>
#include <asm/bios_ebda.h> #include <asm/bios_ebda.h>
#include <asm/cacheflush.h>
#include <asm/processor.h>
#include <asm/bugs.h> #include <asm/bugs.h>
#include <asm/kasan.h>
#include <asm/vsyscall.h>
#include <asm/cpu.h> #include <asm/cpu.h>
#include <asm/desc.h> #include <asm/efi.h>
#include <asm/dma.h>
#include <asm/iommu.h>
#include <asm/gart.h> #include <asm/gart.h>
#include <asm/mmu_context.h>
#include <asm/proto.h>
#include <asm/paravirt.h>
#include <asm/hypervisor.h> #include <asm/hypervisor.h>
#include <asm/olpc_ofw.h> #include <asm/io_apic.h>
#include <asm/kasan.h>
#include <asm/percpu.h> #include <asm/kaslr.h>
#include <asm/topology.h>
#include <asm/apicdef.h>
#include <asm/amd_nb.h>
#include <asm/mce.h> #include <asm/mce.h>
#include <asm/alternative.h> #include <asm/mtrr.h>
#include <asm/realmode.h>
#include <asm/olpc_ofw.h>
#include <asm/pci-direct.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/microcode.h> #include <asm/proto.h>
#include <asm/kaslr.h>
#include <asm/unwind.h> #include <asm/unwind.h>
#include <asm/vsyscall.h>
/* /*
* max_low_pfn_mapped: highest direct mapped pfn under 4GB * max_low_pfn_mapped: highest directly mapped pfn < 4 GB
* max_pfn_mapped: highest direct mapped pfn over 4GB * max_pfn_mapped: highest directly mapped pfn > 4 GB
* *
* The direct mapping only covers E820_TYPE_RAM regions, so the ranges and gaps are * The direct mapping only covers E820_TYPE_RAM regions, so the ranges and gaps are
* represented by pfn_mapped * represented by pfn_mapped[].
*/ */
unsigned long max_low_pfn_mapped; unsigned long max_low_pfn_mapped;
unsigned long max_pfn_mapped; unsigned long max_pfn_mapped;
...@@ -135,14 +58,23 @@ RESERVE_BRK(dmi_alloc, 65536); ...@@ -135,14 +58,23 @@ RESERVE_BRK(dmi_alloc, 65536);
#endif #endif
static __initdata unsigned long _brk_start = (unsigned long)__brk_base; /*
* Range of the BSS area. The size of the BSS area is determined
* at link time, with RESERVE_BRK*() facility reserving additional
* chunks.
*/
static __initdata
unsigned long _brk_start = (unsigned long)__brk_base;
unsigned long _brk_end = (unsigned long)__brk_base; unsigned long _brk_end = (unsigned long)__brk_base;
struct boot_params boot_params; struct boot_params boot_params;
/* /*
* Machine setup.. * These are the four main kernel memory regions, we put them into
* the resource tree so that kdump tools and other debugging tools
* recover it:
*/ */
static struct resource rodata_resource = { static struct resource rodata_resource = {
.name = "Kernel rodata", .name = "Kernel rodata",
.start = 0, .start = 0,
...@@ -173,16 +105,16 @@ static struct resource bss_resource = { ...@@ -173,16 +105,16 @@ static struct resource bss_resource = {
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
/* cpu data as detected by the assembly code in head_32.S */ /* CPU data as detected by the assembly code in head_32.S */
struct cpuinfo_x86 new_cpu_data; struct cpuinfo_x86 new_cpu_data;
/* common cpu data for all cpus */ /* Common CPU data for all CPUs */
struct cpuinfo_x86 boot_cpu_data __read_mostly; struct cpuinfo_x86 boot_cpu_data __read_mostly;
EXPORT_SYMBOL(boot_cpu_data); EXPORT_SYMBOL(boot_cpu_data);
unsigned int def_to_bigsmp; unsigned int def_to_bigsmp;
/* for MCA, but anyone else can use it if they want */ /* For MCA, but anyone else can use it if they want */
unsigned int machine_id; unsigned int machine_id;
unsigned int machine_submodel_id; unsigned int machine_submodel_id;
unsigned int BIOS_revision; unsigned int BIOS_revision;
...@@ -468,15 +400,15 @@ static void __init memblock_x86_reserve_range_setup_data(void) ...@@ -468,15 +400,15 @@ static void __init memblock_x86_reserve_range_setup_data(void)
/* /*
* Keep the crash kernel below this limit. * Keep the crash kernel below this limit.
* *
* On 32 bits earlier kernels would limit the kernel to the low 512 MiB * Earlier 32-bits kernels would limit the kernel to the low 512 MB range
* due to mapping restrictions. * due to mapping restrictions.
* *
* On 64bit, kdump kernel need be restricted to be under 64TB, which is * 64-bit kdump kernels need to be restricted to be under 64 TB, which is
* the upper limit of system RAM in 4-level paging mode. Since the kdump * the upper limit of system RAM in 4-level paging mode. Since the kdump
* jumping could be from 5-level to 4-level, the jumping will fail if * jump could be from 5-level paging to 4-level paging, the jump will fail if
* kernel is put above 64TB, and there's no way to detect the paging mode * the kernel is put above 64 TB, and during the 1st kernel bootup there's
* of the kernel which will be loaded for dumping during the 1st kernel * no good way to detect the paging mode of the target kernel which will be
* bootup. * loaded for dumping.
*/ */
#ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32
# define CRASH_ADDR_LOW_MAX SZ_512M # define CRASH_ADDR_LOW_MAX SZ_512M
...@@ -887,7 +819,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -887,7 +819,7 @@ void __init setup_arch(char **cmdline_p)
/* /*
* Note: Quark X1000 CPUs advertise PGE incorrectly and require * Note: Quark X1000 CPUs advertise PGE incorrectly and require
* a cr3 based tlb flush, so the following __flush_tlb_all() * a cr3 based tlb flush, so the following __flush_tlb_all()
* will not flush anything because the cpu quirk which clears * will not flush anything because the CPU quirk which clears
* X86_FEATURE_PGE has not been invoked yet. Though due to the * X86_FEATURE_PGE has not been invoked yet. Though due to the
* load_cr3() above the TLB has been flushed already. The * load_cr3() above the TLB has been flushed already. The
* quirk is invoked before subsequent calls to __flush_tlb_all() * quirk is invoked before subsequent calls to __flush_tlb_all()
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <asm/efi.h> #include <asm/efi.h>
#include <asm/uv/uv.h> #include <asm/uv/uv.h>
#include <asm/cpu_device_id.h> #include <asm/cpu_device_id.h>
#include <asm/realmode.h>
#include <asm/reboot.h> #include <asm/reboot.h>
#define EFI_MIN_RESERVE 5120 #define EFI_MIN_RESERVE 5120
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#include <asm/cpu_device_id.h> #include <asm/cpu_device_id.h>
#include <asm/imr.h> #include <asm/imr.h>
#include <asm/iosf_mbi.h> #include <asm/iosf_mbi.h>
#include <asm/io.h>
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/mm.h> #include <linux/mm.h>
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
#include <asm-generic/sections.h> #include <asm-generic/sections.h>
#include <asm/cpu_device_id.h> #include <asm/cpu_device_id.h>
#include <asm/imr.h> #include <asm/imr.h>
#include <asm/io.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/types.h> #include <linux/types.h>
......
...@@ -61,8 +61,11 @@ static struct notifier_block tts_notifier = { ...@@ -61,8 +61,11 @@ static struct notifier_block tts_notifier = {
static int acpi_sleep_prepare(u32 acpi_state) static int acpi_sleep_prepare(u32 acpi_state)
{ {
#ifdef CONFIG_ACPI_SLEEP #ifdef CONFIG_ACPI_SLEEP
unsigned long acpi_wakeup_address;
/* do we have a wakeup address for S2 and S3? */ /* do we have a wakeup address for S2 and S3? */
if (acpi_state == ACPI_STATE_S3) { if (acpi_state == ACPI_STATE_S3) {
acpi_wakeup_address = acpi_get_wakeup_address();
if (!acpi_wakeup_address) if (!acpi_wakeup_address)
return -EFAULT; return -EFAULT;
acpi_set_waking_vector(acpi_wakeup_address); acpi_set_waking_vector(acpi_wakeup_address);
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/highmem.h> #include <linux/highmem.h>
#include <linux/io.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/efi.h> #include <linux/efi.h>
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/types.h> #include <linux/types.h>
#include <linux/io.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
*/ */
#include <linux/device.h> #include <linux/device.h>
#include <linux/io.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/sizes.h> #include <linux/sizes.h>
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
*/ */
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/io.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/module.h> #include <linux/module.h>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
*/ */
#include <linux/device.h> #include <linux/device.h>
#include <linux/io.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/delay.h> #include <linux/delay.h>
#include "../common/sst-dsp.h" #include "../common/sst-dsp.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment