Re: [PATCH 15/15] Revert "x86: default to reboot via ACPI"

2008-11-05 Thread Ingo Molnar
* Eduardo Habkost <[EMAIL PROTECTED]> wrote: > This reverts commit c7ffa6c26277b403920e2255d10df849bd613380. > > Now that we have the hooks to disable virtualization on > emergency_restart(), we can get back to the BOOT_KBD reboot_type default. > > Signed-off-by: Eduardo Habkost <[EMAIL PROTECT

Re: [PATCH 09/15] x86: Emergency virtualization disable function

2008-11-05 Thread Pavel Machek
On Wed 2008-11-05 17:56:52, Eduardo Habkost wrote: > This patch adds an interface to set a function that can be used to > disable virtualization extensions on the CPU on emergency cases, such > as on kdump or emergency reboot. > > The function will be set by code that enables virtualization extens

[PATCH 06/15] x86: Move nmi_shootdown_cpus() to reboot.c

2008-11-05 Thread Eduardo Habkost
Now nmi_shootdown_cpus() is ready to be used by non-kdump code also. Move it to reboot.c. Signed-off-by: Eduardo Habkost <[EMAIL PROTECTED]> --- arch/x86/kernel/crash.c | 73 -- arch/x86/kernel/reboot.c | 79

[PATCH 07/15] x86: Make nmi_shootdown_cpus() available on !SMP and !X86_LOCAL_APIC

2008-11-05 Thread Eduardo Habkost
The X86_LOCAL_APIC #ifdef was for kdump. For !SMP, the function simply does nothing. Signed-off-by: Eduardo Habkost <[EMAIL PROTECTED]> --- arch/x86/kernel/reboot.c | 13 - 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reb

[PATCH 09/15] x86: Emergency virtualization disable function

2008-11-05 Thread Eduardo Habkost
This patch adds an interface to set a function that can be used to disable virtualization extensions on the CPU on emergency cases, such as on kdump or emergency reboot. The function will be set by code that enables virtualization extensions on the CPUs (i.e. KVM), and should do the very least to

[PATCH 15/15] Revert "x86: default to reboot via ACPI"

2008-11-05 Thread Eduardo Habkost
This reverts commit c7ffa6c26277b403920e2255d10df849bd613380. Now that we have the hooks to disable virtualization on emergency_restart(), we can get back to the BOOT_KBD reboot_type default. Signed-off-by: Eduardo Habkost <[EMAIL PROTECTED]> --- arch/x86/kernel/reboot.c |6 +- 1 files c

[PATCH 01/15] x86 kdump: Extract kdump-specific code from crash_nmi_callback()

2008-11-05 Thread Eduardo Habkost
The NMI CPU-halting code will be used on non-kdump cases, also (e.g. emergency_reboot when virtualization is enabled). Signed-off-by: Eduardo Habkost <[EMAIL PROTECTED]> --- arch/x86/kernel/crash.c | 31 --- 1 files changed, 20 insertions(+), 11 deletions(-) diff --

[PATCH 02/15] x86 kdump: Move crashing_cpu assignment to nmi_shootdown_cpus()

2008-11-05 Thread Eduardo Habkost
This variable will be moved to non-kdump-specific code. Signed-off-by: Eduardo Habkost <[EMAIL PROTECTED]> --- arch/x86/kernel/crash.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c index d82ac72..a70c1c6 100644 --

[PATCH 10/15] kdump: Hook emergency_virt_disable() on crash shutdown code

2008-11-05 Thread Eduardo Habkost
[v2: add comments on source code, explaining why it is needed] Signed-off-by: Eduardo Habkost <[EMAIL PROTECTED]> --- arch/x86/kernel/crash.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c index d84a852..040f

[PATCH 13/15] kvm: svm: register virt_disable function on hardware_setup

2008-11-05 Thread Eduardo Habkost
Call set_virt_disable_func() on hardware_setup, and clear it on hardware_unsetup. This way kdump and reboot code will be able to disable svm when needed. Signed-off-by: Eduardo Habkost <[EMAIL PROTECTED]> --- arch/x86/kvm/svm.c | 19 +++ 1 files changed, 15 insertions(+), 4 del

[PATCH 14/15] kvm: vmx: crash_hardware_disable function

2008-11-05 Thread Eduardo Habkost
We need to first check if virtualization was enabled. We do this by checking CR4.VMXE. If it is set, run vmxoff and clear CR4.VMXE. Register it using set_virt_disable_func() on hardware_setup, and unregister it on hardware_unsetup. Signed-off-by: Eduardo Habkost <[EMAIL PROTECTED]> --- arch/x86/

[PATCH 00/15] x86: disable virt on kdump and emergency_restart (v2)

2008-11-05 Thread Eduardo Habkost
Move the set_virt_disable_func() call to vmx.c and svm.c. This made the patch series shorter and removing one level of abstraction. This series is against linux-next-20081105. Patches 01-07 simply move the non-kdump-specific parts of nmi_shootdown_cpus() to reboot.c, so it can be used by emergenc

[PATCH 03/15] x86 kdump: Create kdump_nmi_shootdown_cpus()

2008-11-05 Thread Eduardo Habkost
For the kdump-specific code that was living on nmi_shootdown_cpus(). Signed-off-by: Eduardo Habkost <[EMAIL PROTECTED]> --- arch/x86/kernel/crash.c | 11 +-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c index a70c1c6..d

[PATCH 11/15] x86: disable virtualization on all CPUs if needed, on emergency_restart

2008-11-05 Thread Eduardo Habkost
On emergency_restart, we may need to use an NMI to disable virtualization on all CPUs. We do that by using nmi_shootdown_cpus(), but only if a virt_disable function was set by KVM. Finding a proper point to hook the nmi_shootdown_cpus() call isn't trivial, as the non-emergency machine_restart() (t

[PATCH 04/15] x86 kdump: Make kdump_nmi_callback() a function ptr on crash_nmi_callback()

2008-11-05 Thread Eduardo Habkost
The reboot code will use a different function on crash_nmi_callback(). Adding a function pointer parameter to nmi_shootdown_cpus() for that. Signed-off-by: Eduardo Habkost <[EMAIL PROTECTED]> --- arch/x86/kernel/crash.c | 11 --- 1 files changed, 8 insertions(+), 3 deletions(-) diff --

[PATCH 12/15] kvm: svm: no-parameters version of svm_hardware_disable()

2008-11-05 Thread Eduardo Habkost
Create __svm_hardware_disable(), a function we can use for set_virt_disable_func(). Signed-off-by: Eduardo Habkost <[EMAIL PROTECTED]> --- arch/x86/kvm/svm.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index f0ad4d4..3d330

[PATCH 08/15] x86: Disable IRQs before doing anything on nmi_shootdown_cpus()

2008-11-05 Thread Eduardo Habkost
We need to know on which CPU we are running on, and we don't want to be preempted while doing this. Signed-off-by: Eduardo Habkost <[EMAIL PROTECTED]> --- arch/x86/kernel/reboot.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/r

[PATCH 05/15] x86 kdump: Make nmi_shootdown_cpus() non-static

2008-11-05 Thread Eduardo Habkost
Add prototype to asm/reboot.h. Signed-off-by: Eduardo Habkost <[EMAIL PROTECTED]> --- arch/x86/include/asm/reboot.h |5 + arch/x86/kernel/crash.c |3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/reboot.h b/arch/x86/include/asm/reboot.h

Re: [PATCH 08/16] x86: Emergency virtualization disable function

2008-11-05 Thread Eduardo Habkost
On Wed, Nov 05, 2008 at 09:33:06AM -0800, Eric W. Biederman wrote: > Eduardo Habkost <[EMAIL PROTECTED]> writes: > > > +int set_virt_disable_func(void (*fn)(void)) > > +{ > > + int r = 0; > > + > > + spin_lock(&virt_disable_lock); > > + if (!virt_disable_fn) > > + rcu_assign_pointe

Re: [PATCH 15/16] kvm: x86: set kdump virt_disable function on initialization

2008-11-05 Thread Eduardo Habkost
On Wed, Nov 05, 2008 at 09:26:53AM -0800, Eric W. Biederman wrote: > Eduardo Habkost <[EMAIL PROTECTED]> writes: > > > Finally implement the virt_disable function for kdump. It will call > > kvm_x86_ops->crash_hardware_disable(), that will disable virtualization > > extensions on the CPU if it is

Re: [PATCH 08/16] x86: Emergency virtualization disable function

2008-11-05 Thread Eric W. Biederman
Eduardo Habkost <[EMAIL PROTECTED]> writes: > +int set_virt_disable_func(void (*fn)(void)) > +{ > + int r = 0; > + > + spin_lock(&virt_disable_lock); > + if (!virt_disable_fn) > + rcu_assign_pointer(virt_disable_fn, fn); > + else > + r = -EEXIST; > + spi

Re: [PATCH 15/16] kvm: x86: set kdump virt_disable function on initialization

2008-11-05 Thread Eric W. Biederman
Eduardo Habkost <[EMAIL PROTECTED]> writes: > Finally implement the virt_disable function for kdump. It will call > kvm_x86_ops->crash_hardware_disable(), that will disable virtualization > extensions on the CPU if it is not disabled yet. > > Signed-off-by: Eduardo Habkost <[EMAIL PROTECTED]> > --

Re: [PATCH 00/14] x86: disable virt on kdump and emergency_restart

2008-11-05 Thread Ingo Molnar
* Avi Kivity <[EMAIL PROTECTED]> wrote: > Eduardo Habkost wrote: >> Hi, >> >> This is a new version of the series to disabling virtualization on kdump, >> now extended to do the same tricks on emergency_restart() if needed. >> > > Looks good. If you me to push it upstream, I'll need kexec/kdu

Re: [PATCH 09/16] kdump: Hook emergency_virt_disable() on crash shutdown code

2008-11-05 Thread Eduardo Habkost
On Wed, Nov 05, 2008 at 09:41:44AM -0500, Vivek Goyal wrote: > On Tue, Nov 04, 2008 at 12:52:37PM -0200, Eduardo Habkost wrote: > > Signed-off-by: Eduardo Habkost <[EMAIL PROTECTED]> > > --- > > arch/x86/kernel/crash.c |3 +++ > > 1 files changed, 3 insertions(+), 0 deletions(-) > > > > diff

Re: [PATCH 00/14] x86: disable virt on kdump and emergency_restart

2008-11-05 Thread Eduardo Habkost
On Wed, Nov 05, 2008 at 09:44:12AM -0500, Vivek Goyal wrote: > On Tue, Nov 04, 2008 at 06:54:04PM +0200, Avi Kivity wrote: > > Eduardo Habkost wrote: > >> Hi, > >> > >> This is a new version of the series to disabling virtualization on kdump, > >> now extended to do the same tricks on emergency_res

Re: [PATCH 00/14] x86: disable virt on kdump and emergency_restart

2008-11-05 Thread Vivek Goyal
On Tue, Nov 04, 2008 at 06:54:04PM +0200, Avi Kivity wrote: > Eduardo Habkost wrote: >> Hi, >> >> This is a new version of the series to disabling virtualization on kdump, >> now extended to do the same tricks on emergency_restart() if needed. >> > > Looks good. If you me to push it upstream, I

Re: [PATCH 09/16] kdump: Hook emergency_virt_disable() on crash shutdown code

2008-11-05 Thread Vivek Goyal
On Tue, Nov 04, 2008 at 12:52:37PM -0200, Eduardo Habkost wrote: > Signed-off-by: Eduardo Habkost <[EMAIL PROTECTED]> > --- > arch/x86/kernel/crash.c |3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c > index d84a852..

[PATCH] Add include for offsetof macro

2008-11-05 Thread Stefan Assmann
kexec/arch/i386/kexec-elf-x86.c and kexec/arch/x86_64/kexec-elf-x86_64.c both use the macro offsetof() which according to the man page requires #include . The include is not present at the moment and this patch adds it. This is necessary for compatibility with i.e. uClibc. Signed-off-by: Stefan As