From: Eduardo Habkost <ehabkost-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Avi Kivity <avi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Andrew Morton <akpm-3NddpPZAyC0@public.gmane.org>,
Eduardo Habkost
<ehabkost-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Haren Myneni <hbabu-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>,
Simon Horman <horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>,
"Eric W. Biederman"
<ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>,
Vivek Goyal <vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH 6/6] kvm: x86: set kdump virt_disable function on initialization
Date: Thu, 30 Oct 2008 11:34:46 -0200 [thread overview]
Message-ID: <1225373687-6960-7-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1225373687-6960-1-git-send-email-ehabkost-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
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 <ehabkost-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
arch/x86/kvm/x86.c | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index ff895e2..4f7a221 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -40,6 +40,7 @@
#include <asm/msr.h>
#include <asm/desc.h>
#include <asm/mtrr.h>
+#include <asm/virtext.h>
#define MAX_IO_MSRS 256
#define CR0_RESERVED_BITS \
@@ -2581,6 +2582,13 @@ int kvm_emulate_pio_string(struct kvm_vcpu *vcpu, struct kvm_run *run, int in,
}
EXPORT_SYMBOL_GPL(kvm_emulate_pio_string);
+/* Called at crash time, so we can disable virtualization if needed
+ */
+static void crash_hardware_disable(unsigned int cpu)
+{
+ kvm_x86_ops->crash_hardware_disable(NULL);
+}
+
int kvm_arch_init(void *opaque)
{
int r;
@@ -2605,9 +2613,15 @@ int kvm_arch_init(void *opaque)
kvm_x86_ops = ops;
+ r = set_virt_disable_func(crash_hardware_disable);
+ if (r) {
+ printk(KERN_ERR "kvm: virt_disable function already set?\n");
+ goto out_clear_ops;
+ }
+
r = kvm_mmu_module_init();
if (r)
- goto out_clear_ops;
+ goto out_clear_crash;
kvm_init_msr_list();
@@ -2617,6 +2631,8 @@ int kvm_arch_init(void *opaque)
PT_DIRTY_MASK, PT64_NX_MASK, 0, 0);
return 0;
+out_clear_crash:
+ clear_virt_disable_func();
out_clear_ops:
kvm_x86_ops = NULL;
out:
@@ -2625,6 +2641,7 @@ out:
void kvm_arch_exit(void)
{
+ clear_virt_disable_func();
kvm_x86_ops = NULL;
kvm_mmu_module_exit();
}
--
1.5.5.GIT
next prev parent reply other threads:[~2008-10-30 13:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-30 13:34 [PATCH 0/6] kdump: disable virtualization extensions on crash (v2) Eduardo Habkost
[not found] ` <1225373687-6960-1-git-send-email-ehabkost-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2008-10-30 13:34 ` [PATCH 1/6] kdump: crash-time virt disable function Eduardo Habkost
[not found] ` <1225373687-6960-2-git-send-email-ehabkost-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2008-10-30 13:50 ` Avi Kivity
[not found] ` <4909BBA7.1020307-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2008-10-30 16:24 ` Eduardo Habkost
2008-10-30 13:34 ` [PATCH 2/6] kvm_x86_ops: crash_hardware_disable() operation Eduardo Habkost
2008-10-30 13:34 ` [PATCH 3/6] kvm: svm: set crash_hardware_disable to svm_hardware_disable Eduardo Habkost
2008-10-30 13:34 ` [PATCH 4/6] kvm: vmx: crash_hardware_disable function Eduardo Habkost
2008-10-30 13:34 ` [PATCH 5/6] kvmx: x86: set kvm_x86_ops earlier on kvm_arch_init() Eduardo Habkost
2008-10-30 13:34 ` Eduardo Habkost [this message]
2008-10-30 13:52 ` [PATCH 0/6] kdump: disable virtualization extensions on crash (v2) Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1225373687-6960-7-git-send-email-ehabkost@redhat.com \
--to=ehabkost-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=akpm-3NddpPZAyC0@public.gmane.org \
--cc=avi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
--cc=hbabu-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
--cc=horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org \
--cc=kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox