kvm: disable virtualization on kdump
Subsystems (5)
cover kvm: disable virtualization on kdump
The following two patches should make kdump work when the kvm-intel module is loaded. We need to disable vmx mode before booting the kdump kernel, so I've introduced a notifier interface where KVM can hook and disable virtualization on all CPUs just before they are halted.
It has the same purpose of the KVM reboot notifier that gets executed at kexec-time. But on the kdump case, things are not as simple because the kernel has just crashed.
The notifier interface being introduced is x86-specific. I don't know if an arch-independent interface would be more appropriate for this case.
It was tested only using kvm-intel. Testing on different machines is welcome.
Signature · 1 line
Eduardo
PATCH 1/2 kdump: crash-time CPU halt notifier interface
This patch adds an interface for notification of CPUs being halted on a crash. The notifier will be called once on each CPU by machine_crash_shutdown().
The notifiers will be used by KVM to disable virtualization before halting the CPUs, otherwise the booting of the kdump kernel may hang (it does, on my machine, when kvm-intel module is loaded).
We can't just use the same notifiers used at reboot time (that are used by non-crash-dump kexec), because at crash time some CPUs may have IRQs disabled, so we can't use IPIs. The crash shutdown code use NMIs to tell the other CPUs to be halted, and the new notifier call is hooked into the CPU halting code that is on the crash shutdown NMI handler.
I am not sure if a non x86-specific interface is more recommended. Some arches don't have code to halt the CPUs on machine_crash_shutdown(), so the interface wouldn't make sense on those arches.
--- arch/x86/kernel/crash.c | 5 ++++ arch/x86/kernel/reboot.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++ include/asm-x86/reboot.h | 4 +++ 3 files changed, 63 insertions(+), 0 deletions(-)
arch/x86/kernel/crash.c +5 -0
@@ -16,6 +16,7 @@#include <linux/delay.h> #include <linux/elf.h> #include <linux/elfcore.h> +#include <linux/module.h> #include <asm/processor.h> #include <asm/hardirq.h>
@@ -65,6 +66,8 @@ static int crash_nmi_callback(struct notifier_block *self, }#endif crash_save_cpu (regs, cpu); + +emergency_halt_notify (cpu);disable_local_APIC ();atomic_dec (&waiting_for_crash_ipi);/* Assume hlt works */
@@ -134,6 +137,8 @@ void native_machine_crash_shutdown(struct pt_regs *regs)/* Make a note of crashing cpu. Will be used in NMI callback.*/ crashing_cpu =safe_smp_processor_id ();nmi_shootdown_cpus (); +emergency_halt_notify (crashing_cpu); +lapic_shutdown ();#if defined(CONFIG_X86_IO_APIC )disable_IO_APIC ();
arch/x86/kernel/reboot.c +54 -0
57 lines not on this page · raw message
include/asm-x86/reboot.h +4 -0
@@ -18,4 +18,8 @@ void native_machine_crash_shutdown(struct pt_regs *regs);void native_machine_shutdown (void );void machine_real_restart (const unsigned char *code,int length); +int register_emergency_halt_notifier (struct notifier_block *nb); +int unregister_emergency_halt_notifier (struct notifier_block *nb); +void emergency_halt_notify (unsigned int cpu); +#endif /* ASM_X86__REBOOT_H */
Signature · 1 line
1.5.5.GIT
PATCH 2/2 kvm: disable virtualization when halting CPUs on crash
In reply to Eduardo HabkostUse the emergency_halt_notifier interface to disable virtualization on all the CPUs on machine_crash_shutdown().
--- arch/x86/kvm/x86.c | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-)
arch/x86/kvm/x86.c +21 -1
@@ -40,6 +40,7 @@#include <asm/msr.h> #include <asm/desc.h> #include <asm/mtrr.h> +#include <asm/reboot.h> #define MAX_IO_MSRS 256#define CR0_RESERVED_BITS \
@@ -2583,6 +2584,18 @@ int kvm_emulate_pio_string(struct kvm_vcpu *vcpu, struct kvm_run *run, int in, }EXPORT_SYMBOL_GPL (kvm_emulate_pio_string); +static int kvm_emergency_halt (struct notifier_block *notifier, +unsigned long val,void *v) +{ +/* We are crashing. Do the very least */ +kvm_arch_hardware_disable (NULL ); +return NOTIFY_OK ; +} + +static struct notifier_block kvm_emergency_halt_notifier = { + .notifier_call = kvm_emergency_halt, +}; +int kvm_arch_init (void *opaque) {int r;
@@ -2605,10 +2618,14 @@ int kvm_arch_init(void *opaque) goto out; } - r =kvm_mmu_module_init (); + r =register_emergency_halt_notifier (&kvm_emergency_halt_notifier);if (r) goto out; + r =kvm_mmu_module_init (); +if (r) + goto out_unregister; +kvm_init_msr_list (); kvm_x86_ops = ops;
@@ -2618,6 +2635,8 @@ int kvm_arch_init(void *opaque) PT_DIRTY_MASK, PT64_NX_MASK, 0, 0);return 0 ; +out_unregister: +unregister_emergency_halt_notifier (&kvm_emergency_halt_notifier); out:return r; }
@@ -2626,6 +2645,7 @@ void kvm_arch_exit(void) { kvm_x86_ops =NULL ;kvm_mmu_module_exit (); +unregister_emergency_halt_notifier (&kvm_emergency_halt_notifier); }int kvm_emulate_halt (struct kvm_vcpu *vcpu)
Signature · 1 line
1.5.5.GIT
Quoted 9 lines · Eduardo Habkost
The following two patches should make kdump work when the kvm-intel module is loaded. We need to disable vmx mode before booting the kdump kernel, so I've introduced a notifier interface where KVM can hook and disable virtualization on all CPUs just before they are halted.
It has the same purpose of the KVM reboot notifier that gets executed at kexec-time. But on the kdump case, things are not as simple because the kernel has just crashed.
Quoted 6 lines
The notifier interface being introduced is x86-specific. I don't know if an arch-independent interface would be more appropriate for this case.
It was tested only using kvm-intel. Testing on different machines is welcome.
These changes look fine to me from a kexec/kdump point of view.
Signature · 9 lines
Simon Horman VA Linux Systems Japan K.K., Sydney, Australia Satellite Office H: www.vergenet.net/~horms/ W: www.valinux.co.jp/en _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Quoted 14 lines · Simon Horman
Quoted 13 lines · Eduardo Habkost
The following two patches should make kdump work when the kvm-intel module is loaded. We need to disable vmx mode before booting the kdump kernel, so I've introduced a notifier interface where KVM can hook and disable virtualization on all CPUs just before they are halted.
It has the same purpose of the KVM reboot notifier that gets executed at kexec-time. But on the kdump case, things are not as simple because the kernel has just crashed.
The notifier interface being introduced is x86-specific. I don't know if an arch-independent interface would be more appropriate for this case.
Quoted 6 lines
Quoted 2 lines
It was tested only using kvm-intel. Testing on different machines is welcome.
These changes look fine to me from a kexec/kdump point of view.
Reviewed-by Simon Horman <horms-/[email protected]>
Thanks.
Considering they touch both KVM and kexec, which tree would be best way to get them in?
(Avi: the patches were sent only to kexec and kvm mailing lists, initially. If it's better to submit them to your address also so it gets on your queue, please let me know)
Signature · 1 line
Eduardo
[ Added Andrew Morton, Eric Biederman, Vivek Goyal and Haren Myneni to CC ]
Quoted 18 lines · Eduardo Habkost
Quoted 17 lines · Simon Horman
Quoted 15 lines · Eduardo Habkost
The following two patches should make kdump work when the kvm-intel module is loaded. We need to disable vmx mode before booting the kdump kernel, so I've introduced a notifier interface where KVM can hook and disable virtualization on all CPUs just before they are halted.
It has the same purpose of the KVM reboot notifier that gets executed at kexec-time. But on the kdump case, things are not as simple because the kernel has just crashed.
The notifier interface being introduced is x86-specific. I don't know if an arch-independent interface would be more appropriate for this case.
It was tested only using kvm-intel. Testing on different machines is welcome.
Quoted 8 lines
Quoted 3 lines
These changes look fine to me from a kexec/kdump point of view.
Reviewed-by Simon Horman <horms-/[email protected]>Thanks.
Considering they touch both KVM and kexec, which tree would be best way to get them in?
As I understand it, there is no kexec tree as such, rather patches either get picked up by an arch tree or Andrew Morton. I am happy to create and maintain a kexec tree if there is a need. But in this case it seems that using the KVM tree would be best.
Quoted 3 lines
(Avi: the patches were sent only to kexec and kvm mailing lists, initially. If it's better to submit them to your address also so it gets on your queue, please let me know)
I won't speak for Avi, but usually its good to CC the maintainer.
Signature · 3 lines
Simon Horman VA Linux Systems Japan K.K., Sydney, Australia Satellite Office H: www.vergenet.net/~horms/ W: www.valinux.co.jp/en
Quoted 17 lines · Simon Horman
[ Added Andrew Morton, Eric Biederman, Vivek Goyal and Haren Myneni to CC ]
Quoted 14 lines · Eduardo Habkost
Quoted 13 lines · Simon Horman
Quoted 12 lines · Eduardo Habkost
The following two patches should make kdump work when the kvm-intel module is loaded. We need to disable vmx mode before booting the kdump kernel, so I've introduced a notifier interface where KVM can hook and disable virtualization on all CPUs just before they are halted.
It has the same purpose of the KVM reboot notifier that gets executed at kexec-time. But on the kdump case, things are not as simple because the kernel has just crashed.
The notifier interface being introduced is x86-specific. I don't know if an arch-independent interface would be more appropriate for this case.
My preference would be to have a magic function call that compiles out when kvm isn't present. This is a code path that is hard to audit and test, and get right. A notifier chain seems to make a proper audit all but impossible.
Why do we need to disable vmx mode before booting a normal linux kernel? Is it possible to disable vmx mode before we enable interrrupts in the kdump kernel?
Eric
Quoted 4 lines · Eduardo Habkost
Considering they touch both KVM and kexec, which tree would be best way to get them in?
kvm.git will be happy to hold these patches, provided they are acked by the relevant maintainer.
Quoted 4 lines
(Avi: the patches were sent only to kexec and kvm mailing lists, initially. If it's better to submit them to your address also so it gets on your queue, please let me know)
Please do copy me.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 2 lines · Eric W. Biederman
Why do we need to disable vmx mode before booting a normal linux kernel?
vmx mode blocks INIT (even on the host; not just on the guests) so reboots don't work. It also assigns some memory to the cpu; if the new kernel isn't aware of it, the cpu and the kernel would both think it belongs to them. Finally, if vmx mode is enabled, you can't start kvm on the new kernel.
Quoted 3 lines
Is it possible to disable vmx mode before we enable interrrupts in the kdump kernel?
You need IPIs to disable vmx on smp.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 5 lines · Avi Kivity
Quoted 2 lines · Eric W. Biederman
Why do we need to disable vmx mode before booting a normal linux kernel?
vmx mode blocks INIT (even on the host; not just on the guests)
*blink* broken hardware design there.
Quoted 3 lines
so reboots don't
work. It also assigns some memory to the cpu; if the new kernel isn't aware of it,
Not a problem for a kdump kernel, as it lives out of a reserved region of memory.
Quoted 2 lines
the cpu and the kernel would both think it belongs to them. Finally, if vmx mode is enabled, you can't start kvm on the new kernel.
This isn't especially interesting in the crash dump scenario.
Quoted 5 lines
Quoted 3 lines
Is it possible to disable vmx mode before we enable interrrupts in the kdump kernel?
You need IPIs to disable vmx on smp.
Thank you. Reading your description and taking a quick look at the code in hardware disable it does not appear that there is anything needed (other than restricting ourselves it running uniprocessor in the kdump kernel) that needs to happen.
Certainly it would be nice to have kvm disabled in hardware, but if you are proposing using the existing hardware disable I must say that the cure looks much worse than the disease.
It looks like the disable function is all of about 20 assembly instructions so I would not have a problem if he had a little inline function we could call that test to see if vmx is enabled and disable it in the case of kexec on panic.
The normal polite shutdown. That just looks like asking for trouble.
Eric
Quoted 8 lines · Eric W. Biederman
Quoted 4 lines
so reboots don't
work. It also assigns some memory to the cpu; if the new kernel isn't aware of it,Not a problem for a kdump kernel, as it lives out of a reserved region of memory.
But it is a problem for general kexec.
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
Is it possible to disable vmx mode before we enable interrrupts in the kdump kernel?
You need IPIs to disable vmx on smp.
Quoted 9 lines
Thank you. Reading your description and taking a quick look at the code in hardware disable it does not appear that there is anything needed (other than restricting ourselves it running uniprocessor in the kdump kernel) that needs to happen.
Certainly it would be nice to have kvm disabled in hardware, but if you are proposing using the existing hardware disable I must say that the cure looks much worse than the disease.
Certainly you don't want to issue IPIs when kdump()ing. It's not unlikely that the other cpus have interrupts permanently disabled.
(we can use NMI IPIs, but that will likely be messy)
Quoted 7 lines
It looks like the disable function is all of about 20 assembly instructions so I would not have a problem if he had a little inline function we could call that test to see if vmx is enabled and disable it in the case of kexec on panic.
The normal polite shutdown. That just looks like asking for trouble.
But what happens when the kdump kernel reboots? If it is uniprocessor, it will never have a chance to disable vmx on other cpus. Using acpi reset (now default) works around this on some machines, but not all.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 1 line · Avi Kivity
Eric W. Biederman wrote:
<snip>
Quoted 17 lines
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
Is it possible to disable vmx mode before we enable interrrupts in the kdump kernel?
You need IPIs to disable vmx on smp.
Quoted 9 lines
Thank you. Reading your description and taking a quick look at the code in hardware disable it does not appear that there is anything needed (other than restricting ourselves it running uniprocessor in the kdump kernel) that needs to happen.
Certainly it would be nice to have kvm disabled in hardware, but if you are proposing using the existing hardware disable I must say that the cure looks much worse than the disease.
Quoted 4 lines
Certainly you don't want to issue IPIs when kdump()ing. It's not unlikely that the other cpus have interrupts permanently disabled.
(we can use NMI IPIs, but that will likely be messy)
NMI IPIs are already used on x86 native_machine_crash_shutdown(), so it wouldn't get more messy that it is currently. We just need to add another bit of code to the code that already runs on an NMI handler.
My question is: is a notifier chain too much complexity for a sensible piece of code like that? If so, a compile-time hook on that point would be safer, but then it wouldn't work when KVM is compiled as a out-of-tree module.
Quoted 6 lines
Quoted 6 lines
It looks like the disable function is all of about 20 assembly instructions so I would not have a problem if he had a little inline function we could call that test to see if vmx is enabled and disable it in the case of kexec on panic.
Quoted 6 lines
Quoted 2 lines
The normal polite shutdown. That just looks like asking for trouble.
But what happens when the kdump kernel reboots? If it is uniprocessor, it will never have a chance to disable vmx on other cpus. Using acpi reset (now default) works around this on some machines, but not all.
Good point. My problem was a hang when booting the kdump kernel, but it may also cause problems later, when the kdump kernel reboots.
Signature · 1 line
Eduardo
Quoted 11 lines · Avi Kivity
Quoted 2 lines · Eric W. Biederman
Quoted 2 lines
so reboots don't
work. It also assigns some memory to the cpu; if the new kernel isn't awareof
Quoted 5 lines
Quoted 1 line
it,
Not a problem for a kdump kernel, as it lives out of a reserved region of memory.
But it is a problem for general kexec.
Agreed. We certainly want to cleanly disable vmx on a normal kexec reboot.
Quoted 27 lines
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
Is it possible to disable vmx mode before we enable interrrupts in the kdump kernel?
You need IPIs to disable vmx on smp.
Quoted 9 lines
Thank you. Reading your description and taking a quick look at the code in hardware disable it does not appear that there is anything needed (other than restricting ourselves it running uniprocessor in the kdump kernel) that needs to happen.
Certainly it would be nice to have kvm disabled in hardware, but if you are proposing using the existing hardware disable I must say that the cure looks much worse than the disease.
Certainly you don't want to issue IPIs when kdump()ing. It's not unlikely that the other cpus have interrupts permanently disabled.
(we can use NMI IPIs, but that will likely be messy)
Quoted 5 lines
It looks like the disable function is all of about 20 assembly instructions so I would not have a problem if he had a little inline function we could call that test to see if vmx is enabled and disable it in the case of kexec on panic.
Quoted 6 lines
Quoted 2 lines
The normal polite shutdown. That just looks like asking for trouble.
But what happens when the kdump kernel reboots? If it is uniprocessor, it will never have a chance to disable vmx on other cpus. Using acpi reset (now default) works around this on some machines, but not all.
Mostly likely any reboot path will trigger software to toggle the reset line on the board. At least that has been my experience, and the reason we don't see many problems when we fail to properly shutdown devices before reboot. If vmx persists across that it would seem to be very broken by design.
In any case if reboot fails after a kdump that is a minor thing. Someone can always push the power button or the equivalent.
My objections are: on_each_cpu called from after a panic looks like a good way to loose control of the box and never return. Adding a notifier looks like a good way too add functionality onto the kdump path that never gets reviewed for robustness after a kernel crash and thus a good way to remove the usefulness of the kexec on panic kernel path.
Eric
Quoted 20 lines · Eduardo Habkost
Quoted 1 line · Avi Kivity
Eric W. Biederman wrote:
<snip>
Quoted 17 lines
Quoted 16 lines
Quoted 6 lines
Quoted 4 lines
Is it possible to disable vmx mode before we enable interrrupts in the kdump kernel?
You need IPIs to disable vmx on smp.
Thank you. Reading your description and taking a quick look at the code in hardware disable it does not appear that there is anything needed (other than restricting ourselves it running uniprocessor in the kdump kernel) that needs to happen.
Certainly it would be nice to have kvm disabled in hardware, but if you are proposing using the existing hardware disable I must say that the cure looks much worse than the disease.
Quoted 8 lines
Quoted 4 lines
Certainly you don't want to issue IPIs when kdump()ing. It's not unlikely that the other cpus have interrupts permanently disabled.
(we can use NMI IPIs, but that will likely be messy)
NMI IPIs are already used on x86
native_machine_crash_shutdown(), so it wouldn't get more messy that it is currently. We just need to add another bit of code to the code that already runs on an NMI handler.
Yes. And handling of those NMIs is best effort. Nothing fails if they don't actually run.
Quoted 4 lines
My question is: is a notifier chain too much complexity for a sensible piece of code like that? If so, a compile-time hook on that point would be safer, but then it wouldn't work when KVM is compiled as a out-of-tree module.
Well we could fairly easily have a non-modular function that does. if (vmx_present && vmx_enabled) {
turn_off_vmx();
}
Which at first skim looks like it is all of about 10-20 machine instructions.
There are a few real places where we need code on the kdump path because there it is not possible to do the work any other way. However we need to think long and hard about that because placing the code anywhere besides in a broken and failing kernel is going to be easier to maintain and more reliable.
I oppose an atomic notifier because it makes the review essentially impossible. If any module can come in and register a notifier we can't know what code is running on that code path and we can't be certain the code is safe in an abnormal case to run on that code path.
Right now we only need to support vmx on the kdump path because of what appears to be a hardware design bug. Enabling vmx apparently disables standard functions like an INIT IPI. Things like this do happen but they should be rare.
Quoted 2 lines
Good point. My problem was a hang when booting the kdump kernel, but it may also cause problems later, when the kdump kernel reboots.
What was the cause of the hang when booting the kdump kernel?
Eric
Quoted 8 lines · Eduardo Habkost
Quoted 2 lines
(we can use NMI IPIs, but that will likely be messy)
NMI IPIs are already used on x86
native_machine_crash_shutdown(), so it wouldn't get more messy that it is currently. We just need to add another bit of code to the code that already runs on an NMI handler.
That looks like the easiest (and best) way out.
Quoted 3 lines
My question is: is a notifier chain too much complexity for a sensible piece of code like that? If so, a compile-time hook on that point would be safer,
I think an unconditional vmx disable is wanted here, so kexec can work with other hypervisors.
Quoted 3 lines
but then it wouldn't work when KVM is compiled as a
out-of-tree module.
The external module can do without. It's possible to hijack the nmi vector, but I don't think that's a good idea. If someone wants kexec+vmx on an older kernel, they can patch that kernel.
Quoted 7 lines
Quoted 4 lines
But what happens when the kdump kernel reboots? If it is uniprocessor, it will never have a chance to disable vmx on other cpus. Using acpi reset (now default) works around this on some machines, but not all.
Good point. My problem was a hang when booting the kdump kernel, but it may also cause problems later, when the kdump kernel reboots.
The hang was likely caused by vmx blocking INIT. Sigh.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 11 lines · Eric W. Biederman
Quoted 4 lines
But what happens when the kdump kernel reboots? If it is uniprocessor, it will never have a chance to disable vmx on other cpus. Using acpi reset (now default) works around this on some machines, but not all.
Mostly likely any reboot path will trigger software to toggle the reset line on the board. At least that has been my experience, and the reason we don't see many problems when we fail to properly shutdown devices before reboot. If vmx persists across that it would seem to be very broken by design.
We've observed on some machines that keyboard controller reset didn't work, and that the fallback to triple-fault asserted INIT and not RESET (and that this INIT was blocked, hanging the machine). Switching to acpi reset worked on some machines, but not all. Either acpi reset was not implemented on the failing machines, or it was wired to INIT and not RESET.
Quoted 7 lines
My objections are:
on_each_cpucalled from after a panic looks like a good way to loose control of the box and never return. Adding a notifier looks like a good way too add functionality onto the kdump path that never gets reviewed for robustness after a kernel crash and thus a good way to remove the usefulness of the kexec on panic kernel path.
Since we already have NMI IPIs, we could disable vmx there. If it is done unconditionally and without notifiers, there is no chance of having unreviewed surprises sneaking in.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 9 lines · Eric W. Biederman
Quoted 4 lines
NMI IPIs are already used on x86
native_machine_crash_shutdown(), so it wouldn't get more messy that it is currently. We just need to add another bit of code to the code that already runs on an NMI handler.Yes. And handling of those NMIs is best effort. Nothing fails if they don't actually run.
Unless someone can come up with another way to disable vmx remotely, that's going to change if you have vmx enabled.
Quoted 9 lines
Well we could fairly easily have a non-modular function that does.
if (vmx_present && vmx_enabled) { turn_off_vmx(); }Which at first skim looks like it is all of about 10-20 machine instructions.
There's no way to query whether vmx is enabled or disabled, AFAICT. So we have to execute vmxoff and ignore possible #UDs.
If we trust the exception handlers, there's no problem. Otherwise we need to replace the current #UD handler with an iret (perhaps switching temporarily to another IDT).
Quoted 7 lines
There are a few real places where we need code on the kdump path because there it is not possible to do the work any other way. However we need to think long and hard about that because placing the code anywhere besides in a broken and failing kernel is going to be easier to maintain and more reliable.
vmx blocking INITs makes it impossible to leave this to the new kernel.
Quoted 6 lines
I oppose an atomic notifier because it makes the review essentially impossible. If any module can come in and register a notifier we can't know what code is running on that code path and we can't be certain the code is safe in an abnormal case to run on that code path.
What if it's a specialized notifier for kexec? Or even kexec_crash?
That said, I have no issue with static code at the call site.
Quoted 5 lines
Right now we only need to support vmx on the kdump path because of what appears to be a hardware design bug. Enabling vmx apparently disables standard functions like an INIT IPI. Things like this do happen but they should be rare.
The general kexec path also wants this fixed.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 19 lines · Avi Kivity
Quoted 9 lines · Eric W. Biederman
Quoted 4 lines
NMI IPIs are already used on x86
native_machine_crash_shutdown(), so it wouldn't get more messy that it is currently. We just need to add another bit of code to the code that already runs on an NMI handler.Yes. And handling of those NMIs is best effort. Nothing fails if they don't actually run.
Unless someone can come up with another way to disable vmx remotely, that's going to change if you have vmx enabled.
Quoted 5 lines
Well we could fairly easily have a non-modular function that does.
if (vmx_present && vmx_enabled) { turn_off_vmx(); }
Quoted 7 lines
Quoted 4 lines
Which at first skim looks like it is all of about 10-20 machine instructions.
There's no way to query whether vmx is enabled or disabled, AFAICT. So we have to execute vmxoff and ignore possible #UDs.
Oops. This means the notifier my patches add would break, if vmx is disabled on any CPU.
Can't we just set a flag when we are about to enable vmx, so we run vmxoff only when know it's enabled? There will be a tiny window between setting this flag and and actually running vmxon where things could go wrong, but this doesn't look that bad.
Having to handle #UD would make things more messy, in my opinion.
BTW, is this problem vmx-specific? Do we need to do something similar for svm?
Quoted 4 lines
If we trust the exception handlers, there's no problem. Otherwise we need to replace the current #UD handler with an iret (perhaps switching temporarily to another IDT).
I think we can't fully trust anything if we are on the crash dump path, so the less code we depend on, the better.
Quoted 11 lines
Quoted 8 lines
There are a few real places where we need code on the kdump path because there it is not possible to do the work any other way. However we need to think long and hard about that because placing the code anywhere besides in a broken and failing kernel is going to be easier to maintain and more reliable.
vmx blocking INITs makes it impossible to leave this to the new kernel.
Quoted 8 lines
Quoted 6 lines
I oppose an atomic notifier because it makes the review essentially impossible. If any module can come in and register a notifier we can't know what code is running on that code path and we can't be certain the code is safe in an abnormal case to run on that code path.
What if it's a specialized notifier for kexec? Or even
kexec_crash?
The patches I've sent to the kvm mailing list added a notifier interface specific for kexec_crash, using raw_notifier_*().
IMO, if a notifier registration interface was acceptable, the raw notifiers would be good enough for that. But Eric seems to think that adding a notifier registration interface for the crash handler path wouldn't be a good idea, and I am starting to agree with him.
Quoted 10 lines
That said, I have no issue with static code at the call site.
Quoted 5 lines
Right now we only need to support vmx on the kdump path because of what appears to be a hardware design bug. Enabling vmx apparently disables standard functions like an INIT IPI. Things like this do happen but they should be rare.
The general kexec path also wants this fixed.
When I've tested it, kexec called the kvm reboot notifier, so everything worked fine.
Signature · 1 line
Eduardo
Quoted 32 lines · Avi Kivity
Quoted 8 lines · Eduardo Habkost
Quoted 2 lines
(we can use NMI IPIs, but that will likely be messy)
NMI IPIs are already used on x86
native_machine_crash_shutdown(), so it wouldn't get more messy that it is currently. We just need to add another bit of code to the code that already runs on an NMI handler.That looks like the easiest (and best) way out.
Quoted 3 lines
My question is: is a notifier chain too much complexity for a sensible piece of code like that? If so, a compile-time hook on that point would be safer,
I think an unconditional vmx disable is wanted here, so kexec can work with other hypervisors.
Quoted 3 lines
but then it wouldn't work when KVM is compiled as a
out-of-tree module.The external module can do without. It's possible to hijack the nmi vector, but I don't think that's a good idea. If someone wants kexec+vmx on an older kernel, they can patch that kernel.
Quoted 5 lines
Quoted 5 lines
But what happens when the kdump kernel reboots? If it is uniprocessor, it will never have a chance to disable vmx on other cpus. Using acpi reset (now default) works around this on some machines, but not all.
Quoted 5 lines
Quoted 3 lines
Good point. My problem was a hang when booting the kdump kernel, but it may also cause problems later, when the kdump kernel reboots.
The hang was likely caused by vmx blocking INIT. Sigh.
Avi,
We boot kdump kernel with maxcpus=1. IIUC, in that code path we will not be using INIT. So did you try booting kdump kernel with maxcpus=1 and did it work for you? If not than problem could be something else.
Thanks
Vivek
Quoted 3 lines
Signature · 2 lines
-- error compiling committee.c: too many arguments to function
Quoted 5 lines · Eduardo Habkost
Can't we just set a flag when we are about to enable vmx, so we run vmxoff only when know it's enabled? There will be a tiny window between setting this flag and and actually running vmxon where things could go wrong, but this doesn't look that bad.
It makes more sense to have a vmxon api in the core; you call it, the kernel enables it and sets a flag; then either you or the core can disable it.
Quoted 2 lines
Having to handle #UD would make things more messy, in my opinion.
It's not too bad, either relying on exception handlers or hacking our own.
Quoted 4 lines
BTW, is this problem vmx-specific? Do we need to do something similar for svm?
svm needs it as well, since it shares some memory with the cpu. It's less critical though, will likely work even without it.
Quoted 8 lines
Quoted 4 lines
If we trust the exception handlers, there's no problem. Otherwise we need to replace the current #UD handler with an iret (perhaps switching temporarily to another IDT).
I think we can't fully trust anything if we are on the crash dump path, so the less code we depend on, the better.
So we can point #UD temporarily at an 'addq $3, (%rsp); iret' for the vmxoff instruction. Or implement the 'enable virt extensions' API.
Quoted 9 lines
The patches I've sent to the kvm mailing list added a notifier interface specific for
kexec_crash, using raw_notifier_*().IMO, if a notifier registration interface was acceptable, the raw notifiers would be good enough for that. But Eric seems to think that adding a notifier registration interface for the crash handler path wouldn't be a good idea, and I am starting to agree with him.
I wouldn't mind notifiers (with a nice comment explaining that you must know what you're doing, though that's the case with most kernel APIs). I'm fine with either approach.
Quoted 6 lines
Quoted 2 lines
The general kexec path also wants this fixed.
When I've tested it, kexec called the kvm reboot notifier, so everything worked fine.
Oh, okay.
Signature · 7 lines
error compiling committee.c: too many arguments to function _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Quoted 9 lines · Vivek Goyal
Quoted 2 lines
The hang was likely caused by vmx blocking INIT. Sigh.
Avi,
We boot kdump kernel with maxcpus=1. IIUC, in that code path we will not be using INIT. So did you try booting kdump kernel with maxcpus=1 and did it work for you? If not than problem could be something else.
It wasn't me who tried it, so I can't tell.
Signature · 7 lines
error compiling committee.c: too many arguments to function _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Quoted 7 lines · Avi Kivity
Eric W. Biederman wrote:
We've observed on some machines that keyboard controller reset didn't work, and that the fallback to triple-fault asserted INIT and not RESET (and that this INIT was blocked, hanging the machine). Switching to acpi reset worked on some machines, but not all. Either acpi reset was not implemented on the failing machines, or it was wired to INIT and not RESET.
Right. INIT does not reset things like the MTRRs, I had forgotten that distinction.
Frequently the firmware when it regains control at 0xffffffff0 asserts reset, but if we can't get there. Ouch!
Quoted 3 lines
Since we already have NMI IPIs, we could disable vmx there. If it is done unconditionally and without notifiers, there is no chance of having unreviewed surprises sneaking in.
Sounds good to me.
Eric
Quoted 6 lines · Avi Kivity
There's no way to query whether vmx is enabled or disabled, AFAICT. So we have to execute vmxoff and ignore possible #UDs.
If we trust the exception handlers, there's no problem. Otherwise we need to replace the current #UD handler with an iret (perhaps switching temporarily to another IDT).
Ugh. We already change the IDT on that code path so that may be a way to go.
Quoted 1 line
The general kexec path also wants this fixed.
It looks like someone hooked the reboot notifier which should be called on the normal kexec path.
Eric
Quoted 17 lines · Eric W. Biederman
Quoted 7 lines · Avi Kivity
Eric W. Biederman wrote:
We've observed on some machines that keyboard controller reset didn't work, and that the fallback to triple-fault asserted INIT and not RESET (and that this INIT was blocked, hanging the machine). Switching to acpi reset worked on some machines, but not all. Either acpi reset was not implemented on the failing machines, or it was wired to INIT and not RESET.
Right. INIT does not reset things like the MTRRs, I had forgotten that distinction.
Frequently the firmware when it regains control at
0xffffffff0asserts reset, but if we can't get there. Ouch!
Quoted 5 lines
Quoted 3 lines
Since we already have NMI IPIs, we could disable vmx there. If it is done unconditionally and without notifiers, there is no chance of having unreviewed surprises sneaking in.
Sounds good to me.
The problem here is that we can't disable it unconditionally, so we need to either hack into #UD, or track on which CPUs it is enabled. But tracking on which CPUs it is enabled is exactly what KVM hardware_enable()/hardware_disable() do.
To avoid hacking into #UD only for that, I was being inclined to simply add core code to track on which CPUs vmx is enabled. But just calling back into KVM doesn't look too bad, as long as the callback does only what is strictly necessary. It looks a bit better than moving kvm code to the core, and looks simple enough to be better than hacking #UD.
Maybe we could have a simple virt-specific callback pointer instead of a whole notifier chain?
Signature · 1 line
Eduardo
Quoted 11 lines · Eric W. Biederman
Quoted 6 lines · Avi Kivity
There's no way to query whether vmx is enabled or disabled, AFAICT. So we have to execute vmxoff and ignore possible #UDs.
If we trust the exception handlers, there's no problem. Otherwise we need to replace the current #UD handler with an iret (perhaps switching temporarily to another IDT).
Ugh. We already change the IDT on that code path so that may be a way to go.
I don't see the IDT being changed on native_machine_shutdown(). It even uses notifier chain registration (register_die_notifier()) to sneak a NMI handler in.
Signature · 1 line
Eduardo
Quoted 9 lines · Avi Kivity
Quoted 5 lines · Eduardo Habkost
Can't we just set a flag when we are about to enable vmx, so we run vmxoff only when know it's enabled? There will be a tiny window between setting this flag and and actually running vmxon where things could go wrong, but this doesn't look that bad.
It makes more sense to have a vmxon api in the core; you call it, the kernel enables it and sets a flag; then either you or the core can disable it.
Yes. That sounds like the most maintainable approach.
Quoted 10 lines
Quoted 9 lines
The patches I've sent to the kvm mailing list added a notifier interface specific for
kexec_crash, using raw_notifier_*().IMO, if a notifier registration interface was acceptable, the raw notifiers would be good enough for that. But Eric seems to think that adding a notifier registration interface for the crash handler path wouldn't be a good idea, and I am starting to agree with him.
Quoted 3 lines
I wouldn't mind notifiers (with a nice comment explaining that you must know what you're doing, though that's the case with most kernel APIs). I'm fine with either approach.
This is the 3rd request I have seen for a notifier. This is the first request I have seen for code that must be executed in the kexec on panic path. So history suggest to me that notifiers make it unreasonably easy to get code onto the kexec on panic code path.
Occasionally the kexec on panic code path is tested to see how well it works in strange situations like being called from a stack overflow etc.
The rest of the history is that previous attempts like lkcd had very programmer friendly interfaces, that worked fine in test environments giving beautiful core dumps, but when things broke in the field they were essentially useless. The kdump approach is still not completely reliable but it does work well enough that people get useful crash dumps sometimes.
I feel anything that makes the kexec on panic code path harder to verify it will work when things are crazy broken, like a notifier is something we should avoid.
Eric
Quoted 1 line · Eric W. Biederman
Avi Kivity <[email protected]> writes:
<snip>
Quoted 21 lines
Quoted 4 lines
I wouldn't mind notifiers (with a nice comment explaining that you must know what you're doing, though that's the case with most kernel APIs). I'm fine with either approach.
This is the 3rd request I have seen for a notifier. This is the first request I have seen for code that must be executed in the kexec on panic path. So history suggest to me that notifiers make it unreasonably easy to get code onto the kexec on panic code path.
Occasionally the kexec on panic code path is tested to see how well it works in strange situations like being called from a stack overflow etc.
The rest of the history is that previous attempts like lkcd had very programmer friendly interfaces, that worked fine in test environments giving beautiful core dumps, but when things broke in the field they were essentially useless. The kdump approach is still not completely reliable but it does work well enough that people get useful crash dumps sometimes.
Quoted 3 lines
I feel anything that makes the kexec on panic code path harder to verify it will work when things are crazy broken, like a notifier is something we should avoid.
I am still wondering if a simple function pointer (instead of a full notifier interface) would be good enough. It looks like a reasonable tradeoff.
I think I will get flamed if I try to pull to the core a bunch of code that always lived in the KVM module. 8)
And even if we pull those functions to the core, we will still have a function pointer on the new code anyway, because we would need to support vmx and svm.
Signature · 1 line
Eduardo
Quoted 3 lines · Eduardo Habkost
I am still wondering if a simple function pointer (instead of a full notifier interface) would be good enough. It looks like a reasonable tradeoff.
Oh sorry. As long as we do the whole rcu protected thing so it is safe
to call the function without taking locks it should work. I'm not thrilled about a function pointer but it should work.
Quoted 2 lines
I think I will get flamed if I try to pull to the core a bunch of code that always lived in the KVM module. 8)
Why is KVM modular anyway? That seems like some pretty core cpu functionality...
Quoted 3 lines
And even if we pull those functions to the core, we will still have a function pointer on the new code anyway, because we would need to support vmx and svm.
Depending. It doesn't sound like svm has the problem where init doesn't work so svm really doesn't need to do this.
Eric
Quoted 3 lines · Eduardo Habkost
I think I will get flamed if I try to pull to the core a bunch of code that always lived in the KVM module. 8)
Having a simple api to enter vmx or svm mode in core code should not be too bad. The kvm hardware_enable() stuff could simply call that. The only downsides I see are a very minor bloat to the core, and spreading kvm code around.
Quoted 4 lines
And even if we pull those functions to the core, we will still have a function pointer on the new code anyway, because we would need to support vmx and svm.
Or have an if () statement there.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 6 lines · Eric W. Biederman
Quoted 3 lines
I think I will get flamed if I try to pull to the core a bunch of code that always lived in the KVM module. 8)
Why is KVM modular anyway? That seems like some pretty core cpu functionality...
Many reasons. Developers like the ability to rmmod and modprobe during development. Distros like to keep their non-modular core small. There is an external module distribution that allows users to graft a new kvm on an old kernel, which our testers and bleeding edge users like. Because it's there.
There's always CONFIG_KVM=y if you don't want it.
Quoted 3 lines
Depending. It doesn't sound like svm has the problem where init doesn't work so svm really doesn't need to do this.
svm can writeback into memory at odd times if we don't do this, and the cost is small - clear a bit in EFER. There's no reason to be lazy.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 5 lines · Avi Kivity
Quoted 4 lines · Eric W. Biederman
Quoted 3 lines
I think I will get flamed if I try to pull to the core a bunch of code that always lived in the KVM module. 8)
Quoted 8 lines
Quoted 1 line
Why is KVM modular anyway? That seems like some pretty core cpu
functionality...
Quoted 1 line
Many reasons. Developers like the ability to rmmod and modprobe during development. Distros like to keep their non-modular core small. There is an external module distribution that allows users to graft a new kvm on an old kernel, which our testers and bleeding edge users like. Because it's there.
Most of the reason I was wondering is that the cpu hardware probing largely seems to be a duplicate of what we have in the core for probing cpu capabilities already, and could likely be made smaller by building upon the existing codebase.
Quoted 2 lines
svm can writeback into memory at odd times if we don't do this, and the cost is small - clear a bit in EFER. There's no reason to be lazy.
Especially if we can clear that bit unconditionally (when EFER is present) I'm all for it.
Eric
Quoted 6 lines · Eric W. Biederman
Most of the reason I was wondering is that the cpu hardware probing largely seems to be a duplicate of what we have in the core for probing cpu capabilities already, and could likely be made smaller by building upon the existing codebase.
We use the core cpuid functions, or are you referring to something else?
Quoted 7 lines
Quoted 3 lines
svm can writeback into memory at odd times if we don't do this, and the cost is small - clear a bit in EFER. There's no reason to be lazy.
Especially if we can clear that bit unconditionally (when EFER is present) I'm all for it.
That is the case.
Signature · 7 lines
error compiling committee.c: too many arguments to function _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Quoted 1 line · Vivek Goyal
On Mon, Oct 27, 2008 at 10:54:01AM +0200, Avi Kivity wrote:
<snip>
Quoted 8 lines
Quoted 2 lines
The hang was likely caused by vmx blocking INIT. Sigh.
Avi,
We boot kdump kernel with maxcpus=1. IIUC, in that code path we will not be using INIT. So did you try booting kdump kernel with maxcpus=1 and did it work for you? If not than problem could be something else.
Just checked it here: I am passing maxcpus=1 to the kdump kernel. My full kexec commandline is this:
/sbin/kexec --console-serial -p '--command-line=ro root=/dev/vg0/rawhide rhgb console=ttyS0,115200 ignore_loglevel irqpoll maxcpus=1 reset_devices earlyprintk=ttyS0,115200' --initrd=/boot/initrd-2.6.28-rc2kdump.img /boot/vmlinuz-2.6.28-rc2
Additional info: I don't get the "I'm in purgatory" message on serial console, when the system hangs. I do get the message if I trigger the crash dump after unloading the kvm-intel module, so the serial console is working.
Signature · 1 line
Eduardo
Quoted 4 lines · Eduardo Habkost
Quoted 4 lines
We boot kdump kernel with maxcpus=1. IIUC, in that code path we will not be using INIT. So did you try booting kdump kernel with maxcpus=1 and did it work for you? If not than problem could be something else.
vmx also disallows changing some bits in cr0 and cr4; for example you can't switch off paging. This may interfere with the boot sequence.
The full set of pleasant surprises is detailed in section 19.8 of the SDM volume 3, "RESTRICTIONS ON VMX OPERATION".
Signature · 8 lines
I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain. _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Quoted 15 lines · Eduardo Habkost
Quoted 1 line · Vivek Goyal
On Mon, Oct 27, 2008 at 10:54:01AM +0200, Avi Kivity wrote:
<snip>
Quoted 8 lines
Quoted 2 lines
The hang was likely caused by vmx blocking INIT. Sigh.
Avi,
We boot kdump kernel with maxcpus=1. IIUC, in that code path we will not be using INIT. So did you try booting kdump kernel with maxcpus=1 and did it work for you? If not than problem could be something else.
Just checked it here: I am passing maxcpus=1 to the kdump kernel. My full kexec commandline is this:
Quoted 7 lines
/sbin/kexec--console-serial -p '--command-line=ro root=/dev/vg0/rawhide rhgb console=ttyS0,115200ignore_loglevelirqpoll maxcpus=1reset_devicesearlyprintk=ttyS0,115200' --initrd=/boot/initrd-2.6.28-rc2kdump.img/boot/vmlinuz-2.6.28-rc2Additional info: I don't get the "I'm in purgatory" message on serial console, when the system hangs. I do get the message if I trigger the crash dump after unloading the kvm-intel module, so the serial console is working.
That means we are not even beginning to boot second kernel and are getting lost somewhere in the first kernel itself (most likely relocate_kernel_32/64.S).
And it could be because of any of the interesting restrictions put when vmx is enabled (As Avi mentioned in another mail.).
To debug that code, I used to put some "outb" messages to output a character to serial console and find out which instructions is creating trouble. You can debug to find out exactly what operation is not allowed when vmx is enabled or simply write the patches to disable vmx and it should automatically lead to problem resolution.
Thanks
Vivek
Quoted 30 lines · Vivek Goyal
Quoted 8 lines · Eduardo Habkost
Quoted 1 line · Vivek Goyal
On Mon, Oct 27, 2008 at 10:54:01AM +0200, Avi Kivity wrote:
<snip>
Quoted 5 lines
Quoted 2 lines
The hang was likely caused by vmx blocking INIT. Sigh.
Avi,
Quoted 8 lines
Quoted 3 lines
We boot kdump kernel with maxcpus=1. IIUC, in that code path we will not be using INIT. So did you try booting kdump kernel with maxcpus=1 and did it work for you? If not than problem could be something else.
Just checked it here: I am passing maxcpus=1 to the kdump kernel. My full kexec commandline is this:
/sbin/kexec--console-serial -p '--command-line=ro root=/dev/vg0/rawhide rhgbconsole=ttyS0,115200
ignore_loglevelirqpoll maxcpus=1reset_devicesearlyprintk=ttyS0,115200' --initrd=/boot/initrd-2.6.28-rc2kdump.img/boot/vmlinuz-2.6.28-rc2Quoted 6 lines
Additional info: I don't get the "I'm in purgatory" message on serial console, when the system hangs. I do get the message if I trigger the crash dump after unloading the kvm-intel module, so the serial console is working.
That means we are not even beginning to boot second kernel and are getting lost somewhere in the first kernel itself (most likely relocate_kernel_32/64.S).
Quoted 8 lines
And it could be because of any of the interesting restrictions put when vmx is enabled (As Avi mentioned in another mail.).
To debug that code, I used to put some "outb" messages to output a character to serial console and find out which instructions is creating trouble. You can debug to find out exactly what operation is not allowed when vmx is enabled or simply write the patches to disable vmx and it should automatically lead to problem resolution.
The transfer between kernels happens with virtual addresses identity mapped to physical addresses. For 32bit mode we implement this by disabling paging. Which apparently is one of the interesting restrictions placed of vmx.
Eric
Quoted 9 lines · Avi Kivity
Quoted 6 lines · Eric W. Biederman
Most of the reason I was wondering is that the cpu hardware probing largely seems to be a duplicate of what we have in the core for probing cpu capabilities already, and could likely be made smaller by building upon the existing codebase.
We use the core cpuid functions, or are you referring to something else?
I was referring to the arch/x86/kernel/cpu/*
and arch/x86/include/asm/cpufeature.h
The core functions that are responsible for detecting all of the cpu features, and disabling them if there are cpu errata.
The usual pattern is that code does all of the magic detection logic and then the code that would use it would just need to test: cpu_has_vmx or cpu_has_svm.
At least in part that allows us to show the working cpu features in /proc/cpuinfo.
Quoted 10 lines
Quoted 1 line
Quoted 1 line
svm can writeback into memory at odd times if we don't do this, and the cost
is
Quoted 6 lines
Quoted 2 lines
small - clear a bit in EFER. There's no reason to be lazy.
Especially if we can clear that bit unconditionally (when EFER is present) I'm all for it.
That is the case.
Cool. I forget if we have to test for EFER on 32bit, or if we can just wrmsr and be done with it. Regardless that sounds easy to do on the kexec path.
Eric
Quoted 11 lines · Eric W. Biederman
Quoted 8 lines
Quoted 1 line
Quoted 1 line
svm can writeback into memory at odd times if we don't do this, and the cost
is
Quoted 5 lines
Quoted 2 lines
small - clear a bit in EFER. There's no reason to be lazy.
Especially if we can clear that bit unconditionally (when EFER is present) I'm all for it.
That is the case.
Cool. I forget if we have to test for EFER on 32bit, or if we can just wrmsr and be done with it. Regardless that sounds easy to do on the kexec path.
I'm pretty sure you have to test for it first; pre-64 bit x86 hardware doesn't have the EFER register, so you'll fault on access. On the other hand pre-64 bit x86 hardware doesn't usually (ever?) have VT extensions either.
Signature · 1 line
Chris Lalancette
Quoted 4 lines · Chris Lalancette
I'm pretty sure you have to test for it first; pre-64 bit x86 hardware doesn't have the EFER register, so you'll fault on access. On the other hand pre-64 bit x86 hardware doesn't usually (ever?) have VT extensions either.
All amd hardware that supports svm has an efer. Some Intel hardware doesn't, but we don't care in that case.
Signature · 8 lines
I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain. _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Quoted 15 lines · Eric W. Biederman
Quoted 11 lines · Avi Kivity
Quoted 7 lines · Eric W. Biederman
Most of the reason I was wondering is that the cpu hardware probing largely seems to be a duplicate of what we have in the core for probing cpu capabilities already, and could likely be made smaller by building upon the existing codebase.
We use the core cpuid functions, or are you referring to something else?
Quoted 10 lines
I was referring to the
arch/x86/kernel/cpu/*
andarch/x86/include/asm/cpufeature.hThe core functions that are responsible for detecting all of the cpu features, and disabling them if there are cpu errata.
The usual pattern is that code does all of the magic detection logic and then the code that would use it would just need to test:
cpu_has_vmxorcpu_has_svm.
vmx is much more complicated than that, with some features define in read-only msrs.
Quoted 3 lines
At least in part that allows us to show the working cpu features in
/proc/cpuinfo.
Yes that's a problem now; you can only tell if you have vmx or not, without any information as to the various vmx subfeatures.
Quoted 3 lines
Cool. I forget if we have to test for EFER on 32bit, or if we can just wrmsr and be done with it. Regardless that sounds easy to do on the kexec path.
if (cpu_has_svm())
disable_svme();
Signature · 8 lines
I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain. _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec