[PATCH v2 04/10] x86/microcode_intel_lib.c: Early update ucode on Intel's CPU

2012-11-30 Thread Fenghua Yu
From: Fenghua Yu Define interfaces microcode_sanity_check() and get_matching_microcode(). They are called both in early boot time and in microcode Intel driver. Signed-off-by: Fenghua Yu --- arch/x86/kernel/microcode_intel_lib.c | 174 + 1 files changed, 174

[PATCH v2 06/10] x86/head_32.S: Early update ucode in 32-bit

2012-11-30 Thread Fenghua Yu
From: Fenghua Yu This updates ucode in 32-bit kernel. At this point, there is no paging and no virtual address yet. Signed-off-by: Fenghua Yu --- arch/x86/kernel/head_32.S |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel

[PATCH v2 03/10] x86/microcode_core_early.c: Define interfaces for early loading ucode

2012-11-30 Thread Fenghua Yu
From: Fenghua Yu Define interfaces load_ucode_bsp() and load_ucode_ap() to load ucode on BSP and AP in early boot time. These are generic interfaces. Internally they call vendor specific implementations. Signed-off-by: Fenghua Yu --- arch/x86/include/asm/microcode.h | 23

[PATCH v2 09/10] x86/mm/init.c: Copy ucode from initrd image to memory

2012-11-30 Thread Fenghua Yu
From: Fenghua Yu Before initrd image is freed, copy valid ucode patches from initrd image to kernel virtual memory. The saved ucode will be used to update AP in resume. Signed-off-by: Fenghua Yu --- arch/x86/mm/init.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff

[PATCH v2 10/10] x86/Kconfig: Configurations to enable/disable the feature

2012-11-30 Thread Fenghua Yu
From: Fenghua Yu MICROCODE_INTEL_LIB, MICROCODE_INTEL_EARLY, and MICROCODE_EARLY are three new configurations to enable or disable the feature. Signed-off-by: Fenghua Yu --- arch/x86/Kconfig | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/arch/x86

[PATCH v2 00/11] x86/microcode: Early load microcode

2012-11-30 Thread Fenghua Yu
From: Fenghua Yu The problem in current microcode loading method is that we load a microcode way, way too late; ideally we should load it before turning paging on. This may only be practical on 32 bits since we can't get to 64-bit mode without paging on, but we should still do it as early

[PATCH v2 08/10] x86/smpboot.c: Early update ucode on AP

2012-11-30 Thread Fenghua Yu
From: Fenghua Yu This updates ucode on AP. At this point, BSP should store some valid ucode patches in memory if it finds the ucode patches in initrd. AP searches the stored ucode and uploads the ucode. Signed-off-by: Fenghua Yu --- arch/x86/kernel/smpboot.c |7 +++ 1 files changed, 7

[PATCH v2 05/10] x86/microcode_intel_early.c: Early update ucode on Intel's CPU

2012-11-30 Thread Fenghua Yu
From: Fenghua Yu Implementation of early update ucode on Intel's CPU. load_ucode_intel_bsp() scans ucode in initrd image file which is a cpio format ucode followed by ordinary initrd image file. The binary ucode file is stored in kernel/x86/microcode/GenuineIntel/microcode.hex in the cpio

[PATCH v2 02/10] x86/microcode_intel.h: Define functions and macros for early loading ucode

2012-11-30 Thread Fenghua Yu
From: Fenghua Yu Define some functions and macros that will be used in early loading ucode. Some of them are moved from microcode_intel.c driver in order to be called in early boot phase before module can be called. Signed-off-by: Fenghua Yu --- arch/x86/include/asm/microcode_intel.h | 106

[PATCH v2 01/10] Documentation/x86: Early load microcode

2012-11-30 Thread Fenghua Yu
From: Fenghua Yu Documenation for early loading microcode methodology. Signed-off-by: Fenghua Yu --- Documentation/x86/early-microcode.txt | 43 + 1 files changed, 43 insertions(+), 0 deletions(-) create mode 100644 Documentation/x86/early-microcode.txt

[PATCH] x86/microcode_intel_early.c: Get 32-bit physical address by __pa_nodebug()

2013-03-19 Thread Fenghua Yu
From: Fenghua Yu In 32-bit, __pa_symbol() in CONFIG_DEBUG_VIRTUAL accesses kernel data (e.g. max_low_pfn) that haven't been setup yet in such early boot phase. To fix the issue, __pa_nodebug() replaces __pa_symbol() to get a global symbol's physical address. Signed-off-by: Fenghua Yu

[PATCH v10 08/14] x86-32, hotplug: Add start_cpu0() entry point to head_32.S

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu start_cpu0() is defined in head_32.S for 32-bit. The function sets up stack and jumps to start_secondary() for CPU0 wake up. Signed-off-by: Fenghua Yu --- arch/x86/kernel/head_32.S | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/arch/x86

[PATCH v10 14/14] x86, topology: Debug CPU00 hotplug

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu CONFIG_DEBUG_HOTPLUG_CPU0 is for debugging the CPU0 hotplug feature. The switch offlines CPU0 as soon as possible and boots userspace up with CPU0 offlined. User can online CPU0 back after boot time. The default value of the switch is off. To debug CPU0 hotplug, you need to

