public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Glauber Costa <gcosta@redhat.com>
To: Avi Kivity <avi@qumranet.com>
Cc: kvm-devel@lists.sourceforge.net
Subject: Re: [PATCH] disable clock before rebooting.
Date: Fri, 07 Mar 2008 11:23:34 -0300	[thread overview]
Message-ID: <47D14FE6.1000300@redhat.com> (raw)
In-Reply-To: <47D107CE.1040601@qumranet.com>

Avi Kivity wrote:
> Glauber Costa wrote:
>> This patch writes 0 (actually, what really matters is that the
>> LSB is cleared) to the system time msr before rebooting/shutting down
>> the machine.
>>
>> Without it, we can have a random memory location being written
>> when the guest comes back
>>      if (!kvm_para_available())
>> @@ -154,6 +181,11 @@ void __init kvmclock_init(void)
>>          pv_time_ops.set_wallclock = kvm_set_wallclock;
>>          pv_time_ops.sched_clock = kvm_clock_read;
>>          pv_apic_ops.setup_secondary_clock = kvm_setup_secondary_clock;
>> +        machine_ops.emergency_restart = kvm_emergency_restart;
>> +        machine_ops.shutdown  = kvm_shutdown;
>> +        machine_ops.restart  = kvm_restart;
>> +        machine_ops.halt  = kvm_halt;
>> +        machine_ops.power_off  = kvm_power_off;
>>          clocksource_register(&kvm_clock);
>>      }
>>  }
>>   
> 
> Oh, I think that these are all unnecessary.  You need to stop the clock 
> only if the memory it uses will be reused.  Halt, shutdown and poweroff 
> clearly don't.  Resets need to go through the host anyway, since they 
> can be invoked without the guest knowing about it.

power off, agreed.
halt, it doesn't really do anything anyway in reboot.c, and is here just 
for "future completeness".

> The only case I can think of where we need to stop the clock is kexec.
> 
as for kexec, it uses precisely the shutdown function, doesn't it?

Or is it crash_shutdown?
Humm, /me looks, and I think it's the later, right?

If this is true and resets goes through the host, then we don't even 
need the header exports. Ingo'll be happy.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

  reply	other threads:[~2008-03-07 14:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-06 16:14 [PATCH] disable clock before rebooting Glauber Costa
2008-03-07  9:10 ` Avi Kivity
2008-03-07 14:04   ` Glauber Costa
2008-03-07 15:55     ` Avi Kivity
2008-03-07  9:15 ` Avi Kivity
2008-03-07 14:23   ` Glauber Costa [this message]
2008-03-07 16:07     ` Avi Kivity
2008-03-07 16:10       ` Glauber Costa

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=47D14FE6.1000300@redhat.com \
    --to=gcosta@redhat.com \
    --cc=avi@qumranet.com \
    --cc=kvm-devel@lists.sourceforge.net \
    /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