qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Gonglei (Arei)" <arei.gonglei@huawei.com>,
	Hangaohuai <hangaohuai@huawei.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "mst@redhat.com" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v4] bugfix: vm halt when in reset looping
Date: Mon, 9 Jan 2017 13:07:51 +0100	[thread overview]
Message-ID: <fdf51620-656e-9da2-d2d7-40685e7c5d62@redhat.com> (raw)
In-Reply-To: <33183CC9F5247A488A2544077AF19020DA180CB2@DGGEMA505-MBX.china.huawei.com>



On 09/01/2017 10:08, Gonglei (Arei) wrote:
>>
>> From: Hangaohuai
>> Sent: Monday, December 19, 2016 2:04 PM
>> To: qemu-devel@nongnu.org
>> Cc: mst@redhat.com; pbonzini@redhat.com; Gonglei (Arei); Hangaohuai
>> Subject: [PATCH v4] bugfix: vm halt when in reset looping
>>
>> reset mc146818rtc device when RESET event happens.
>>
>> Fix the problem:
>>   1. Guest boot the second cpu, set CMOS_RESET_CODE 0x0a to protect
>> selfboot;
>>   2. VM being reset by others, hmp_system_reset;
>>   3. seabios resume check the CMOS_RESET_CODE, if 0x0a, jump to the BDA
>>      resume execution by jump via 40h:0067h;
>>   4. Guest halt;
>>
>> Signed-off-by: hangaohuai <hangaohuai@huawei.com>
>> ---
>>  hw/timer/mc146818rtc.c | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>
> 
> Reviewed-by: Gonglei <arei.gonglei@huawei.com>
> 
> Paolo, could you pls pick up this patch?

Yes, it's queued.  Maybe this week--sorry for the delay.

Paolo

> Thanks,
> -Gonglei
> 
>> diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
>> index da209d0..637f872 100644
>> --- a/hw/timer/mc146818rtc.c
>> +++ b/hw/timer/mc146818rtc.c
>> @@ -946,11 +946,23 @@ static Property mc146818rtc_properties[] = {
>>      DEFINE_PROP_END_OF_LIST(),
>>  };
>>
>> +static void rtc_resetdev(DeviceState *d)
>> +{
>> +    RTCState *s = MC146818_RTC(d);
>> +
>> +    /* Reason: VM do suspend self will set 0xfe
>> +     * Reset any values other than 0xfe(Guest suspend case) */
>> +    if (s->cmos_data[0x0f] != 0xfe) {
>> +        s->cmos_data[0x0f] = 0x00;
>> +    }
>> +}
>> +
>>  static void rtc_class_initfn(ObjectClass *klass, void *data)
>>  {
>>      DeviceClass *dc = DEVICE_CLASS(klass);
>>
>>      dc->realize = rtc_realizefn;
>> +    dc->reset = rtc_resetdev;
>>      dc->vmsd = &vmstate_rtc;
>>      dc->props = mc146818rtc_properties;
>>      /* Reason: needs to be wired up by rtc_init() */
>> --
>> 1.8.3.1
>>
> 

      reply	other threads:[~2017-01-09 12:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-19  6:03 [Qemu-devel] [PATCH v4] bugfix: vm halt when in reset looping hangaohuai
2017-01-09  9:08 ` Gonglei (Arei)
2017-01-09 12:07   ` Paolo Bonzini [this message]

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=fdf51620-656e-9da2-d2d7-40685e7c5d62@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=hangaohuai@huawei.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).