qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] reset PMBA and PMREGMISC PIIX4 registers.
@ 2012-08-07 12:52 Gleb Natapov
  2012-08-07 13:03 ` Laszlo Ersek
  2012-08-15 16:48 ` Gleb Natapov
  0 siblings, 2 replies; 3+ messages in thread
From: Gleb Natapov @ 2012-08-07 12:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: lersek

The bug causes Windows + OVMF hang after reboot since OVMF
checks PMREGMISC to see if IO space is enabled and skip
configuration if it is. 

Signed-off-by: Gleb Natapov <gleb@redhat.com>
diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
index 0aace60..90b46b5 100644
--- a/hw/acpi_piix4.c
+++ b/hw/acpi_piix4.c
@@ -353,6 +353,9 @@ static void piix4_reset(void *opaque)
     pci_conf[0x5a] = 0;
     pci_conf[0x5b] = 0;
 
+    pci_conf[0x40] = 0x01; /* PM io base read only bit */
+    pci_conf[0x80] = 0;
+
     if (s->kvm_enabled) {
         /* Mark SMM as already inited (until KVM supports SMM). */
         pci_conf[0x5B] = 0x02;
@@ -392,8 +395,6 @@ static int piix4_pm_initfn(PCIDevice *dev)
     pci_conf[0x09] = 0x00;
     pci_conf[0x3d] = 0x01; // interrupt pin 1
 
-    pci_conf[0x40] = 0x01; /* PM io base read only bit */
-
     /* APM */
     apm_init(&s->apm, apm_ctrl_changed, s);
 
--
			Gleb.

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] reset PMBA and PMREGMISC PIIX4 registers.
  2012-08-07 12:52 [Qemu-devel] [PATCH] reset PMBA and PMREGMISC PIIX4 registers Gleb Natapov
@ 2012-08-07 13:03 ` Laszlo Ersek
  2012-08-15 16:48 ` Gleb Natapov
  1 sibling, 0 replies; 3+ messages in thread
From: Laszlo Ersek @ 2012-08-07 13:03 UTC (permalink / raw)
  To: Gleb Natapov; +Cc: qemu-devel

On 08/07/12 14:52, Gleb Natapov wrote:
> The bug causes Windows + OVMF hang after reboot since OVMF
> checks PMREGMISC to see if IO space is enabled and skip
> configuration if it is. 
> 
> Signed-off-by: Gleb Natapov <gleb@redhat.com>
> diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
> index 0aace60..90b46b5 100644
> --- a/hw/acpi_piix4.c
> +++ b/hw/acpi_piix4.c
> @@ -353,6 +353,9 @@ static void piix4_reset(void *opaque)
>      pci_conf[0x5a] = 0;
>      pci_conf[0x5b] = 0;
>  
> +    pci_conf[0x40] = 0x01; /* PM io base read only bit */
> +    pci_conf[0x80] = 0;
> +
>      if (s->kvm_enabled) {
>          /* Mark SMM as already inited (until KVM supports SMM). */
>          pci_conf[0x5B] = 0x02;
> @@ -392,8 +395,6 @@ static int piix4_pm_initfn(PCIDevice *dev)
>      pci_conf[0x09] = 0x00;
>      pci_conf[0x3d] = 0x01; // interrupt pin 1
>  
> -    pci_conf[0x40] = 0x01; /* PM io base read only bit */
> -
>      /* APM */
>      apm_init(&s->apm, apm_ctrl_changed, s);
>  
> --
> 			Gleb.

Unless I'm missing something, the patch keeps the "PM io base read only
bit" set-up correctly the first time around too, since

piix4_pm_initfn()
  qemu_register_reset(piix4_reset, ...);

main()
  qemu_system_reset()

FWIW,

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

Thanks!
Laszlo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] reset PMBA and PMREGMISC PIIX4 registers.
  2012-08-07 12:52 [Qemu-devel] [PATCH] reset PMBA and PMREGMISC PIIX4 registers Gleb Natapov
  2012-08-07 13:03 ` Laszlo Ersek
@ 2012-08-15 16:48 ` Gleb Natapov
  1 sibling, 0 replies; 3+ messages in thread
From: Gleb Natapov @ 2012-08-15 16:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: lersek, Anthony Liguori

Ping.

On Tue, Aug 07, 2012 at 03:52:03PM +0300, Gleb Natapov wrote:
> The bug causes Windows + OVMF hang after reboot since OVMF
> checks PMREGMISC to see if IO space is enabled and skip
> configuration if it is. 
> 
> Signed-off-by: Gleb Natapov <gleb@redhat.com>
> diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
> index 0aace60..90b46b5 100644
> --- a/hw/acpi_piix4.c
> +++ b/hw/acpi_piix4.c
> @@ -353,6 +353,9 @@ static void piix4_reset(void *opaque)
>      pci_conf[0x5a] = 0;
>      pci_conf[0x5b] = 0;
>  
> +    pci_conf[0x40] = 0x01; /* PM io base read only bit */
> +    pci_conf[0x80] = 0;
> +
>      if (s->kvm_enabled) {
>          /* Mark SMM as already inited (until KVM supports SMM). */
>          pci_conf[0x5B] = 0x02;
> @@ -392,8 +395,6 @@ static int piix4_pm_initfn(PCIDevice *dev)
>      pci_conf[0x09] = 0x00;
>      pci_conf[0x3d] = 0x01; // interrupt pin 1
>  
> -    pci_conf[0x40] = 0x01; /* PM io base read only bit */
> -
>      /* APM */
>      apm_init(&s->apm, apm_ctrl_changed, s);
>  
> --
> 			Gleb.

--
			Gleb.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-15 16:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-07 12:52 [Qemu-devel] [PATCH] reset PMBA and PMREGMISC PIIX4 registers Gleb Natapov
2012-08-07 13:03 ` Laszlo Ersek
2012-08-15 16:48 ` Gleb Natapov

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