that require a timer override, but don't have
HPET
- - - -- -- - - acpi.debug_layer= [HW,ACPI]
- -- - - Format: <int>
- -- - - Each bit of the <int> indicates an ACPI debug layer,
- -- - - 1: enable, 0: disable. It is useful for boot time
- -- - - debugging. After system has booted up, it can be set
- -- - - via /sys/module/acpi/parameters/debug_layer.
- -- - - CONFIG_ACPI_DEBUG must be enabled for this to produce any output.
- -- - - Available bits (add the numbers together) to enable debug output
- -- - - for specific parts of the ACPI subsystem:
- -- - - 0x01 utilities 0x02 hardware 0x04 events 0x08 tables
- -- - - 0x10 namespace 0x20 parser 0x40 dispatcher
- -- - - 0x80 executer 0x100 resources 0x200 acpica debugger
- -- - - 0x400 os services 0x800 acpica disassembler.
- -- - - The number can be in decimal or prefixed with 0x in hex.
- -- - - Warning: Many of these options can produce a lot of
- -- - - output and make your system unusable. Be very careful.
- -- - -
- -- - - acpi.debug_level= [HW,ACPI]
+ + + ++ ++ + + acpi_backlight= [HW,ACPI]
+ + + ++ ++ + + acpi_backlight=vendor
+ + + ++ ++ + + acpi_backlight=video
+ + + ++ ++ + + If set to vendor, prefer vendor specific driver
+ + + ++ ++ + + (e.g. thinkpad_acpi, sony_acpi, etc.) instead
+ + + ++ ++ + + of the ACPI video.ko driver.
+ + + ++ ++ + +
+ + + ++ ++ + + acpi_display_output= [HW,ACPI]
+ + + ++ ++ + + acpi_display_output=vendor
+ + + ++ ++ + + acpi_display_output=video
+ + + ++ ++ + + See above.
+ + + ++ ++ + +
+ + + ++ ++ + + acpi.debug_layer= [HW,ACPI,ACPI_DEBUG]
+ + + ++ ++ + + acpi.debug_level= [HW,ACPI,ACPI_DEBUG]
Format: <int>
- - - - Each bit of the <int> indicates an ACPI debug layer,
- Each bit of the <int> indicates an ACPI debug level,
- - - - - 1: enable, 0: disable. It is useful for boot time
- - - - - debugging. After system has booted up, it can be set
- - - - via /sys/module/acpi/parameters/debug_layer.
- via /sys/module/acpi/parameters/debug_level.
- - - - - CONFIG_ACPI_DEBUG must be enabled for this to produce any output.
- - - - Available bits (add the numbers together) to enable debug output
- - - - for specific parts of the ACPI subsystem:
- - - - 0x01 utilities 0x02 hardware 0x04 events 0x08 tables
- - - - 0x10 namespace 0x20 parser 0x40 dispatcher
- - - - 0x80 executer 0x100 resources 0x200 acpica debugger
- - - - 0x400 os services 0x800 acpica disassembler.
- Available bits (add the numbers together) to enable different
- debug output levels of the ACPI subsystem:
- 0x01 error 0x02 warn 0x04 init 0x08 debug object
- 0x10 info 0x20 init names 0x40 parse 0x80 load
- 0x100 dispatch 0x200 execute 0x400 names 0x800 operation region
- 0x1000 bfield 0x2000 tables 0x4000 values 0x8000 objects
- 0x10000 resources 0x20000 user requests 0x40000 package.
- - - - - The number can be in decimal or prefixed with 0x in hex.
- - - - - Warning: Many of these options can produce a lot of
- - - - - output and make your system unusable. Be very careful.
- - - -
- - - - acpi.debug_level= [HW,ACPI]
- - - - Format: <int>
- - -- -- - - Each bit of the <int> indicates an ACPI debug level,
- - -- -- - - which corresponds to the level in an ACPI_DEBUG_PRINT
- - -- -- - - statement. After system has booted up, this mask
- - -- -- - - can be set via /sys/module/acpi/parameters/debug_level.
- - -- -- - -
- - -- -- - - CONFIG_ACPI_DEBUG must be enabled for this to produce
- - -- -- - - any output. The number can be in decimal or prefixed
- - -- -- - - with 0x in hex. Some of these options produce so much
- - -- -- - - output that the system is unusable.
- - -- -- - -
- - -- -- - - The following global components are defined by the
- - -- -- - - ACPI CA:
- - -- -- - - 0x01 error
- - -- -- - - 0x02 warn
- - -- -- - - 0x04 init
- - -- -- - - 0x08 debug object
- - -- -- - - 0x10 info
- - -- -- - - 0x20 init names
- - -- -- - - 0x40 parse
- - -- -- - - 0x80 load
- - -- -- - - 0x100 dispatch
- - -- -- - - 0x200 execute
- - -- -- - - 0x400 names
- - -- -- - - 0x800 operation region
- - -- -- - - 0x1000 bfield
- - -- -- - - 0x2000 tables
- - -- -- - - 0x4000 values
- - -- -- - - 0x8000 objects
- - -- -- - - 0x10000 resources
- - -- -- - - 0x20000 user requests
- - -- -- - - 0x40000 package
- - -- -- - - The number can be in decimal or prefixed with 0x in hex.
- - -- -- - - Warning: Many of these options can produce a lot of
- - -- -- - - output and make your system unusable. Be very careful.
+ + + ++ ++ + + CONFIG_ACPI_DEBUG must be enabled to produce any ACPI
+ + + ++ ++ + + debug output. Bits in debug_layer correspond to a
+ + + ++ ++ + + _COMPONENT in an ACPI source file, e.g.,
+ + + ++ ++ + + #define _COMPONENT ACPI_PCI_COMPONENT
+ + + ++ ++ + + Bits in debug_level correspond to a level in
+ + + ++ ++ + + ACPI_DEBUG_PRINT statements, e.g.,
+ + + ++ ++ + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, ...
+ + + ++ ++ + + See Documentation/acpi/debug.txt for more information
+ + + ++ ++ + + about debug layers and levels.
+ + + ++ ++ + +
+ + + ++ ++ + + Enable AML "Debug" output, i.e., stores to the Debug
+ + + ++ ++ + + object while interpreting AML:
+ + + ++ ++ + + acpi.debug_layer=0xffffffff acpi.debug_level=0x2
+ + + ++ ++ + + Enable PCI/PCI interrupt routing info messages:
+ + + ++ ++ + + acpi.debug_layer=0x400000 acpi.debug_level=0x4
+ + + ++ ++ + + Enable all messages related to ACPI hardware:
+ + + ++ ++ + + acpi.debug_layer=0x2 acpi.debug_level=0xffffffff
+ + + ++ ++ + +
+ + + ++ ++ + + Some values produce so much output that the system is
+ + + ++ ++ + + unusable. The "log_buf_len" parameter may be useful
+ + + ++ ++ + + if you need to capture more output.
+
+ acpi.power_nocheck= [HW,ACPI]
+ Format: 1/0 enable/disable the check of power state.
+ On some bogus BIOS the _PSC object/_STA object of
+ power resource can't return the correct device power
+ state. In such case it is unneccessary to check its
+ power state again in power transition.
+ 1 : disable the power state check
acpi_pm_good [X86-32,X86-64]
Override the pmtimer bug detection: force the kernel
See arch/parisc/kernel/pdc_chassis.c
pf. [PARIDE]
- - - -- -- - - See Documentation/paride.txt.
+ + + ++ ++ + + See Documentation/blockdev/paride.txt.
pg. [PARIDE]
- - - -- -- - - See Documentation/paride.txt.
+ + + ++ ++ + + See Documentation/blockdev/paride.txt.
pirq= [SMP,APIC] Manual mp-table setup
- -- - - See Documentation/i386/IO-APIC.txt.
+ ++ + + See Documentation/x86/i386/IO-APIC.txt.
plip= [PPT,NET] Parallel port network link
Format: { parport<nr> | timid | 0 }
struct ds_context **p_context =
(task ? &task->thread.ds_ctx : &this_system_context);
struct ds_context *context = *p_context;
++++ + ++ ++ ++ + ++ unsigned long irq;
if (!context) {
-- -- - spin_unlock(&ds_lock);
-- -- -
context = kzalloc(sizeof(*context), GFP_KERNEL);
---- - -- -- -- - --
-- -- - if (!context) {
-- -- - spin_lock(&ds_lock);
++ ++ + if (!context)
return NULL;
-- -- - }
context->ds = kzalloc(ds_cfg.sizeof_ds, GFP_KERNEL);
if (!context->ds) {
return NULL;
}
- - - -- -- - - *p_context = context;
-- -- - spin_lock(&ds_lock);
-- -- - /*
-- -- - * Check for race - another CPU could have allocated
-- -- - * it meanwhile:
-- -- - */
++++ + ++ ++ ++ + ++ spin_lock_irqsave(&ds_lock, irq);
++ ++ +
- - - -- -- - - context->this = p_context;
- - - -- -- - - context->task = task;
+ + + ++ ++ + + if (*p_context) {
+ + + ++ ++ + + kfree(context->ds);
+ + + ++ ++ + + kfree(context);
-- -- - return *p_context;
-- -- - }
+
- - - -- - - - if (task)
- - - -- - - - set_tsk_thread_flag(task, TIF_DS_AREA_MSR);
-- -- - *p_context = context;
++++ + ++ ++ ++ + ++ context = *p_context;
++++ + ++ ++ ++ + ++ } else {
++++ + ++ ++ ++ + ++ *p_context = context;
- - - -- - - - if (!task || (task == current))
- - - -- - - - wrmsr(MSR_IA32_DS_AREA, (unsigned long)context->ds, 0);
-- -- - context->this = p_context;
-- -- - context->task = task;
- if (task)
- set_tsk_thread_flag(task, TIF_DS_AREA_MSR);
++++ + ++ ++ ++ + ++ context->this = p_context;
++++ + ++ ++ ++ + ++ context->task = task;
- - - -- - - - get_tracer(task);
-- -- - if (task)
-- -- - set_tsk_thread_flag(task, TIF_DS_AREA_MSR);
- if (!task || (task == current))
- wrmsr(MSR_IA32_DS_AREA, (unsigned long)context->ds, 0);
++++ + ++ ++ ++ + ++ if (task)
++++ + ++ ++ ++ + ++ set_tsk_thread_flag(task, TIF_DS_AREA_MSR);
+ + + ++ + + +
-- -- - if (!task || (task == current))
-- -- - wrmsr(MSR_IA32_DS_AREA, (unsigned long)context->ds, 0);
-- -- -
-- -- - - get_tracer(task);
++++ + ++ ++ ++ + ++ if (!task || (task == current))
++++ + ++ ++ ++ + ++ wrmsrl(MSR_IA32_DS_AREA,
++++ + ++ ++ ++ + ++ (unsigned long)context->ds);
++++ + ++ ++ ++ + ++ }
++++ + ++ ++ ++ + ++ spin_unlock_irqrestore(&ds_lock, irq);
}
context->count++;
return -EOPNOTSUPP;
---- - -- -- -- - -- spin_lock(&ds_lock);
- - - -- -- - -
- - - -- -- - - if (!check_tracer(task))
- - - -- -- - - return -EPERM;
---- - -- -- -- - --
---- - -- -- -- - -- error = -ENOMEM;
context = ds_alloc_context(task);
if (!context)
-- -- - goto out_unlock;
++++ + ++ ++ ++ + ++ return -ENOMEM;
++++ + ++ ++ ++ + ++
++++ + ++ ++ ++ + ++ spin_lock_irqsave(&ds_lock, irq);
+ + + ++ ++ + +
+ + + ++ ++ + + error = -EPERM;
+ + + ++ ++ + + if (!check_tracer(task))
goto out_unlock;
++++ + ++ ++ ++ + ++ get_tracer(task);
++++ + ++ ++ ++ + ++
error = -EALREADY;
if (context->owner[qual] == current)
---- - -- -- -- - -- goto out_unlock;
++++ + ++ ++ ++ + ++ goto out_put_tracer;
error = -EPERM;
if (context->owner[qual] != NULL)
---- - -- -- -- - -- goto out_unlock;
++++ + ++ ++ ++ + ++ goto out_put_tracer;
context->owner[qual] = current;
---- - -- -- -- - -- spin_unlock(&ds_lock);
++++ + ++ ++ ++ + ++ spin_unlock_irqrestore(&ds_lock, irq);
error = -ENOMEM;
early_param("elfcorehdr", setup_elfcorehdr);
#endif
---------------------- -------static struct x86_quirks default_x86_quirks __initdata;
-------------- ------- -------
-------------- ------- -------struct x86_quirks *x86_quirks __initdata = &default_x86_quirks;
-------------- ------- -------
-------------- ------- -------/*
-------------- ------- ------- * Some BIOSes seem to corrupt the low 64k of memory during events
-------------- ------- ------- * like suspend/resume and unplugging an HDMI cable. Reserve all
-------------- ------- ------- * remaining free memory in that area and fill it with a distinct
-------------- ------- ------- * pattern.
-------------- ------- ------- */
-------------- ------- -------#ifdef CONFIG_X86_CHECK_BIOS_CORRUPTION
-------------- ------- -------#define MAX_SCAN_AREAS 8
-------------- ------- -------
-------------- ------- -------static int __read_mostly memory_corruption_check = -1;
-------------- ------- -------
-------------- ------- -------static unsigned __read_mostly corruption_check_size = 64*1024;
-------------- ------- -------static unsigned __read_mostly corruption_check_period = 60; /* seconds */
-------------- ------- -------
-------------- ------- -------static struct e820entry scan_areas[MAX_SCAN_AREAS];
-------------- ------- -------static int num_scan_areas;
-------------- ------- -------
-------------- ------- -------
-------------- ------- -------static int set_corruption_check(char *arg)
----- --- -- ---- -- ------ {
----- --- -- ---- -- ------ char *end;
----- --- -- ---- -- ------
----- --- -- ---- -- ------ memory_corruption_check = simple_strtol(arg, &end, 10);
----- --- -- ---- -- ------
----- --- -- ---- -- ------ return (*end == 0) ? 0 : -EINVAL;
----- --- -- ---- -- ------ }
----- --- -- ---- -- ------ early_param("memory_corruption_check", set_corruption_check);
----- --- -- ---- -- ------
----- --- -- ---- -- ------ static int set_corruption_check_period(char *arg)
----- --- -- ---- -- ------ {
----- --- -- ---- -- ------ char *end;
----- --- -- ---- -- ------
----- --- -- ---- -- ------ corruption_check_period = simple_strtoul(arg, &end, 10);
----- --- -- ---- -- ------
----- --- -- ---- -- ------ return (*end == 0) ? 0 : -EINVAL;
----- --- -- ---- -- ------ }
----- --- -- ---- -- ------ early_param("memory_corruption_check_period", set_corruption_check_period);
----- --- -- ---- -- ------
----- --- -- ---- -- ------ static int set_corruption_check_size(char *arg)
----- --- -- ---- -- ------ {
----- --- -- ---- -- ------ char *end;
----- --- -- ---- -- ------ unsigned size;
----- --- -- ---- -- ------
----- --- -- ---- -- ------ size = memparse(arg, &end);
----- --- -- ---- -- ------
----- --- -- ---- -- ------ if (*end == '\0')
----- --- -- ---- -- ------ corruption_check_size = size;
----- --- -- ---- -- ------
----- --- -- ---- -- ------ return (size == corruption_check_size) ? 0 : -EINVAL;
----- --- -- ---- -- ------ }
----- --- -- ---- -- ------ early_param("memory_corruption_check_size", set_corruption_check_size);
----- --- -- ---- -- ------
----- --- -- ---- -- ------
----- --- -- ---- -- ------ static void __init setup_bios_corruption_check(void)
++++++++++++++++++++++ +++++++static int __init default_update_genapic(void)
+ {
-- - - - - char *end;
-- - - - -
-- - - - - memory_corruption_check = simple_strtol(arg, &end, 10);
-- - - - -
-- - - - - return (*end == 0) ? 0 : -EINVAL;
-- - - - -}
-- - - - -early_param("memory_corruption_check", set_corruption_check);
-- - - - -
-- - - - -static int set_corruption_check_period(char *arg)
-- - - - -{
-- - - - - char *end;
-- - - - -
-- - - - - corruption_check_period = simple_strtoul(arg, &end, 10);
-- - - - -
-- - - - - return (*end == 0) ? 0 : -EINVAL;
-- - - - -}
-- - - - -early_param("memory_corruption_check_period", set_corruption_check_period);
-- - - - -
-- - - - -static int set_corruption_check_size(char *arg)
-- - - - -{
-- - - - - char *end;
-- - - - - unsigned size;
-- - - - -
-- - - - - size = memparse(arg, &end);
-- - - - -
-- - - - - if (*end == '\0')
-- - - - - corruption_check_size = size;
-- - - - -
-- - - - - return (size == corruption_check_size) ? 0 : -EINVAL;
-- - - - -}
-- - - - -early_param("memory_corruption_check_size", set_corruption_check_size);
-- - - - -
-- - - - -
-- - - - -static void __init setup_bios_corruption_check(void)
-- - - - -{
-------------- ------- ------- u64 addr = PAGE_SIZE; /* assume first page is reserved anyway */
-------------- ------- -------
-------------- ------- ------- if (memory_corruption_check == -1) {
-------------- ------- ------- memory_corruption_check =
-------------- ------- -------#ifdef CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK
-------------- ------- ------- 1
-------------- ------- -------#else
-------------- ------- ------- 0
++++++++++++++++++++++ +++++++#ifdef CONFIG_X86_SMP
++++++++++++++++++++++ +++++++# if defined(CONFIG_X86_GENERICARCH) || defined(CONFIG_X86_64)
++++++++++++++++++++++ +++++++ genapic->wakeup_cpu = wakeup_secondary_cpu_via_init;
++++++++++++++++++++++ +++++++# endif
+ #endif
-------------- ------- ------- ;
-------------- ------- ------- }
------- ------ ------- -------
------- ------ ------- ------- if (corruption_check_size == 0)
------- ------ ------- ------- memory_corruption_check = 0;
------- ------ ------- -------
------- ------ ------- ------- if (!memory_corruption_check)
------- ------ ------- ------- return;
------- ------ ------- -------
------- ------ ------- ------- corruption_check_size = round_up(corruption_check_size, PAGE_SIZE);
----- --- -- ---- -- ------
----- --- -- ---- -- ------ while(addr < corruption_check_size && num_scan_areas < MAX_SCAN_AREAS) {
----- --- -- ---- -- ------ u64 size;
----- --- -- ---- -- ------ addr = find_e820_area_size(addr, &size, PAGE_SIZE);
----- --- -- ---- -- ------
----- --- -- ---- -- ------ if (addr == 0)
----- --- -- ---- -- ------ break;
+
- if (corruption_check_size == 0)
- memory_corruption_check = 0;
-
- if (!memory_corruption_check)
- return;
-
- corruption_check_size = round_up(corruption_check_size, PAGE_SIZE);
-
-- - - - - while(addr < corruption_check_size && num_scan_areas < MAX_SCAN_AREAS) {
-- - - - - u64 size;
-- - - - - addr = find_e820_area_size(addr, &size, PAGE_SIZE);
-- - - - -
-- - - - - if (addr == 0)
-- - - - - break;
-- - - - -
-------------- ------- ------- if ((addr + size) > corruption_check_size)
-------------- ------- ------- size = corruption_check_size - addr;
-------------- ------- -------
-------------- ------- ------- if (size == 0)
-------------- ------- ------- break;
-------------- ------- -------
-------------- ------- ------- e820_update_range(addr, size, E820_RAM, E820_RESERVED);
-------------- ------- ------- scan_areas[num_scan_areas].addr = addr;
-------------- ------- ------- scan_areas[num_scan_areas].size = size;
-------------- ------- ------- num_scan_areas++;
-------------- ------- -------
-------------- ------- ------- /* Assume we've already mapped this early memory */
-------------- ------- ------- memset(__va(addr), 0, size);
-------------- ------- -------
-------------- ------- ------- addr += size;
-------------- ------- ------- }
-------------- ------- -------
-------------- ------- ------- printk(KERN_INFO "Scanning %d areas for low memory corruption\n",
-------------- ------- ------- num_scan_areas);
-------------- ------- ------- update_e820();
-------------- ------- -------}
-------------- ------- -------
-------------- ------- -------static struct timer_list periodic_check_timer;
-------------- ------- -------
-------------- ------- -------void check_for_bios_corruption(void)
-------------- ------- -------{
-------------- ------- ------- int i;
-------------- ------- ------- int corruption = 0;
-------------- ------- -------
-------------- ------- ------- if (!memory_corruption_check)
-------------- ------- ------- return;
-------------- ------- -------
-------------- ------- ------- for(i = 0; i < num_scan_areas; i++) {
-------------- ------- ------- unsigned long *addr = __va(scan_areas[i].addr);
-------------- ------- ------- unsigned long size = scan_areas[i].size;
-------------- ------- -------
-------------- ------- ------- for(; size; addr++, size -= sizeof(unsigned long)) {
-------------- ------- ------- if (!*addr)
-------------- ------- ------- continue;
-------------- ------- ------- printk(KERN_ERR "Corrupted low memory at %p (%lx phys) = %08lx\n",
-------------- ------- ------- addr, __pa(addr), *addr);
-------------- ------- ------- corruption = 1;
-------------- ------- ------- *addr = 0;
-------------- ------- ------- }
-------------- ------- ------- }
-------------- ------- -------
-------------- ------- ------- WARN(corruption, KERN_ERR "Memory corruption detected in low memory\n");
-------------- ------- -------}
-------------- ------- -------
-------------- ------- -------static void periodic_check_for_corruption(unsigned long data)
-------------- ------- -------{
-------------- ------- ------- check_for_bios_corruption();
-------------- ------- ------- mod_timer(&periodic_check_timer, round_jiffies(jiffies + corruption_check_period*HZ));
++++++++++++++++++++++ +++++++ return 0;
+ }
+
-------------- ------- -------void start_periodic_check_for_corruption(void)
-------------- ------- -------{
-------------- ------- ------- if (!memory_corruption_check || corruption_check_period == 0)
-------------- ------- ------- return;
-------------- ------- -------
-------------- ------- ------- printk(KERN_INFO "Scanning for low memory corruption every %d seconds\n",
-------------- ------- ------- corruption_check_period);
++++++++++++++++++++++ +++++++static struct x86_quirks default_x86_quirks __initdata = {
++++++++++++++++++++++ +++++++ .update_genapic = default_update_genapic,
++++++++++++++++++++++ +++++++};
-------------- ------- ------- init_timer(&periodic_check_timer);
-------------- ------- ------- periodic_check_timer.function = &periodic_check_for_corruption;
-------------- ------- ------- periodic_check_for_corruption(0);
-------------- ------- -------}
-------------- ------- -------#endif
++++++++++++++ +++++++ +++++++struct x86_quirks *x86_quirks __initdata = &default_x86_quirks;
- /*
- * Some BIOSes seem to corrupt the low 64k of memory during events
- * like suspend/resume and unplugging an HDMI cable. Reserve all
- * remaining free memory in that area and fill it with a distinct
- * pattern.
- */
- #ifdef CONFIG_X86_CHECK_BIOS_CORRUPTION
- #define MAX_SCAN_AREAS 8
-
- static int __read_mostly memory_corruption_check = -1;
-
- static unsigned __read_mostly corruption_check_size = 64*1024;
- static unsigned __read_mostly corruption_check_period = 60; /* seconds */
-
- static struct e820entry scan_areas[MAX_SCAN_AREAS];
- static int num_scan_areas;
-
-
- static int set_corruption_check(char *arg)
- {
- char *end;
-
- memory_corruption_check = simple_strtol(arg, &end, 10);
-
- return (*end == 0) ? 0 : -EINVAL;
- }
- early_param("memory_corruption_check", set_corruption_check);
-
- static int set_corruption_check_period(char *arg)
- {
- char *end;
-
- corruption_check_period = simple_strtoul(arg, &end, 10);
-
- return (*end == 0) ? 0 : -EINVAL;
- }
- early_param("memory_corruption_check_period", set_corruption_check_period);
-
- static int set_corruption_check_size(char *arg)
- {
- char *end;
- unsigned size;
-
- size = memparse(arg, &end);
-
- if (*end == '\0')
- corruption_check_size = size;
-
- return (size == corruption_check_size) ? 0 : -EINVAL;
- }
- early_param("memory_corruption_check_size", set_corruption_check_size);
-
-
- static void __init setup_bios_corruption_check(void)
- {
- u64 addr = PAGE_SIZE; /* assume first page is reserved anyway */
-
- if (memory_corruption_check == -1) {
- memory_corruption_check =
- #ifdef CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK
- 1
- #else
- 0
- #endif
- ;
- }
-
- if (corruption_check_size == 0)
- memory_corruption_check = 0;
-
- if (!memory_corruption_check)
- return;
-
- corruption_check_size = round_up(corruption_check_size, PAGE_SIZE);
-
- while(addr < corruption_check_size && num_scan_areas < MAX_SCAN_AREAS) {
- u64 size;
- addr = find_e820_area_size(addr, &size, PAGE_SIZE);
-
- if (addr == 0)
- break;
-
- if ((addr + size) > corruption_check_size)
- size = corruption_check_size - addr;
-
- if (size == 0)
- break;
-
- e820_update_range(addr, size, E820_RAM, E820_RESERVED);
- scan_areas[num_scan_areas].addr = addr;
- scan_areas[num_scan_areas].size = size;
- num_scan_areas++;
-
- /* Assume we've already mapped this early memory */
- memset(__va(addr), 0, size);
-
- addr += size;
- }
-
- printk(KERN_INFO "Scanning %d areas for low memory corruption\n",
- num_scan_areas);
- update_e820();
- }
-
- static struct timer_list periodic_check_timer;
-
- void check_for_bios_corruption(void)
- {
- int i;
- int corruption = 0;
-
- if (!memory_corruption_check)
- return;
-
- for(i = 0; i < num_scan_areas; i++) {
- unsigned long *addr = __va(scan_areas[i].addr);
- unsigned long size = scan_areas[i].size;
-
- for(; size; addr++, size -= sizeof(unsigned long)) {
- if (!*addr)
- continue;
- printk(KERN_ERR "Corrupted low memory at %p (%lx phys) = %08lx\n",
- addr, __pa(addr), *addr);
- corruption = 1;
- *addr = 0;
- }
- }
-
- WARN(corruption, KERN_ERR "Memory corruption detected in low memory\n");
- }
-
- static void periodic_check_for_corruption(unsigned long data)
- {
- check_for_bios_corruption();
- mod_timer(&periodic_check_timer, round_jiffies(jiffies + corruption_check_period*HZ));
- }
-
- void start_periodic_check_for_corruption(void)
- {
- if (!memory_corruption_check || corruption_check_period == 0)
- return;
-
- printk(KERN_INFO "Scanning for low memory corruption every %d seconds\n",
- corruption_check_period);
-
- init_timer(&periodic_check_timer);
- periodic_check_timer.function = &periodic_check_for_corruption;
- periodic_check_for_corruption(0);
- }
- #endif
-
++++++++++++++ +++++++++++++++#ifdef CONFIG_X86_RESERVE_LOW_64K
static int __init dmi_low_memory_corruption(const struct dmi_system_id *d)
{
printk(KERN_NOTICE