[PATCH v10 05/14] x86, hotplug, suspend: Online CPU0 for suspend or hibernate

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu Because x86 BIOS requires CPU0 to resume from sleep, suspend or hibernate can't be executed if CPU0 is detected offline. To make suspend or hibernate and further resume succeed, CPU0 must be online. Signed-off-by: Fenghua Yu --- arch/x86/power/cpu.c |

[PATCH v10 13/14] x86/i387.c: Initialize thread xstate only on CPU0 only once

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu init_thread_xstate() is only called once to avoid overriding xstate_size during boot time or during CPU hotplug. Signed-off-by: Fenghua Yu --- arch/x86/kernel/i387.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/i387.c b/arch

[PATCH v10 12/14] x86, hotplug: Handle retrigger irq by the first available CPU

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu The first cpu in irq cfg->domain is likely to be CPU 0 and may not be available when CPU 0 is offline. Instead of using CPU 0 to handle retriggered irq, we use first available CPU which is online and in this irq's domain. Signed-off-by: Fenghua Yu --- arch/x86/ker

[PATCH v10 10/14] x86, hotplug: During CPU0 online, enable x2apic, set_numa_node.

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu Previously these functions were not run on the BSP (CPU 0, the boot processor) since the boot processor init would only be executed before this functionality was initialized. Signed-off-by: Fenghua Yu --- arch/x86/kernel/cpu/common.c |5 ++--- 1 files changed, 2

[PATCH v10 11/14] x86, hotplug: The first online processor saves the MTRR state

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu Ask the first online CPU to save mtrr instead of asking BSP. BSP could be offline when mtrr_save_state() is called. Signed-off-by: Fenghua Yu --- arch/x86/kernel/cpu/mtrr/main.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel

[PATCH v10 01/14] doc: Add x86 CPU0 online/offline feature

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu If CONFIG_BOOTPARAM_HOTPLUG_CPU0 is turned on, CPU0 is hotpluggable. Otherwise, by default CPU0 is not hotpluggable and kernel parameter cpu0_hotplug enables CPU0 online/offline feature. The documentations point out two known CPU0 dependencies. First, resume from hibernate or

[PATCH v10 02/14] x86, Kconfig: Add config switch for CPU0 hotplug

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu New config switch CONFIG_BOOTPARAM_HOTPLUG_CPU0 sets default state of whether the CPU0 hotplug is on or off. If the switch is off, CPU0 is not hotpluggable by default. But the CPU0 hotplug feature can still be turned on by kernel parameter cpu0_hotplug at boot. If the switch

