Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-19 Thread David Woodhouse
On Mon, 2013-02-18 at 23:08 +, David Woodhouse wrote: Laszlo has hooked up the RCR on the PIIX3 already, so something like this ought to make it reset the PAM setup *only* if reset via that... +static void i440fx_reset(DeviceState *ds) +{ +PCIDevice *dev = DO_UPCAST(PCIDevice, qdev,

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-19 Thread David Woodhouse
On Mon, 2013-02-18 at 17:37 -0500, Kevin O'Connor wrote: The ACPI v2 spec describes a hard reset register. SeaBIOS could extract it from the FADT and then use it. Of course, we'd probably want to update the QEMU ACPI tables to implement ACPI v2 then. This sounded great until I actually came

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-19 Thread Laszlo Ersek
On 02/19/13 16:29, David Woodhouse wrote: On Mon, 2013-02-18 at 17:37 -0500, Kevin O'Connor wrote: The ACPI v2 spec describes a hard reset register. SeaBIOS could extract it from the FADT and then use it. Of course, we'd probably want to update the QEMU ACPI tables to implement ACPI v2 then.

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-19 Thread Gleb Natapov
On Mon, Feb 18, 2013 at 02:33:23PM -0500, Kevin O'Connor wrote: On Mon, Feb 18, 2013 at 09:17:05PM +0200, Gleb Natapov wrote: On Mon, Feb 18, 2013 at 02:00:52PM -0500, Kevin O'Connor wrote: Why not fix KVM so that it runs at fff0 after reset? Because KVM uses VMX extension and VMX

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-19 Thread David Woodhouse
On Tue, 2013-02-19 at 20:13 +0200, Gleb Natapov wrote: I take it you mean copy 0xfffe to 0xe? That would not be fun. SeaBIOS would need to detect that it's in the state (it's definitely not correct to do that on real-hardware or on working kvm instances), then setup a

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-19 Thread Gleb Natapov
On Tue, Feb 19, 2013 at 06:35:03PM +, David Woodhouse wrote: On Tue, 2013-02-19 at 20:13 +0200, Gleb Natapov wrote: I take it you mean copy 0xfffe to 0xe? That would not be fun. SeaBIOS would need to detect that it's in the state (it's definitely not correct to do that

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-19 Thread David Woodhouse
On Tue, 2013-02-19 at 20:41 +0200, Gleb Natapov wrote: Ah, yes of course. So does CSM takes the whole 0xe-0xf segment or it leaves OVMF code there somewhere. CSM reset code can jump into OVMF code in 0xe-0xf range and let it do the copy. There is no OVMF code there; OVMF

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-19 Thread Gleb Natapov
On Tue, Feb 19, 2013 at 06:48:41PM +, David Woodhouse wrote: On Tue, 2013-02-19 at 20:41 +0200, Gleb Natapov wrote: Ah, yes of course. So does CSM takes the whole 0xe-0xf segment or it leaves OVMF code there somewhere. CSM reset code can jump into OVMF code in 0xe-0xf

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-19 Thread David Woodhouse
On Tue, 2013-02-19 at 21:01 +0200, Gleb Natapov wrote: On Tue, Feb 19, 2013 at 06:48:41PM +, David Woodhouse wrote: On Tue, 2013-02-19 at 20:41 +0200, Gleb Natapov wrote: Ah, yes of course. So does CSM takes the whole 0xe-0xf segment or it leaves OVMF code there somewhere. CSM

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-19 Thread Paolo Bonzini
Il 19/02/2013 20:39, David Woodhouse ha scritto: We'd need to fix SeaBIOS to use the 0xcf9 reset too; currently it'll sit in an endless loop of keyboard-induced *soft* resets anyway, because it tries that before 0xcf9. And in fact it probably shouldn't use the hard-coded 0xcf9 reset; it

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-19 Thread David Woodhouse
On Tue, 2013-02-19 at 21:49 +0100, Paolo Bonzini wrote: And in fact it probably shouldn't use the hard-coded 0xcf9 reset; it should use the one indicated by the ACPI RESET_REG field (which *is* 0xcf9... or should be). We should implement this: http://mjg59.dreamwidth.org/3561.html

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-19 Thread Peter Stuge
David Woodhouse wrote: is it just that all PC BIOSes are written by crack-smoking hobos that they drag in off the street, and this is just an artefact of the rule anything they *can* get wrong and still boot Windows, they *will* get wrong? I wouldn't be surprised. //Peter

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-18 Thread Kevin O'Connor
On Mon, Feb 18, 2013 at 08:31:01PM +0200, Gleb Natapov wrote: Laszlo explained to me that the problem is that after reset we end up in SeaBIOS reset code instead of OVMF one. This is because kvm starts to execute from 0 instead of fff0 after reset and this memory location is modifying

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-18 Thread David Woodhouse
On Mon, 2013-02-18 at 14:00 -0500, Kevin O'Connor wrote: On Mon, Feb 18, 2013 at 08:31:01PM +0200, Gleb Natapov wrote: Laszlo explained to me that the problem is that after reset we end up in SeaBIOS reset code instead of OVMF one. This is because kvm starts to execute from 0 instead of

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-18 Thread Laszlo Ersek
On 02/18/13 20:00, Kevin O'Connor wrote: On Mon, Feb 18, 2013 at 08:31:01PM +0200, Gleb Natapov wrote: Laszlo explained to me that the problem is that after reset we end up in SeaBIOS reset code instead of OVMF one. This is because kvm starts to execute from 0 instead of fff0 after

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-18 Thread Gleb Natapov
On Mon, Feb 18, 2013 at 02:00:52PM -0500, Kevin O'Connor wrote: On Mon, Feb 18, 2013 at 08:31:01PM +0200, Gleb Natapov wrote: Laszlo explained to me that the problem is that after reset we end up in SeaBIOS reset code instead of OVMF one. This is because kvm starts to execute from 0

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-18 Thread Kevin O'Connor
On Mon, Feb 18, 2013 at 09:17:05PM +0200, Gleb Natapov wrote: On Mon, Feb 18, 2013 at 02:00:52PM -0500, Kevin O'Connor wrote: Why not fix KVM so that it runs at fff0 after reset? Because KVM uses VMX extension and VMX on CPU without unrestricted guest is not capable of doing so. Recent

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-18 Thread Laszlo Ersek
On 02/18/13 20:09, Laszlo Ersek wrote: On 02/18/13 20:00, Kevin O'Connor wrote: On Mon, Feb 18, 2013 at 08:31:01PM +0200, Gleb Natapov wrote: Laszlo explained to me that the problem is that after reset we end up in SeaBIOS reset code instead of OVMF one. This is because kvm starts to execute

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-18 Thread Kevin O'Connor
On Mon, Feb 18, 2013 at 07:04:08PM +, David Woodhouse wrote: Well, what SeaBIOS already *does* is bash on the keyboard controller to cause a reset. Which *ought* to work too; I have a patch to at least fix *that*, by resetting the PAM setup in the i440. The thing to be aware of here is

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-18 Thread David Woodhouse
On Mon, 2013-02-18 at 14:11 -0500, Kevin O'Connor wrote: On Mon, Feb 18, 2013 at 07:04:08PM +, David Woodhouse wrote: Well, what SeaBIOS already *does* is bash on the keyboard controller to cause a reset. Which *ought* to work too; I have a patch to at least fix *that*, by resetting the

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-18 Thread Kevin O'Connor
On Mon, Feb 18, 2013 at 09:12:46PM +, David Woodhouse wrote: The i440fx data sheet (§3.0) appears to say that the default values are loaded on a *hard* reset, not a soft reset. And a reset invoked by the keyboard controller (as SeaBIOS does) is a *soft* reset. The only way to do a *hard*

Re: [SeaBIOS] [Qemu-devel] [edk2] (PAM stuff) reset doesn't work on OVMF + SeaBIOS CSM

2013-02-18 Thread David Woodhouse
On Mon, 2013-02-18 at 17:37 -0500, Kevin O'Connor wrote: On Mon, Feb 18, 2013 at 09:12:46PM +, David Woodhouse wrote: The i440fx data sheet (§3.0) appears to say that the default values are loaded on a *hard* reset, not a soft reset. And a reset invoked by the keyboard controller (as