All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: Andrew Morton <akpm@osdl.org>,
	kvm@vger.kernel.org, kexec@lists.infradead.org,
	Haren Myneni <hbabu@us.ibm.com>,
	Simon Horman <horms@verge.net.au>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Vivek Goyal <vgoyal@redhat.com>
Subject: Re: [PATCH 0/2] kvm: disable virtualization on kdump
Date: Sun, 26 Oct 2008 19:39:27 -0200	[thread overview]
Message-ID: <20081026213927.GF23893@blackpad> (raw)
In-Reply-To: <490487C1.1010707@redhat.com>

On Sun, Oct 26, 2008 at 05:07:45PM +0200, Avi Kivity wrote:
> Eric W. Biederman wrote:
<snip>
>>>> 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.
>>   
>
> 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.


>
>> 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.

Good point. My problem was a hang when booting the kdump kernel, but it
may also cause problems later, when the kdump kernel reboots.

-- 
Eduardo

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

WARNING: multiple messages have this Message-ID (diff)
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>,
	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: Re: [PATCH 0/2] kvm: disable virtualization on kdump
Date: Sun, 26 Oct 2008 19:39:27 -0200	[thread overview]
Message-ID: <20081026213927.GF23893@blackpad> (raw)
In-Reply-To: <490487C1.1010707-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

On Sun, Oct 26, 2008 at 05:07:45PM +0200, Avi Kivity wrote:
> Eric W. Biederman wrote:
<snip>
>>>> 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.
>>   
>
> 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.


>
>> 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.

Good point. My problem was a hang when booting the kdump kernel, but it
may also cause problems later, when the kdump kernel reboots.

-- 
Eduardo

  reply	other threads:[~2008-10-26 21:39 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-20 15:01 [PATCH 0/2] kvm: disable virtualization on kdump Eduardo Habkost
2008-10-20 15:01 ` Eduardo Habkost
2008-10-20 15:01 ` [PATCH 1/2] kdump: crash-time CPU halt notifier interface Eduardo Habkost
2008-10-20 15:01   ` Eduardo Habkost
2008-10-20 15:01 ` [PATCH 2/2] kvm: disable virtualization when halting CPUs on crash Eduardo Habkost
2008-10-20 15:01   ` Eduardo Habkost
2008-10-22 23:28 ` [PATCH 0/2] kvm: disable virtualization on kdump Simon Horman
2008-10-22 23:28   ` Simon Horman
2008-10-23 19:41   ` Eduardo Habkost
2008-10-23 19:41     ` Eduardo Habkost
2008-10-23 22:29     ` Simon Horman
2008-10-23 22:29       ` Simon Horman
2008-10-24  1:00       ` Eric W. Biederman
2008-10-24  1:00         ` Eric W. Biederman
2008-10-26 12:49         ` Avi Kivity
2008-10-26 12:49           ` Avi Kivity
2008-10-26 14:46           ` Eric W. Biederman
2008-10-26 14:46             ` Eric W. Biederman
2008-10-26 15:07             ` Avi Kivity
2008-10-26 15:07               ` Avi Kivity
2008-10-26 21:39               ` Eduardo Habkost [this message]
2008-10-26 21:39                 ` Eduardo Habkost
2008-10-27  2:08                 ` Eric W. Biederman
2008-10-27  2:08                   ` Eric W. Biederman
2008-10-27  9:13                   ` Avi Kivity
2008-10-27  9:13                     ` Avi Kivity
2008-10-27 12:28                     ` Eduardo Habkost
2008-10-27 12:28                       ` Eduardo Habkost
2008-10-27 14:02                       ` Avi Kivity
2008-10-27 14:02                         ` Avi Kivity
2008-10-27 17:32                         ` Eric W. Biederman
2008-10-27 17:32                           ` Eric W. Biederman
2008-10-28 19:45                           ` Eduardo Habkost
2008-10-28 19:45                             ` Eduardo Habkost
2008-10-28 20:13                             ` Eric W. Biederman
2008-10-28 20:13                               ` Eric W. Biederman
2008-10-29  9:41                               ` Avi Kivity
2008-10-29  9:41                                 ` Avi Kivity
2008-10-29 14:54                                 ` Eric W. Biederman
2008-10-29 14:54                                   ` Eric W. Biederman
2008-10-29 17:03                                   ` Avi Kivity
2008-10-29 17:03                                     ` Avi Kivity
2008-10-30  1:33                                     ` Eric W. Biederman
2008-10-30  1:33                                       ` Eric W. Biederman
2008-10-30  7:35                                       ` Chris Lalancette
2008-10-30  7:35                                         ` Chris Lalancette
2008-10-30  7:43                                         ` Avi Kivity
2008-10-30  7:43                                           ` Avi Kivity
2008-10-30  7:52                                       ` Avi Kivity
2008-10-30  7:52                                         ` Avi Kivity
2008-10-29  9:31                             ` Avi Kivity
2008-10-29  9:31                               ` Avi Kivity
2008-10-27 15:05                     ` Eric W. Biederman
2008-10-27 15:05                       ` Eric W. Biederman
2008-10-27 15:50                       ` Eduardo Habkost
2008-10-27 15:50                         ` Eduardo Habkost
2008-10-27  8:54                 ` Avi Kivity
2008-10-27  8:54                   ` Avi Kivity
2008-10-27 13:09                   ` Vivek Goyal
2008-10-27 13:09                     ` Vivek Goyal
2008-10-27 14:04                     ` Avi Kivity
2008-10-27 14:04                       ` Avi Kivity
2008-10-29 20:10                     ` Eduardo Habkost
2008-10-29 20:10                       ` Eduardo Habkost
2008-10-29 20:29                       ` Avi Kivity
2008-10-29 20:29                         ` Avi Kivity
2008-10-29 21:05                       ` Vivek Goyal
2008-10-29 21:05                         ` Vivek Goyal
2008-10-30  0:58                         ` Eric W. Biederman
2008-10-30  0:58                           ` Eric W. Biederman
2008-10-26 21:47               ` Eric W. Biederman
2008-10-26 21:47                 ` Eric W. Biederman
2008-10-27  8:59                 ` Avi Kivity
2008-10-27  8:59                   ` Avi Kivity
2008-10-27 15:02                   ` Eric W. Biederman
2008-10-27 15:02                     ` Eric W. Biederman
2008-10-27 15:38                     ` Eduardo Habkost
2008-10-27 15:38                       ` Eduardo Habkost
2008-10-26 12:46     ` Avi Kivity
2008-10-26 12:46       ` 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=20081026213927.GF23893@blackpad \
    --to=ehabkost@redhat.com \
    --cc=akpm@osdl.org \
    --cc=avi@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=hbabu@us.ibm.com \
    --cc=horms@verge.net.au \
    --cc=kexec@lists.infradead.org \
    --cc=kvm@vger.kernel.org \
    --cc=vgoyal@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.