[PATCH v10 09/14] x86, hotplug: Wake up CPU0 via NMI instead of INIT, SIPI, SIPI

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu Instead of waiting for STARTUP after INITs, BSP will execute the BIOS boot-strap code which is not a desired behavior for waking up BSP. To avoid the boot-strap code, wake up CPU0 by NMI instead. This works to wake up soft offlined CPU0 only. If CPU0 is hard offlined (i.e

[PATCH v10 07/14] x86-64, hotplug: Add start_cpu0() entry point to head_64.S

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu start_cpu0() is defined in head_64.S for 64-bit. The function sets up stack and jumps to start_secondary() for CPU0 wake up. Signed-off-by: Fenghua Yu --- arch/x86/kernel/head_64.S | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/arch

[PATCH v10 06/14] kernel/cpu.c: Add comment for priority in cpu_hotplug_pm_callback

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu cpu_hotplug_pm_callback should have higher priority than bsp_pm_callback which depends on cpu_hotplug_pm_callback to disable cpu hotplug to avoid race during bsp online checking. This is to hightlight the priorities between the two callbacks in case people may overlook the

[PATCH v10 0/14] x86: Arbitrary CPU hot(un)plug support

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu CPU0 or BSP (Bootstrap Processor) has been the last processor that can not be hot removed on x86. This patchset implements CPU0 or BSP online and offline and removes this obstacle to CPU hotplug. RAS needs the feature. If socket0 needs to be hotplugged for any reason (any

[PATCH v10 04/14] x86, hotplug: Support functions for CPU0 online/offline

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu Add smp_store_boot_cpu_info() to store cpu info for BSP during boot time. Now smp_store_cpu_info() stores cpu info for bringing up BSP or AP after it's offline. Continue to online CPU0 in native_cpu_up(). Continue to offline CPU0 in native_cpu_disable(). Signed-o

[PATCH v10 03/14] x86, topology: Don't offline CPU0 if any PIC irq can not be migrated out of it

2012-11-13 Thread Fenghua Yu
From: Fenghua Yu If CONFIG_BOOTPARAM_HOTPLUG_CPU is turned on, CPU0 hotplug feature is enabled by default. If CONFIG_BOOTPARAM_HOTPLUG_CPU is not turned on, CPU0 hotplug feature is not enabled by default. The kernel parameter cpu0_hotplug can enable CPU0 hotplug feature at boot. Currently the

[PATCH v4 00/11] x86/microcode: Early load microcode

2012-12-20 Thread Fenghua Yu
From: Fenghua Yu The problem in current microcode loading method is that we load a microcode way, way too late; ideally we should load it before turning paging on. This may only be practical on 32 bits since we can't get to 64-bit mode without paging on, but we should still do it as early

[PATCH v4 01/11] Documentation/x86: Early load microcode

2012-12-20 Thread Fenghua Yu
From: Fenghua Yu Documenation for early loading microcode methodology. Signed-off-by: Fenghua Yu --- Documentation/x86/early-microcode.txt | 43 +++ 1 file changed, 43 insertions(+) create mode 100644 Documentation/x86/early-microcode.txt diff --git a

[PATCH v4 08/11] x86/head_32.S: Early update ucode in 32-bit

2012-12-20 Thread Fenghua Yu
From: Fenghua Yu This updates ucode in 32-bit kernel. At this point, there is no paging and no virtual address yet. Signed-off-by: Fenghua Yu --- arch/x86/kernel/head_32.S | 12 1 file changed, 12 insertions(+) diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S

[PATCH v4 07/11] x86/microcode_intel_early.c: Early update ucode on Intel's CPU

2012-12-20 Thread Fenghua Yu
From: Fenghua Yu Implementation of early update ucode on Intel's CPU. load_ucode_intel_bsp() scans ucode in initrd image file which is a cpio format ucode followed by ordinary initrd image file. The binary ucode file is stored in kernel/x86/microcode/GenuineIntel.bin in the cpio data. All

[PATCH v4 10/11] x86/mm/init.c: Copy ucode from initrd image to kernel memory

2012-12-20 Thread Fenghua Yu
From: Fenghua Yu Before initrd image is freed, copy valid ucode patches from initrd image to kernel memory. The saved ucode will be used to update AP in resume or hotplug. Signed-off-by: Fenghua Yu --- arch/x86/mm/init.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/x86

[PATCH v4 11/11] x86/Kconfig: Configurations to enable/disable the feature

2012-12-20 Thread Fenghua Yu
From: Fenghua Yu MICROCODE_INTEL_LIB, MICROCODE_INTEL_EARLY, and MICROCODE_EARLY are three new configurations to enable or disable the feature. Signed-off-by: Fenghua Yu --- arch/x86/Kconfig | 18 ++ 1 file changed, 18 insertions(+) diff --git a/arch/x86/Kconfig b/arch/x86

[PATCH v4 09/11] x86/head64.c: Early update ucode in 64-bit

2012-12-20 Thread Fenghua Yu
From: Fenghua Yu This updates ucode on BSP in 64-bit mode. Paging and virtual address are working now. Signed-off-by: Fenghua Yu --- arch/x86/kernel/head64.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index e1cb611..1ccbaf1

[PATCH v4 05/11] x86/microcode_intel_lib.c: Early update ucode on Intel's CPU

2012-12-20 Thread Fenghua Yu
From: Fenghua Yu Define interfaces microcode_sanity_check() and get_matching_microcode(). They are called both in early boot time and in microcode Intel driver. Signed-off-by: Fenghua Yu --- arch/x86/kernel/microcode_intel_lib.c | 174 ++ 1 file changed, 174

[PATCH v4 06/11] x86/tlbflush.h: Define __native_flush_tlb_global_irq_disabled()

2012-12-20 Thread Fenghua Yu
From: Fenghua Yu This function is called in __native_flush_tlb_global() and after apply_microcode_early(). Signed-off-by: Fenghua Yu --- arch/x86/include/asm/tlbflush.h | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/tlbflush.h b

[PATCH v4 04/11] x86/microcode_core_early.c: Define interfaces for early loading ucode

2012-12-20 Thread Fenghua Yu
From: Fenghua Yu Define interfaces load_ucode_bsp() and load_ucode_ap() to load ucode on BSP and AP in early boot time. These are generic interfaces. Internally they call vendor specific implementations. Signed-off-by: Fenghua Yu --- arch/x86/include/asm/microcode.h | 14 +++ arch

[PATCH v4 02/11] x86/microcode_intel.h: Define functions and macros for early loading ucode

2012-12-20 Thread Fenghua Yu
From: Fenghua Yu Define some functions and macros that will be used in early loading ucode. Some of them are moved from microcode_intel.c driver in order to be called in early boot phase before module can be called. Signed-off-by: Fenghua Yu --- arch/x86/include/asm/microcode_intel.h | 85

[PATCH v4 03/11] x86/common.c: Make have_cpuid_p() a global function and load ucode or show ucode loading info on AP

2012-12-20 Thread Fenghua Yu
From: Fenghua Yu Remove static declaration in have_cpuid_p() to make it a global function. The function will be called in early loading microcode. In 64 bit, load ucode on AP in cpu_init(). In 32 bit, show ucode loading info on AP in cpu_init(). Signed-off-by: Fenghua Yu --- arch/x86/include

[PATCH v5 00/12] x86/microcode: Early load microcode

2012-12-21 Thread Fenghua Yu
From: Fenghua Yu The problem in current microcode loading method is that we load a microcode way, way too late; ideally we should load it before turning paging on. This may only be practical on 32 bits since we can't get to 64-bit mode without paging on, but we should still do it as early

[PATCH v5 01/12] Documentation/x86: Early load microcode

2012-12-21 Thread Fenghua Yu
From: Fenghua Yu Documenation for early loading microcode methodology. Signed-off-by: Fenghua Yu --- Documentation/x86/early-microcode.txt | 43 +++ 1 file changed, 43 insertions(+) create mode 100644 Documentation/x86/early-microcode.txt diff --git a

[PATCH v5 04/12] x86/common.c: load ucode in 64 bit or show loading ucode info in 32 bit on AP

2012-12-21 Thread Fenghua Yu
From: Fenghua Yu In 64 bit, load ucode on AP in cpu_init(). In 32 bit, show ucode loading info on AP in cpu_init(). Microcode has been loaded earlier before paging. Now it is safe to show the loading microcode info on this AP. Signed-off-by: Fenghua Yu --- arch/x86/kernel/cpu/common.c | 8

[PATCH v5 07/12] x86/tlbflush.h: Define __native_flush_tlb_global_irq_disabled()

2012-12-21 Thread Fenghua Yu
From: Fenghua Yu This function is called in __native_flush_tlb_global() and after apply_microcode_early(). Signed-off-by: Fenghua Yu --- arch/x86/include/asm/tlbflush.h | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/tlbflush.h b

[PATCH v5 03/12] x86/common.c: Make have_cpuid_p() a global function

2012-12-21 Thread Fenghua Yu
From: Fenghua Yu Remove static declaration in have_cpuid_p() to make it a global function. The function will be called in early loading microcode. Signed-off-by: Fenghua Yu --- arch/x86/include/asm/processor.h | 8 arch/x86/kernel/cpu/common.c | 9 +++-- 2 files changed, 11

[PATCH v5 05/12] x86/microcode_core_early.c: Define interfaces for early loading ucode

2012-12-21 Thread Fenghua Yu
From: Fenghua Yu Define interfaces load_ucode_bsp() and load_ucode_ap() to load ucode on BSP and AP in early boot time. These are generic interfaces. Internally they call vendor specific implementations. Signed-off-by: Fenghua Yu --- arch/x86/include/asm/microcode.h | 14 +++ arch

[PATCH v5 02/12] x86/microcode_intel.h: Define functions and macros for early loading ucode

2012-12-21 Thread Fenghua Yu
From: Fenghua Yu Define some functions and macros that will be used in early loading ucode. Some of them are moved from microcode_intel.c driver in order to be called in early boot phase before module can be called. Signed-off-by: Fenghua Yu --- arch/x86/include/asm/microcode_intel.h | 85

[PATCH v5 12/12] x86/Kconfig: Configurations to enable/disable the feature

2012-12-21 Thread Fenghua Yu
From: Fenghua Yu MICROCODE_INTEL_LIB, MICROCODE_INTEL_EARLY, and MICROCODE_EARLY are three new configurations to enable or disable the feature. Signed-off-by: Fenghua Yu --- arch/x86/Kconfig | 18 ++ 1 file changed, 18 insertions(+) diff --git a/arch/x86/Kconfig b/arch/x86

[PATCH v5 06/12] x86/microcode_intel_lib.c: Early update ucode on Intel's CPU

2012-12-21 Thread Fenghua Yu
From: Fenghua Yu Define interfaces microcode_sanity_check() and get_matching_microcode(). They are called both in early boot time and in microcode Intel driver. Signed-off-by: Fenghua Yu --- arch/x86/kernel/microcode_intel_lib.c | 174 ++ 1 file changed, 174

[PATCH v5 11/12] x86/mm/init.c: Copy ucode from initrd image to kernel memory

2012-12-21 Thread Fenghua Yu
From: Fenghua Yu Before initrd image is freed, copy valid ucode patches from initrd image to kernel memory. The saved ucode will be used to update AP in resume or hotplug. Signed-off-by: Fenghua Yu --- arch/x86/mm/init.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/x86

[PATCH v5 10/12] x86/head64.c: Early update ucode in 64-bit

2012-12-21 Thread Fenghua Yu
From: Fenghua Yu This updates ucode on BSP in 64-bit mode. Paging and virtual address are working now. Signed-off-by: Fenghua Yu --- arch/x86/kernel/head64.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index e1cb611..5a97fcc

[PATCH v5 09/12] x86/head_32.S: Early update ucode in 32-bit

2012-12-21 Thread Fenghua Yu
From: Fenghua Yu This updates ucode in 32-bit kernel on BSP and AP. At this point, there is no paging and no virtual address yet. Signed-off-by: Fenghua Yu --- arch/x86/kernel/head_32.S | 11 +++ 1 file changed, 11 insertions(+) diff --git a/arch/x86/kernel/head_32.S b/arch/x86

[PATCH v5 08/12] x86/microcode_intel_early.c: Early update ucode on Intel's CPU

2012-12-21 Thread Fenghua Yu
From: Fenghua Yu Implementation of early update ucode on Intel's CPU. load_ucode_intel_bsp() scans ucode in initrd image file which is a cpio format ucode followed by ordinary initrd image file. The binary ucode file is stored in kernel/x86/microcode/GenuineIntel.bin in the cpio data. All

[PATCH 0/2] Quiet power limit notification

2013-05-15 Thread Fenghua Yu
From: Fenghua Yu Power Limit Notification (X86_FEATURE_PLN) was added in Sandy Bridge to give the OS the option of knowing when the package has reached a configured power threshold. Linux-2.6.36 enabled this feature: 0199114c31798af5b83841b21759b64171060d9b (x86, hwmon: Package Level Thermal

[PATCH v7 0/12] x86: Arbitrary CPU hot(un)plug support

2012-08-23 Thread Fenghua Yu
From: Fenghua Yu CPU0 or BSP (Bootstrap Processor) has been the last processor that can not be hot removed on x86. This patch set implements CPU0 or BSP online and offline and removes this obstacle to CPU hotplug. RAS needs the feature. If socket0 needs to be hotplugged for any reason (any

[PATCH v7 01/12] Documentations/cpu-hotplug.tx, kernel-parameters.txt: Add x86 CPU0 online/offline feature

2012-08-23 Thread Fenghua Yu
From: Fenghua Yu If CONFIG_BOOTPARAM_HOTPLUG_CPU0 is turned on, CPU0 is hotpluggable. Otherwise, by default CPU0 is not hotpluggable and kernel parameter cpu0_hotplug enables CPU0 online/offline feature. The documentations point out two known CPU0 dependencies. First, resume from hibernate or

[PATCH v7 04/12] Don't offline CPU0 if any PIC irq can not be migrated out of it.

2012-08-23 Thread Fenghua Yu
From: Fenghua Yu Change smp_store_cpu_info() to store cpu info for a CPU when it's brought up. This includes bringing up CPU0 or AP after it's offline. But don't store cpu info when BSP first boots during boot time. Continue to online CPU0 in native_cpu_up(). Signed-off

[PATCH v7 10/12] Ask the first online CPU to save mtrr instead of asking BSP. BSP could be offline when mtrr_save_state() is called.

2012-08-23 Thread Fenghua Yu
From: Fenghua Yu Signed-off-by: Fenghua Yu --- arch/x86/kernel/cpu/mtrr/main.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c index 6b96110..e4c1a41 100644 --- a/arch/x86/kernel/cpu/mtrr/main.c

[PATCH v7 08/12] Instead of waiting for STARTUP after INITs, BSP will execute the BIOS boot-strap code which is not a desired behavior for waking up BSP. To avoid the boot-strap code, wake up CPU0 by

2012-08-23 Thread Fenghua Yu
From: Fenghua Yu This works to wake up soft offlined CPU0 only. If CPU0 is hard offlined (i.e. physically hot removed and then hot added), NMI won't wake it up. We'll change this code in the future to wake up hard offlined CPU0 if real platform and request are available. AP is still w

[PATCH v7 11/12] x86/i387.c: Thread xstate is initialized only on CPU0 once

2012-08-23 Thread Fenghua Yu
From: Fenghua Yu init_thread_xstate() is only called once to avoid overriding xstate_size during boot time or during CPU hotplug. Signed-off-by: Fenghua Yu --- arch/x86/kernel/i387.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/i387.c b/arch

[PATCH v7 12/12] x86/topology.c: debug CPU0 hotplug

2012-08-23 Thread Fenghua Yu
From: Fenghua Yu CONFIG_DEBUG_HOTPLUG_CPU0 is for debuging the CPU0 hotplug feature. The switch offlines CPU0 as soon as possible and boots userspace up with CPU0 offlined. User can online CPU0 back after boot time. The default value of the switch is off. To debug CPU0 hotplug, you need to

[PATCH v7 09/12] During CPU0 online, enable x2apic, set_numa_node.

2012-08-23 Thread Fenghua Yu
From: Fenghua Yu Signed-off-by: Fenghua Yu --- arch/x86/kernel/cpu/common.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 2ea24da..ce8b772 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86

[PATCH v7 02/12] x86/Kconfig: Add config switch for CPU0 hotplug

2012-08-23 Thread Fenghua Yu
From: Fenghua Yu New config switch CONFIG_BOOTPARAM_HOTPLUG_CPU0 sets default state of whether the CPU0 hotplug is on or off. If the switch is off, CPU0 is not hotpluggable by default. But the CPU0 hotplug feature can still be turned on by kernel parameter cpu0_hotplug at boot. If the switch

[PATCH v7 03/12] x86/topology.c: Support functions for CPU0 online/offline

2012-08-23 Thread Fenghua Yu
From: Fenghua Yu If CONFIG_BOOTPARAM_HOTPLUG_CPU is turned on, CPU0 hotplug feature is enabled by default. If CONFIG_BOOTPARAM_HOTPLUG_CPU is not turned on, CPU0 hotplug feature is not enabled by default. The kernel parameter cpu0_hotplug can enable CPU0 hotplug feature at boot. Signed-off-by

[PATCH v7 07/12] start_cpu0() is defined in head_32.S for 32-bit. The function sets up stack and jumps to start_secondary() for CPU0 wake up.

2012-08-23 Thread Fenghua Yu
From: Fenghua Yu Signed-off-by: Fenghua Yu --- arch/x86/kernel/head_32.S | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index d42ab17..964f87a 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86

[PATCH v7 06/12] start_cpu0() is defined in head_64.S for 64-bit. The function sets up stack and jumps to start_secondary() for CPU0 wake up.

2012-08-23 Thread Fenghua Yu
From: Fenghua Yu Signed-off-by: Fenghua Yu --- arch/x86/kernel/head_64.S | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index 94bf9cc..3faac8a 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86

[PATCH v7 05/12] Because x86 BIOS requires CPU0 to resume from sleep, suspend or hibernate can't be executed if CPU0 is detected offline. To make suspend or hibernate and further resume succeed, CPU0

2012-08-23 Thread Fenghua Yu
From: Fenghua Yu Signed-off-by: Fenghua Yu --- arch/x86/power/cpu.c | 44 1 files changed, 44 insertions(+), 0 deletions(-) diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c index 218cdb1..3338609 100644 --- a/arch/x86/power/cpu.c +++ b

[PATCH v8 0/12] x86: Arbitrary CPU hot(un)plug support

2012-08-25 Thread Fenghua Yu
From: Fenghua Yu CPU0 or BSP (Bootstrap Processor) has been the last processor that can not be hot removed on x86. This patchset implements CPU0 or BSP online and offline and removes this obstacle to CPU hotplug. RAS needs the feature. If socket0 needs to be hotplugged for any reason (any

[PATCH v8 01/12] doc: Add x86 CPU0 online/offline feature

2012-08-25 Thread Fenghua Yu
From: Fenghua Yu If CONFIG_BOOTPARAM_HOTPLUG_CPU0 is turned on, CPU0 is hotpluggable. Otherwise, by default CPU0 is not hotpluggable and kernel parameter cpu0_hotplug enables CPU0 online/offline feature. The documentations point out two known CPU0 dependencies. First, resume from hibernate or

[PATCH v8 05/12] x86, hotplug, suspend: Online CPU0 for suspend or hibernate

2012-08-25 Thread Fenghua Yu
From: Fenghua Yu Because x86 BIOS requires CPU0 to resume from sleep, suspend or hibernate can't be executed if CPU0 is detected offline. To make suspend or hibernate and further resume succeed, CPU0 must be online. Signed-off-by: Fenghua Yu --- arch/x86/power/cpu.c |

[PATCH v8 02/12] x86, Kconfig: Add config switch for CPU0 hotplug

2012-08-25 Thread Fenghua Yu
From: Fenghua Yu New config switch CONFIG_BOOTPARAM_HOTPLUG_CPU0 sets default state of whether the CPU0 hotplug is on or off. If the switch is off, CPU0 is not hotpluggable by default. But the CPU0 hotplug feature can still be turned on by kernel parameter cpu0_hotplug at boot. If the switch

[PATCH v8 12/12] x86, topology: Debug CPU00 hotplug

2012-08-25 Thread Fenghua Yu
From: Fenghua Yu CONFIG_DEBUG_HOTPLUG_CPU0 is for debugging the CPU0 hotplug feature. The switch offlines CPU0 as soon as possible and boots userspace up with CPU0 offlined. User can online CPU0 back after boot time. The default value of the switch is off. To debug CPU0 hotplug, you need to

[PATCH v8 11/12] x86/i387.c: Initialize thread xstate only on CPU0 only once

2012-08-25 Thread Fenghua Yu
From: Fenghua Yu init_thread_xstate() is only called once to avoid overriding xstate_size during boot time or during CPU hotplug. Signed-off-by: Fenghua Yu --- arch/x86/kernel/i387.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/i387.c b/arch

[PATCH v8 10/12] x86, hotplug: The first online processor saves the MTRR state

2012-08-25 Thread Fenghua Yu
From: Fenghua Yu Ask the first online CPU to save mtrr instead of asking BSP. BSP could be offline when mtrr_save_state() is called. Signed-off-by: Fenghua Yu --- arch/x86/kernel/cpu/mtrr/main.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel

[PATCH v8 08/12] x86, hotplug: Wake up CPU0 via NMI instead of INIT, SIPI, SIPI

2012-08-25 Thread Fenghua Yu
From: Fenghua Yu Instead of waiting for STARTUP after INITs, BSP will execute the BIOS boot-strap code which is not a desired behavior for waking up BSP. To avoid the boot-strap code, wake up CPU0 by NMI instead. This works to wake up soft offlined CPU0 only. If CPU0 is hard offlined (i.e

[PATCH v8 09/12] x86, hotplug: During CPU0 online, enable x2apic, set_numa_node.

2012-08-25 Thread Fenghua Yu
From: Fenghua Yu Previously these functions were not run on the BSP (CPU 0, the boot processor) since the boot processor init would only be executed before this functionality was initialized. Signed-off-by: Fenghua Yu --- arch/x86/kernel/cpu/common.c |5 ++--- 1 files changed, 2

[PATCH v8 07/12] x86-32, hotplug: Add start_cpu0() entry point to head_32.S

2012-08-25 Thread Fenghua Yu
From: Fenghua Yu start_cpu0() is defined in head_32.S for 32-bit. The function sets up stack and jumps to start_secondary() for CPU0 wake up. Signed-off-by: Fenghua Yu --- arch/x86/kernel/head_32.S | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/arch/x86

[PATCH v8 06/12] x86-64, hotplug: Add start_cpu0() entry point to head_64.S

2012-08-25 Thread Fenghua Yu
From: Fenghua Yu start_cpu0() is defined in head_64.S for 64-bit. The function sets up stack and jumps to start_secondary() for CPU0 wake up. Signed-off-by: Fenghua Yu --- arch/x86/kernel/head_64.S | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/arch

[PATCH v8 04/12] x86, hotplug: Support functions for CPU0 online/offline

2012-08-25 Thread Fenghua Yu
From: Fenghua Yu Add smp_store_boot_cpu_info() to store cpu info for BSP during boot time. Now smp_store_cpu_info() stores cpu info for bringing up BSP or AP after it's offline. Continue to online CPU0 in native_cpu_up(). Continue to offline CPU0 in native_cpu_disable(). Signed-o

[PATCH v8 03/12] x86, topology: Don't offline CPU0 if any PIC irq can not be migrated out of it

2012-08-25 Thread Fenghua Yu
From: Fenghua Yu If CONFIG_BOOTPARAM_HOTPLUG_CPU is turned on, CPU0 hotplug feature is enabled by default. If CONFIG_BOOTPARAM_HOTPLUG_CPU is not turned on, CPU0 hotplug feature is not enabled by default. The kernel parameter cpu0_hotplug can enable CPU0 hotplug feature at boot. Signed-off-by

[PATCH 00/11] x86/microcode: Early load microcode

2012-08-18 Thread Fenghua Yu
From: Fenghua Yu The problem in current microcode loading method is that we load a microcode way, way too late; ideally we should load it before turning paging on. This may only be practical on 32 bits since we can't get to 64-bit mode without paging on, but we should still do it as early

[PATCH 03/11] x86/microcode_intel.h: Define functions and macros for early load ucode

2012-08-18 Thread Fenghua Yu
From: Fenghua Yu Define some functions and macros that will be used in early load ucode. Some of them are moved from microcode_intel.c driver in order to be called in early boot phase before module can be called. Signed-off-by: Fenghua Yu --- arch/x86/include/asm/microcode_intel.h | 103

[PATCH 09/11] x86/smpboot.c: Early update ucode on AP

2012-08-18 Thread Fenghua Yu
From: Fenghua Yu This updates ucode on AP. At this point, BSP should store some valid ucode patches in memory if it finds the ucode patches in initrd. AP searches the stored ucode and uploads the ucode. Signed-off-by: Fenghua Yu --- arch/x86/kernel/smpboot.c |7 +++ 1 files changed, 7

[PATCH 10/11] x86/mm/init.c: Copy ucode from initrd image to memory

2012-08-18 Thread Fenghua Yu
From: Fenghua Yu Before initrd image is freed, copy valid ucode patches from initrd image to kernel virtual memory. The saved ucode will be used to update AP in resume. Signed-off-by: Fenghua Yu --- arch/x86/mm/init.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff

[PATCH 11/11] x86/Kconfig: Configurations to enable/disable the feature

2012-08-18 Thread Fenghua Yu
From: Fenghua Yu MICROCODE_INTEL_LIB, MICROCODE_INTEL_EARLY, and MICROCODE_EARLY are three new configurations to enable or disable the feature. Signed-off-by: Fenghua Yu --- arch/x86/Kconfig | 22 ++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/arch

[PATCH 01/11] Documentation/x86: Early load microcode

2012-08-18 Thread Fenghua Yu
From: Fenghua Yu Documenation for early load microcode methodology. Signed-off-by: Fenghua Yu --- Documentation/x86/earlyucode.txt | 43 ++ 1 files changed, 43 insertions(+), 0 deletions(-) create mode 100644 Documentation/x86/earlyucode.txt diff --git

[PATCH 02/11] x86/lib/cpio.c: Find cpio data by its file name

2012-08-18 Thread Fenghua Yu
From: Fenghua Yu Given a file's name, find its starting point in a cpio formated area. This will be used to find microcode in combined initrd image. But this function is generic and could be used in other places. Signed-off-by: Fenghua Yu --- arch/x86/include/asm/cpio.h | 10 +++ arc

[PATCH 06/11] x86/microcode_intel_early.c: Early update ucode on Intel's CPU

2012-08-18 Thread Fenghua Yu
From: Fenghua Yu Implementation of early update ucode on Intel's CPU. load_ucode_intel_bsp() scans ucode in initrd image file which is a cpio format ucode followed by ordinary initrd image file. The binary ucode file is stored in kernel/x86/microcode/GenuineIntel/microcode.hex in the cpio

[PATCH 08/11] x86/head64.c: Early update ucode in 64-bit

2012-08-18 Thread Fenghua Yu
From: Fenghua Yu This updates ucode in 64-bit mode. Paging and virtual address are working now. Signed-off-by: Fenghua Yu --- arch/x86/kernel/head64.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index

[PATCH 05/11] x86/microcode_intel_lib.c: Early update ucode on Intel's CPU

2012-08-18 Thread Fenghua Yu
From: Fenghua Yu Define interfaces microcode_sanity_check() and get_matching_microcode(). They are called both in early boot time and in microcode Intel driver. Signed-off-by: Fenghua Yu --- arch/x86/kernel/microcode_intel_lib.c | 163 + 1 files changed, 163

[PATCH 04/11] x86/microcode_core_early.c: Define interfaces for early load ucode

2012-08-18 Thread Fenghua Yu
From: Fenghua Yu Define interfaces load_ucode_bsp() and load_ucode_ap() to load ucode on BSP and AP in early boot time. These are generic interfaces. Internally they call vendor specific implementations. Signed-off-by: Fenghua Yu --- arch/x86/include/asm/microcode.h | 23

[PATCH 07/11] x86/head_32.S: Early update ucode in 32-bit

2012-08-18 Thread Fenghua Yu
From: Fenghua Yu This updates ucode in 32-bit kernel. At this point, there is no paging and no virtual address yet. Signed-off-by: Fenghua Yu --- arch/x86/kernel/head_32.S |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel

[PATCH v9 03/12] x86, topology: Don't offline CPU0 if any PIC irq can not be migrated out of it

2012-10-12 Thread Fenghua Yu
From: Fenghua Yu If CONFIG_BOOTPARAM_HOTPLUG_CPU is turned on, CPU0 hotplug feature is enabled by default. If CONFIG_BOOTPARAM_HOTPLUG_CPU is not turned on, CPU0 hotplug feature is not enabled by default. The kernel parameter cpu0_hotplug can enable CPU0 hotplug feature at boot. Currently the

[PATCH v9 06/12] x86-64, hotplug: Add start_cpu0() entry point to head_64.S

2012-10-12 Thread Fenghua Yu
From: Fenghua Yu start_cpu0() is defined in head_64.S for 64-bit. The function sets up stack and jumps to start_secondary() for CPU0 wake up. Signed-off-by: Fenghua Yu --- arch/x86/kernel/head_64.S | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/arch

[PATCH v9 01/12] doc: Add x86 CPU0 online/offline feature

2012-10-12 Thread Fenghua Yu
From: Fenghua Yu If CONFIG_BOOTPARAM_HOTPLUG_CPU0 is turned on, CPU0 is hotpluggable. Otherwise, by default CPU0 is not hotpluggable and kernel parameter cpu0_hotplug enables CPU0 online/offline feature. The documentations point out two known CPU0 dependencies. First, resume from hibernate or

[PATCH v9 11/12] x86/i387.c: Initialize thread xstate only on CPU0 only once

2012-10-12 Thread Fenghua Yu
From: Fenghua Yu init_thread_xstate() is only called once to avoid overriding xstate_size during boot time or during CPU hotplug. Signed-off-by: Fenghua Yu --- arch/x86/kernel/i387.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/i387.c b/arch

[PATCH v9 10/12] x86, hotplug: The first online processor saves the MTRR state

2012-10-12 Thread Fenghua Yu
From: Fenghua Yu Ask the first online CPU to save mtrr instead of asking BSP. BSP could be offline when mtrr_save_state() is called. Signed-off-by: Fenghua Yu --- arch/x86/kernel/cpu/mtrr/main.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel

[PATCH v9 08/12] x86, hotplug: Wake up CPU0 via NMI instead of INIT, SIPI, SIPI

2012-10-12 Thread Fenghua Yu
From: Fenghua Yu Instead of waiting for STARTUP after INITs, BSP will execute the BIOS boot-strap code which is not a desired behavior for waking up BSP. To avoid the boot-strap code, wake up CPU0 by NMI instead. This works to wake up soft offlined CPU0 only. If CPU0 is hard offlined (i.e

[PATCH v9 09/12] x86, hotplug: During CPU0 online, enable x2apic, set_numa_node.

2012-10-12 Thread Fenghua Yu
From: Fenghua Yu Previously these functions were not run on the BSP (CPU 0, the boot processor) since the boot processor init would only be executed before this functionality was initialized. Signed-off-by: Fenghua Yu --- arch/x86/kernel/cpu/common.c |5 ++--- 1 files changed, 2

[PATCH v9 07/12] x86-32, hotplug: Add start_cpu0() entry point to head_32.S

2012-10-12 Thread Fenghua Yu
From: Fenghua Yu start_cpu0() is defined in head_32.S for 32-bit. The function sets up stack and jumps to start_secondary() for CPU0 wake up. Signed-off-by: Fenghua Yu --- arch/x86/kernel/head_32.S | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/arch/x86

[PATCH v9 12/12] x86, topology: Debug CPU00 hotplug

2012-10-12 Thread Fenghua Yu
From: Fenghua Yu CONFIG_DEBUG_HOTPLUG_CPU0 is for debugging the CPU0 hotplug feature. The switch offlines CPU0 as soon as possible and boots userspace up with CPU0 offlined. User can online CPU0 back after boot time. The default value of the switch is off. To debug CPU0 hotplug, you need to

[PATCH v9 05/12] x86, hotplug, suspend: Online CPU0 for suspend or hibernate

2012-10-12 Thread Fenghua Yu
From: Fenghua Yu Because x86 BIOS requires CPU0 to resume from sleep, suspend or hibernate can't be executed if CPU0 is detected offline. To make suspend or hibernate and further resume succeed, CPU0 must be online. Signed-off-by: Fenghua Yu --- arch/x86/power/cpu.c |

  1   2   3   4   5   6   7   8   9   10   >