qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [edk2] [RFC PATCH] Distinguish between reset types


From: David Woodhouse
Subject: Re: [Qemu-devel] [edk2] [RFC PATCH] Distinguish between reset types
Date: Thu, 21 Feb 2013 09:04:34 +0000

On Thu, 2013-02-21 at 09:36 +0100, Paolo Bonzini wrote:
> Il 21/02/2013 02:10, Laszlo Ersek ha scritto:
> > OTOH if the keyboard reset gets soft in qemu, then OVMF's hard reset
> > (the above code) will break. Maybe I could cycle between 0xCF9 and 0x64
> > in ResetCold(), starting with 0xCF9.
> 
> Yes, that's the right thing to do.
> 
> Also, in QEMU you're doing:
> 
>     if (val & 4) {
>         qemu_system_reset_request();
>         return;
>     }
>     d->rcr = val & 2; /* keep System Reset type only */
> 
> It looks like d->rcr should be set first to match what hardware does
> (writing 0x6 causes a cold reset, and that's what you usually find in
> the ACPI tables).

What Laszlo implemented (above) is fairly much as the data sheet
describes it. You're supposed to write 0x02 to set the reset type, and
*then* write 0x06 to actually trigger the reset.

However, in practice on real hardware that isn't necessary. Just writing
0x06 once will do the trick. Which is just as well, because otherwise
the ACPI RESET_REG wouldn't be able to represent it; that only describes
*one* write, not two.

So yes, you're right. Once qemu starts to distinguish properly between
hard and soft reset, it should honour the value of bit 1 in the write
which actually triggers the reset. Anthony's patch set did that.. albeit
backwards, doing hard and soft reset the wrong way round.

-- 
dwmw2

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]