linux/arch/x86/kernel
Eduardo Habkost d176720d34 x86: disable VMX on all CPUs on reboot
On emergency_restart, we may need to use an NMI to disable virtualization
on all CPUs. We do that using nmi_shootdown_cpus() if VMX is enabled.

Note: With this patch, we will run the NMI stuff only when the CPU where
emergency_restart() was called has VMX enabled. This should work on most
cases because KVM enables VMX on all CPUs, but we may miss the small
window where KVM is doing that. Also, I don't know if all code using
VMX out there always enable VMX on all CPUs like KVM does. We have two
other alternatives for that:

a) Have an API that all code that enables VMX on any CPU should use
   to tell the kernel core that it is going to enable VMX on the CPUs.
b) Always call nmi_shootdown_cpus() if the CPU supports VMX. This is
   a bit intrusive and more risky, as it would run nmi_shootdown_cpus()
   on emergency_reboot() even on systems where virtualization is never
   enabled.

Finding a proper point to hook the nmi_shootdown_cpus() call isn't
trivial, as the non-emergency machine_restart() (that doesn't need the
NMI tricks) uses machine_emergency_restart() directly.

The solution to make this work without adding a new function or argument
to machine_ops was setting a 'reboot_emergency' flag that tells if
native_machine_emergency_restart() needs to do the virt cleanup or not.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2008-12-31 16:54:58 +02:00
..
acpi x86: clean up get_smp_config() 2008-12-08 15:08:28 +01:00
cpu x86: Export some definition of MTRR 2008-12-31 16:51:44 +02:00
.gitignore arch/x86/kernel/.gitignore: Added vmlinux.lds to .gitignore file because it shouldn't be tracked. 2008-07-10 10:13:51 -07:00
alternative.c x86: improve UP kernel when CPU-hotplug and SMP is enabled 2008-10-13 10:33:46 +02:00
amd_iommu_init.c Merge branch 'x86/iommu' into x86/core 2008-12-23 16:30:27 +01:00
amd_iommu.c Merge branch 'x86/iommu' into x86/core 2008-12-23 16:30:27 +01:00
aperture_64.c aperture_64.c: clarify that too small aperture is valid reason for this code 2008-11-28 15:24:39 +01:00
apic.c Merge branch 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-12-28 12:21:10 -08:00
apm_32.c x86, apm: remove CONFIG_APM_REAL_MODE_POWER_OFF in favor of a kernel parameter 2008-12-02 11:28:49 +01:00
asm-offsets_32.c x86: signal: move sigframe.h to arch/x86/include/asm 2008-12-18 11:28:54 +01:00
asm-offsets_64.c x86: asm-offset_64: use rt_sigframe_ia32 2008-12-18 15:01:24 -08:00
asm-offsets.c
audit_64.c
bios_uv.c sgi-xp: xpc needs to pass the physical address, not virtual 2008-12-16 23:04:24 +01:00
bootflag.c
check.c x86: corruption-check: some post-move cleanups 2008-10-27 18:09:45 +01:00
cpuid.c device create: misc: convert device_create_drvdata to device_create 2008-10-16 09:24:43 -07:00
crash_dump_32.c kdump: make elfcorehdr_addr independent of CONFIG_PROC_VMCORE 2008-10-20 08:52:39 -07:00
crash_dump_64.c kdump: make elfcorehdr_addr independent of CONFIG_PROC_VMCORE 2008-10-20 08:52:39 -07:00
crash.c kdump: forcibly disable VMX and SVM on machine_crash_shutdown() 2008-12-31 16:52:30 +02:00
doublefault_32.c x86: fix virt_addr_valid() with CONFIG_DEBUG_VIRTUAL=y, v2 2008-10-13 10:33:15 +02:00
ds.c Merge branch 'x86/ptrace' into x86/tsc 2008-12-23 16:29:31 +01:00
dumpstack_32.c ftrace: print real return in dumpstack for function graph 2008-12-03 08:56:25 +01:00
dumpstack_64.c ftrace: print real return in dumpstack for function graph 2008-12-03 08:56:25 +01:00
dumpstack.c ftrace: print real return in dumpstack for function graph 2008-12-03 08:56:25 +01:00
dumpstack.h ftrace: print real return in dumpstack for function graph 2008-12-03 08:56:25 +01:00
e820.c x86: change static allocation of trampoline area 2008-12-08 13:49:45 +01:00
early_printk.c x86: remove simnow earlyprintk support 2008-12-12 17:02:21 +01:00
early-quirks.c x86: move GART specific stuff from iommu.h to gart.h 2008-11-28 13:06:27 +01:00
efi_32.c x86: fix i486 suspend to disk CR4 oops 2008-08-18 08:50:19 +02:00
efi_64.c x86: add flags parameter to reserve_bootmem_generic() 2008-07-08 11:49:49 +02:00
efi_stub_32.S
efi_stub_64.S
efi.c x86: Add UV EFI table entry v4 2008-10-16 16:53:13 +02:00
entry_32.S Merge branch 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-12-28 12:21:10 -08:00
entry_64.S Merge branch 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-12-28 12:21:10 -08:00
es7000_32.c Merge branch 'linus' into x86/quirks 2008-12-08 15:07:49 +01:00
ftrace.c tracing/function-graph-tracer: append the tracing_graph_flag 2008-12-08 15:11:45 +01:00
genapic_64.c x86: fix wakeup_cpu with numaq/es7000, v2, fix 2008-11-18 00:27:24 +01:00
genapic_flat_64.c x86: fix section mismatch warning - apic_physflat 2008-10-22 17:36:27 +02:00
genx2apic_cluster.c x86: fix section mismatch warning - apic_x2apic_cluster 2008-10-22 17:36:29 +02:00
genx2apic_phys.c x86: fix section mismatch warning - apic_x2apic_phys 2008-10-22 17:36:30 +02:00
genx2apic_uv_x.c x86: UV fix for global physical addresses 2008-12-16 22:54:03 +01:00
geode_32.c x86, geode: add a VSA2 ID for General Software 2008-06-19 14:19:03 +02:00
head32.c x86: change static allocation of trampoline area 2008-12-08 13:49:45 +01:00
head64.c x86: change static allocation of trampoline area 2008-12-08 13:49:45 +01:00
head_32.S x86, cpa: rename PTE attribute macros for kernel direct mapping in early boot 2008-10-10 19:29:11 +02:00
head_64.S x86, cpa: rename PTE attribute macros for kernel direct mapping in early boot 2008-10-10 19:29:11 +02:00
head.c x86, debug: remove EBDA debug printk 2008-12-12 11:08:42 +01:00
hpet.c Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-12-30 16:16:21 -08:00
i386_ksyms_32.c ftrace: rename FTRACE to FUNCTION_TRACER 2008-10-20 18:27:03 +02:00
i387.c x86: fix __cpuinit/__init tangle in init_thread_xstate() 2008-11-20 16:43:41 +01:00
i8237.c
i8253.c
i8259.c x64, x2apic/intr-remap: 8259 specific mask/unmask routines 2008-07-12 08:44:55 +02:00
init_task.c x86: remove init_mm export as planned for 2.6.26 2008-12-12 16:59:05 +01:00
io_apic.c Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-12-30 16:20:19 -08:00
io_delay.c x86: add io delay quirk for Presario F700 2008-09-03 16:42:51 -07:00
ioport.c x86: Introducing asm/syscalls.h 2008-07-22 14:35:57 +02:00
ipi.c X86_SMP: ipi.c declare functions before they get used 2008-07-25 11:57:46 +05:30
irq_32.c sparse irq_desc[] array: core kernel and x86 changes 2008-12-08 14:31:51 +01:00
irq_64.c Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-12-30 16:20:19 -08:00
irq.c sparse irq_desc[] array: core kernel and x86 changes 2008-12-08 14:31:51 +01:00
irqinit_32.c Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-12-30 16:20:19 -08:00
irqinit_64.c Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-12-30 16:20:19 -08:00
k8.c x86, gart: fix gart detection for Fam11h CPUs 2008-10-28 17:10:27 +01:00
kdebugfs.c arch/x86/kernel/kdebugfs.c: introduce missing kfree 2008-09-10 14:03:49 +02:00
kgdb.c kgdb, x86: Avoid invoking kgdb_nmicallback twice per NMI 2008-10-06 13:50:59 -05:00
kprobes.c kprobes: improve kretprobe scalability with hashed locking 2008-07-25 10:53:30 -07:00
kvm.c x86, paravirt_ops: use unsigned long instead of u32 for alloc_p*() pfn args 2008-08-22 05:34:44 +02:00
kvmclock.c kvm_setup_secondary_clock() is cpuinit 2008-11-30 10:03:37 -08:00
ldt.c Merge branch 'linus' into x86/xen 2008-10-12 12:37:32 +02:00
machine_kexec_32.c kexec/i386: setup kexec page table in C 2008-10-31 10:01:57 +01:00
machine_kexec_64.c kexec jump 2008-07-26 12:00:04 -07:00
Makefile Merge branch 'core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-12-30 16:10:19 -08:00
mca_32.c
mfgpt_32.c x86, geode-mfgpt: check IRQ before using MFGPT as clocksource 2008-08-15 17:12:32 +02:00
microcode_amd.c x86: fix warning in arch/x86/kernel/microcode_amd.c 2008-12-19 01:31:54 +01:00
microcode_core.c Merge branches 'x86/apic', 'x86/cleanups', 'x86/cpufeature', 'x86/crashdump', 'x86/debug', 'x86/defconfig', 'x86/detect-hyper', 'x86/doc', 'x86/dumpstack', 'x86/early-printk', 'x86/fpu', 'x86/idle', 'x86/io', 'x86/memory-corruption-check', 'x86/microcode', 'x86/mm', 'x86/mtrr', 'x86/nmi-watchdog', 'x86/pat2', 'x86/pci-ioapic-boot-irq-quirks', 'x86/ptrace', 'x86/quirks', 'x86/reboot', 'x86/setup-memory', 'x86/signal', 'x86/sparse-fixes', 'x86/time', 'x86/uv' and 'x86/xen' into x86/core 2008-12-23 16:27:23 +01:00
microcode_intel.c Merge branches 'x86/apic', 'x86/cleanups', 'x86/cpufeature', 'x86/crashdump', 'x86/debug', 'x86/defconfig', 'x86/detect-hyper', 'x86/doc', 'x86/dumpstack', 'x86/early-printk', 'x86/fpu', 'x86/idle', 'x86/io', 'x86/memory-corruption-check', 'x86/microcode', 'x86/mm', 'x86/mtrr', 'x86/nmi-watchdog', 'x86/pat2', 'x86/pci-ioapic-boot-irq-quirks', 'x86/ptrace', 'x86/quirks', 'x86/reboot', 'x86/setup-memory', 'x86/signal', 'x86/sparse-fixes', 'x86/time', 'x86/uv' and 'x86/xen' into x86/core 2008-12-23 16:27:23 +01:00
mmconf-fam10h_64.c x86: mmconf: fix section mismatch warning 2008-08-18 07:49:06 +02:00
module_32.c
module_64.c PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
mpparse.c x86: clean up get_smp_config() 2008-12-08 15:08:28 +01:00
msr.c device create: misc: convert device_create_drvdata to device_create 2008-10-16 09:24:43 -07:00
nmi.c Merge branches 'x86/apic', 'x86/cleanups', 'x86/cpufeature', 'x86/crashdump', 'x86/debug', 'x86/defconfig', 'x86/detect-hyper', 'x86/doc', 'x86/dumpstack', 'x86/early-printk', 'x86/fpu', 'x86/idle', 'x86/io', 'x86/memory-corruption-check', 'x86/microcode', 'x86/mm', 'x86/mtrr', 'x86/nmi-watchdog', 'x86/pat2', 'x86/pci-ioapic-boot-irq-quirks', 'x86/ptrace', 'x86/quirks', 'x86/reboot', 'x86/setup-memory', 'x86/signal', 'x86/sparse-fixes', 'x86/time', 'x86/uv' and 'x86/xen' into x86/core 2008-12-23 16:27:23 +01:00
numaq_32.c x86: fix wakeup_cpu with numaq/es7000, v2, fix 2008-11-18 00:27:24 +01:00
olpc.c x86, olpc: fix endian bug in openfirmware workaround 2008-09-24 10:29:04 +02:00
paravirt_patch_32.c x86: coding style fixes to arch/x86/kernel/paravirt_patch_32.c 2008-08-15 16:53:25 +02:00
paravirt_patch_64.c x86/paravirt: add sysret/sysexit pvops for returning to 32-bit compatibility userspace 2008-07-08 13:15:52 +02:00
paravirt-spinlocks.c x86: fix default_spin_lock_flags() prototype 2008-12-08 16:08:29 +01:00
paravirt.c Merge branch 'linus' into x86/xen 2008-10-12 12:37:32 +02:00
pci-calgary_64.c arch/x86/kernel/pci-calgary_64.c: change simple_strtol to simple_strtoul 2008-11-25 15:56:03 +01:00
pci-dma.c Merge branch 'core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-12-30 16:10:19 -08:00
pci-gart_64.c x86 gart: don't complain if no AMD GART found 2008-12-18 13:26:23 +01:00
pci-nommu.c x86: export pci-nommu's alloc_coherent 2008-09-25 11:02:25 +02:00
pci-swiotlb_64.c x86/swiotlb: add default swiotlb_arch_range_needs_mapping 2008-12-17 18:58:22 +01:00
pcspeaker.c x86: use platform_device_register_simple() 2008-09-22 12:58:36 +02:00
pmtimer_64.c
probe_roms_32.c x86: seperate probe_roms into another file 2008-07-08 12:50:05 +02:00
process_32.c x86, bts: add fork and exit handling 2008-12-20 09:15:46 +01:00
process_64.c x86, bts: add fork and exit handling 2008-12-20 09:15:46 +01:00
process.c Merge branch 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-12-28 12:21:10 -08:00
ptrace.c x86, bts: memory accounting 2008-12-20 09:15:47 +01:00
pvclock.c x86: pvclock: fix shadowed variable warning 2008-10-15 14:25:14 +02:00
quirks.c x86: enable HPET on Fujitsu u9200 2008-12-16 20:36:44 +01:00
reboot_fixups_32.c
reboot.c x86: disable VMX on all CPUs on reboot 2008-12-31 16:54:58 +02:00
relocate_kernel_32.S kexec/i386: setup kexec page table in C 2008-10-31 10:01:57 +01:00
relocate_kernel_64.S
rtc.c rtc: use bcd2bin/bin2bcd 2008-10-20 08:52:41 -07:00
scx200_32.c
setup_percpu.c x86: remove redundant KERN_DEBUG on pr_debug 2008-10-22 16:56:22 +02:00
setup.c Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-12-30 16:20:19 -08:00
signal.c x86: signal: move sigframe.h to arch/x86/include/asm 2008-12-18 11:28:54 +01:00
smp.c Merge branch 'x86/irq' into x86/core 2008-12-23 16:30:31 +01:00
smpboot.c Merge branch 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-12-28 12:21:10 -08:00
smpcommon.c x86: change init_gdt to update the gdt via write_gdt, rather than a direct write. 2008-08-15 19:16:05 +02:00
stacktrace.c tracing/stack-tracer: fix style issues 2008-11-23 11:53:48 +01:00
step.c x86 ptrace: user-sets-TF nits 2008-07-16 12:15:17 -07:00
summit_32.c x86: mach_summit to summit 2008-07-26 16:31:35 +02:00
sys_i386_32.c x86: Introducing asm/syscalls.h 2008-07-22 14:35:57 +02:00
sys_x86_64.c Merge branches 'x86/alternatives', 'x86/cleanups', 'x86/commandline', 'x86/crashdump', 'x86/debug', 'x86/defconfig', 'x86/doc', 'x86/exports', 'x86/fpu', 'x86/gart', 'x86/idle', 'x86/mm', 'x86/mtrr', 'x86/nmi-watchdog', 'x86/oprofile', 'x86/paravirt', 'x86/reboot', 'x86/sparse-fixes', 'x86/tsc', 'x86/urgent' and 'x86/vmalloc' into x86-v28-for-linus-phase1 2008-10-06 18:17:07 +02:00
syscall_64.c x86: Fix ASM_X86__ header guards 2008-10-22 22:55:23 -07:00
syscall_table_32.S flag parameters add-on: remove epoll_create size param 2008-07-24 10:47:29 -07:00
tce_64.c
test_nx.c
test_rodata.c
time_32.c x86: hardirq: use inc_irq_stat() in non-unified functions 2008-12-16 22:30:19 +01:00
time_64.c Merge branch 'x86/irq' into x86/core 2008-12-23 16:30:31 +01:00
tlb_32.c Merge branch 'x86/irq' into x86/core 2008-12-23 16:30:31 +01:00
tlb_64.c x86: hardirq: use inc_irq_stat() in non-unified functions 2008-12-16 22:30:19 +01:00
tlb_uv.c x86, UV: fix redundant creation of sgi_uv 2008-11-11 11:38:50 +01:00
tls.c x86: Introducing asm/syscalls.h 2008-07-22 14:35:57 +02:00
tls.h
topology.c
trampoline_32.S
trampoline_64.S
trampoline.c x86: change static allocation of trampoline area 2008-12-08 13:49:45 +01:00
traps.c Merge branches 'x86/pat2' and 'x86/fpu'; commit 'v2.6.28' into x86/core 2008-12-25 11:50:41 +01:00
tsc_sync.c Merge branches 'x86/apic', 'x86/cleanups', 'x86/cpufeature', 'x86/crashdump', 'x86/debug', 'x86/defconfig', 'x86/detect-hyper', 'x86/doc', 'x86/dumpstack', 'x86/early-printk', 'x86/fpu', 'x86/idle', 'x86/io', 'x86/memory-corruption-check', 'x86/microcode', 'x86/mm', 'x86/mtrr', 'x86/nmi-watchdog', 'x86/pat2', 'x86/pci-ioapic-boot-irq-quirks', 'x86/ptrace', 'x86/quirks', 'x86/reboot', 'x86/setup-memory', 'x86/signal', 'x86/sparse-fixes', 'x86/time', 'x86/uv' and 'x86/xen' into x86/core 2008-12-23 16:27:23 +01:00
tsc.c Merge branches 'x86/apic', 'x86/cleanups', 'x86/cpufeature', 'x86/crashdump', 'x86/debug', 'x86/defconfig', 'x86/detect-hyper', 'x86/doc', 'x86/dumpstack', 'x86/early-printk', 'x86/fpu', 'x86/idle', 'x86/io', 'x86/memory-corruption-check', 'x86/microcode', 'x86/mm', 'x86/mtrr', 'x86/nmi-watchdog', 'x86/pat2', 'x86/pci-ioapic-boot-irq-quirks', 'x86/ptrace', 'x86/quirks', 'x86/reboot', 'x86/setup-memory', 'x86/signal', 'x86/sparse-fixes', 'x86/time', 'x86/uv' and 'x86/xen' into x86/core 2008-12-23 16:27:23 +01:00
uv_irq.c x86, UV: add uv_setup_irq() and uv_teardown_irq() functions, v3, fix 2008-10-16 16:53:13 +02:00
uv_sysfs.c x86: Add sysfs entries for UV v4 2008-10-16 16:53:13 +02:00
verify_cpu_64.S
visws_quirks.c genirq: revert dynarray 2008-10-16 16:53:15 +02:00
vm86_32.c x86: Introducing asm/syscalls.h 2008-07-22 14:35:57 +02:00
vmi_32.c Merge branches 'x86/apic', 'x86/cleanups', 'x86/cpufeature', 'x86/crashdump', 'x86/debug', 'x86/defconfig', 'x86/detect-hyper', 'x86/doc', 'x86/dumpstack', 'x86/early-printk', 'x86/fpu', 'x86/idle', 'x86/io', 'x86/memory-corruption-check', 'x86/microcode', 'x86/mm', 'x86/mtrr', 'x86/nmi-watchdog', 'x86/pat2', 'x86/pci-ioapic-boot-irq-quirks', 'x86/ptrace', 'x86/quirks', 'x86/reboot', 'x86/setup-memory', 'x86/signal', 'x86/sparse-fixes', 'x86/time', 'x86/uv' and 'x86/xen' into x86/core 2008-12-23 16:27:23 +01:00
vmiclock_32.c x86: VMI, initialize IRQ vector 2008-10-16 16:52:59 +02:00
vmlinux_32.lds.S tracing/function-graph-tracer: add a new .irqentry.text section, fix 2008-12-12 12:14:05 +01:00
vmlinux_64.lds.S tracing/function-graph-tracer: add a new .irqentry.text section 2008-12-12 11:14:07 +01:00
vmlinux.lds.S
vsmp_64.c x86: two trivial sparse annotations 2008-10-29 08:02:28 +01:00
vsyscall_64.c Merge branch 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2008-12-28 12:21:10 -08:00
x8664_ksyms_64.c ftrace: rename FTRACE to FUNCTION_TRACER 2008-10-20 18:27:03 +02:00
xsave.c x86: fixing __cpuinit/__init tangle, xsave_cntxt_init() 2008-11-20 16:43:42 +01:00