qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Add pvevent device driver
@ 2013-03-14  8:48 Hu Tao
  2013-03-14  8:57 ` Gleb Natapov
  2013-03-14  9:15 ` [Qemu-devel] " Paolo Bonzini
  0 siblings, 2 replies; 8+ messages in thread
From: Hu Tao @ 2013-03-14  8:48 UTC (permalink / raw)
  To: qemu-devel, Daniel P. Berrange, KAMEZAWA Hiroyuki, Jan Kiszka,
	Gleb Natapov, Blue Swirl, Eric Blake, Andrew Jones,
	Marcelo Tosatti, Sasha Levin, Luiz Capitulino, Anthony Liguori,
	Markus Armbruster, Paolo Bonzini, Stefan Hajnoczi, Juan Quintela,
	Orit Wasserman, Kevin Wolf, Wen Congyang, Michael S. Tsirkin,
	Alexander Graf, Alex Williamson, Peter Maydell,
	Christian Borntraeger, seabios

pvevent device is used to notify host(qemu) when guest panic
happens.

ref: http://lists.nongnu.org/archive/html/qemu-devel/2013-03/msg02293.html

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
---
 src/acpi-dsdt-isa.dsl | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/src/acpi-dsdt-isa.dsl b/src/acpi-dsdt-isa.dsl
index 23761db..d083245 100644
--- a/src/acpi-dsdt-isa.dsl
+++ b/src/acpi-dsdt-isa.dsl
@@ -99,4 +99,34 @@ Scope(\_SB.PCI0.ISA) {
             IRQNoFlags() { 3 }
         })
     }
+
+    Device(PEVT) {
+        Name(_HID, "MSFT0001")
+        OperationRegion(PEOR, SystemIO, 0x0505, 0x01)
+        Field(PEOR, ByteAcc, NoLock, Preserve) {
+            PEPT,   8,
+        }
+
+        Method(_STA, 0, NotSerialized) {
+            Store(PEPT, Local0)
+            If (LEqual(Local0, Zero)) {
+                Return (0x00)
+            } Else {
+                Return (0x0F)
+            }
+        }
+
+        Method(RDPT, 0, NotSerialized) {
+            Store(PEPT, Local0)
+            Return (Local0)
+        }
+
+        Method(WRPT, 1, NotSerialized) {
+            Store(Arg0, PEPT)
+        }
+
+        Name(_CRS, ResourceTemplate() {
+            IO(Decode16, 0x0505, 0x0505, 0x01, 0x01)
+        })
+    }
 }
-- 
1.8.1.4

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

* Re: [Qemu-devel] [PATCH] Add pvevent device driver
  2013-03-14  8:48 [Qemu-devel] [PATCH] Add pvevent device driver Hu Tao
@ 2013-03-14  8:57 ` Gleb Natapov
  2013-03-14  9:33   ` Hu Tao
  2013-03-14 10:08   ` [Qemu-devel] [SeaBIOS] " David Woodhouse
  2013-03-14  9:15 ` [Qemu-devel] " Paolo Bonzini
  1 sibling, 2 replies; 8+ messages in thread
From: Gleb Natapov @ 2013-03-14  8:57 UTC (permalink / raw)
  To: Hu Tao
  Cc: Peter Maydell, Michael S. Tsirkin, Jan Kiszka, seabios,
	qemu-devel, Markus Armbruster, Blue Swirl, Orit Wasserman,
	Juan Quintela, Alexander Graf, Christian Borntraeger,
	Andrew Jones, Alex Williamson, Sasha Levin, Stefan Hajnoczi,
	Luiz Capitulino, KAMEZAWA Hiroyuki, Kevin Wolf, Anthony Liguori,
	Marcelo Tosatti, Paolo Bonzini

On Thu, Mar 14, 2013 at 04:48:47PM +0800, Hu Tao wrote:
> pvevent device is used to notify host(qemu) when guest panic
> happens.
> 
> ref: http://lists.nongnu.org/archive/html/qemu-devel/2013-03/msg02293.html
> 
> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
> ---
>  src/acpi-dsdt-isa.dsl | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
> 
> diff --git a/src/acpi-dsdt-isa.dsl b/src/acpi-dsdt-isa.dsl
> index 23761db..d083245 100644
> --- a/src/acpi-dsdt-isa.dsl
> +++ b/src/acpi-dsdt-isa.dsl
> @@ -99,4 +99,34 @@ Scope(\_SB.PCI0.ISA) {
>              IRQNoFlags() { 3 }
>          })
>      }
> +
> +    Device(PEVT) {
> +        Name(_HID, "MSFT0001")
We cannot use MSFT!

> +        OperationRegion(PEOR, SystemIO, 0x0505, 0x01)
IO port should be received form QEMU by fw_cfg and patched here at run time.

> +        Field(PEOR, ByteAcc, NoLock, Preserve) {
> +            PEPT,   8,
> +        }
> +
> +        Method(_STA, 0, NotSerialized) {
> +            Store(PEPT, Local0)
> +            If (LEqual(Local0, Zero)) {
> +                Return (0x00)
> +            } Else {
> +                Return (0x0F)
> +            }
> +        }
No probing. If QEMU does not provide IO port function should be patched
to return zero.

> +
> +        Method(RDPT, 0, NotSerialized) {
> +            Store(PEPT, Local0)
> +            Return (Local0)
> +        }
> +
> +        Method(WRPT, 1, NotSerialized) {
> +            Store(Arg0, PEPT)
> +        }
> +
> +        Name(_CRS, ResourceTemplate() {
> +            IO(Decode16, 0x0505, 0x0505, 0x01, 0x01)
> +        })
> +    }
>  }
> -- 
> 1.8.1.4

--
			Gleb.

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

* Re: [Qemu-devel] [PATCH] Add pvevent device driver
  2013-03-14  8:48 [Qemu-devel] [PATCH] Add pvevent device driver Hu Tao
  2013-03-14  8:57 ` Gleb Natapov
@ 2013-03-14  9:15 ` Paolo Bonzini
  2013-03-14  9:17   ` Gleb Natapov
  1 sibling, 1 reply; 8+ messages in thread
From: Paolo Bonzini @ 2013-03-14  9:15 UTC (permalink / raw)
  To: Hu Tao
  Cc: Peter Maydell, Gleb Natapov, Michael S. Tsirkin, Jan Kiszka,
	seabios, qemu-devel, Markus Armbruster, Blue Swirl,
	Orit Wasserman, Juan Quintela, Alexander Graf,
	Christian Borntraeger, Andrew Jones, Alex Williamson, Sasha Levin,
	Stefan Hajnoczi, Luiz Capitulino, KAMEZAWA Hiroyuki, Kevin Wolf,
	Anthony Liguori, Marcelo Tosatti

Il 14/03/2013 09:48, Hu Tao ha scritto:
> pvevent device is used to notify host(qemu) when guest panic
> happens.
> 
> ref: http://lists.nongnu.org/archive/html/qemu-devel/2013-03/msg02293.html
> 
> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
> ---
>  src/acpi-dsdt-isa.dsl | 30 ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
> 
> diff --git a/src/acpi-dsdt-isa.dsl b/src/acpi-dsdt-isa.dsl
> index 23761db..d083245 100644
> --- a/src/acpi-dsdt-isa.dsl
> +++ b/src/acpi-dsdt-isa.dsl
> @@ -99,4 +99,34 @@ Scope(\_SB.PCI0.ISA) {
>              IRQNoFlags() { 3 }
>          })
>      }
> +
> +    Device(PEVT) {
> +        Name(_HID, "MSFT0001")
> +        OperationRegion(PEOR, SystemIO, 0x0505, 0x01)
> +        Field(PEOR, ByteAcc, NoLock, Preserve) {
> +            PEPT,   8,
> +        }
> +
> +        Method(_STA, 0, NotSerialized) {
> +            Store(PEPT, Local0)
> +            If (LEqual(Local0, Zero)) {
> +                Return (0x00)
> +            } Else {
> +                Return (0x0F)
> +            }
> +        }
> +
> +        Method(RDPT, 0, NotSerialized) {
> +            Store(PEPT, Local0)
> +            Return (Local0)
> +        }
> +
> +        Method(WRPT, 1, NotSerialized) {
> +            Store(Arg0, PEPT)
> +        }
> +
> +        Name(_CRS, ResourceTemplate() {
> +            IO(Decode16, 0x0505, 0x0505, 0x01, 0x01)
> +        })
> +    }
>  }
> 

I like the idea of using methods in the DSDT to isolate from the actual
implementation of the device.  I don't see a huge problem with the
probing, but Gleb does so please go on with the fw_cfg part.

Paolo

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

* Re: [Qemu-devel] [PATCH] Add pvevent device driver
  2013-03-14  9:15 ` [Qemu-devel] " Paolo Bonzini
@ 2013-03-14  9:17   ` Gleb Natapov
  0 siblings, 0 replies; 8+ messages in thread
From: Gleb Natapov @ 2013-03-14  9:17 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Peter Maydell, Michael S. Tsirkin, Hu Tao, seabios, qemu-devel,
	Markus Armbruster, Blue Swirl, Orit Wasserman, Juan Quintela,
	Alexander Graf, Christian Borntraeger, Jan Kiszka, Andrew Jones,
	Alex Williamson, Sasha Levin, Stefan Hajnoczi, Luiz Capitulino,
	KAMEZAWA Hiroyuki, Kevin Wolf, Anthony Liguori, Marcelo Tosatti

On Thu, Mar 14, 2013 at 10:15:02AM +0100, Paolo Bonzini wrote:
> Il 14/03/2013 09:48, Hu Tao ha scritto:
> > pvevent device is used to notify host(qemu) when guest panic
> > happens.
> > 
> > ref: http://lists.nongnu.org/archive/html/qemu-devel/2013-03/msg02293.html
> > 
> > Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
> > ---
> >  src/acpi-dsdt-isa.dsl | 30 ++++++++++++++++++++++++++++++
> >  1 file changed, 30 insertions(+)
> > 
> > diff --git a/src/acpi-dsdt-isa.dsl b/src/acpi-dsdt-isa.dsl
> > index 23761db..d083245 100644
> > --- a/src/acpi-dsdt-isa.dsl
> > +++ b/src/acpi-dsdt-isa.dsl
> > @@ -99,4 +99,34 @@ Scope(\_SB.PCI0.ISA) {
> >              IRQNoFlags() { 3 }
> >          })
> >      }
> > +
> > +    Device(PEVT) {
> > +        Name(_HID, "MSFT0001")
> > +        OperationRegion(PEOR, SystemIO, 0x0505, 0x01)
> > +        Field(PEOR, ByteAcc, NoLock, Preserve) {
> > +            PEPT,   8,
> > +        }
> > +
> > +        Method(_STA, 0, NotSerialized) {
> > +            Store(PEPT, Local0)
> > +            If (LEqual(Local0, Zero)) {
> > +                Return (0x00)
> > +            } Else {
> > +                Return (0x0F)
> > +            }
> > +        }
> > +
> > +        Method(RDPT, 0, NotSerialized) {
> > +            Store(PEPT, Local0)
> > +            Return (Local0)
> > +        }
> > +
> > +        Method(WRPT, 1, NotSerialized) {
> > +            Store(Arg0, PEPT)
> > +        }
> > +
> > +        Name(_CRS, ResourceTemplate() {
> > +            IO(Decode16, 0x0505, 0x0505, 0x01, 0x01)
> > +        })
> > +    }
> >  }
> > 
> 
> I like the idea of using methods in the DSDT to isolate from the actual
> implementation of the device.  I don't see a huge problem with the
> probing, but Gleb does so please go on with the fw_cfg part.
> 
Using methods is very nice idea indeed.

--
			Gleb.

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

* Re: [Qemu-devel] [PATCH] Add pvevent device driver
  2013-03-14  8:57 ` Gleb Natapov
@ 2013-03-14  9:33   ` Hu Tao
  2013-03-14  9:37     ` Gleb Natapov
  2013-03-14 10:08   ` [Qemu-devel] [SeaBIOS] " David Woodhouse
  1 sibling, 1 reply; 8+ messages in thread
From: Hu Tao @ 2013-03-14  9:33 UTC (permalink / raw)
  To: Gleb Natapov
  Cc: Peter Maydell, Michael S. Tsirkin, Jan Kiszka, seabios,
	qemu-devel, Markus Armbruster, Blue Swirl, Orit Wasserman,
	Juan Quintela, Alexander Graf, Christian Borntraeger,
	Andrew Jones, Alex Williamson, Sasha Levin, Stefan Hajnoczi,
	Luiz Capitulino, KAMEZAWA Hiroyuki, Kevin Wolf, Anthony Liguori,
	Marcelo Tosatti, Paolo Bonzini

On Thu, Mar 14, 2013 at 10:57:18AM +0200, Gleb Natapov wrote:
> On Thu, Mar 14, 2013 at 04:48:47PM +0800, Hu Tao wrote:
> > pvevent device is used to notify host(qemu) when guest panic
> > happens.
> > 
> > ref: http://lists.nongnu.org/archive/html/qemu-devel/2013-03/msg02293.html
> > 
> > Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
> > ---
> >  src/acpi-dsdt-isa.dsl | 30 ++++++++++++++++++++++++++++++
> >  1 file changed, 30 insertions(+)
> > 
> > diff --git a/src/acpi-dsdt-isa.dsl b/src/acpi-dsdt-isa.dsl
> > index 23761db..d083245 100644
> > --- a/src/acpi-dsdt-isa.dsl
> > +++ b/src/acpi-dsdt-isa.dsl
> > @@ -99,4 +99,34 @@ Scope(\_SB.PCI0.ISA) {
> >              IRQNoFlags() { 3 }
> >          })
> >      }
> > +
> > +    Device(PEVT) {
> > +        Name(_HID, "MSFT0001")
> We cannot use MSFT!

OK, I see now, we have to use QEMU0001 or like. More question: if I
request ACPI ID: QEMU  from pnpid@microsoft.com, who should be CCed,
Anthony, qemu-list or any others?


> 
> > +        OperationRegion(PEOR, SystemIO, 0x0505, 0x01)
> IO port should be received form QEMU by fw_cfg and patched here at run time.

If I'm right, io port can be passed to seabios through fw_cfg file
interface, but I'm still figuring out how to patch DSDT here and below at
run time.  Maybe build_ssdt() is close to this.

> 
> > +        Field(PEOR, ByteAcc, NoLock, Preserve) {
> > +            PEPT,   8,
> > +        }
> > +
> > +        Method(_STA, 0, NotSerialized) {
> > +            Store(PEPT, Local0)
> > +            If (LEqual(Local0, Zero)) {
> > +                Return (0x00)
> > +            } Else {
> > +                Return (0x0F)
> > +            }
> > +        }
> No probing. If QEMU does not provide IO port function should be patched
> to return zero.
> 
> > +
> > +        Method(RDPT, 0, NotSerialized) {
> > +            Store(PEPT, Local0)
> > +            Return (Local0)
> > +        }
> > +
> > +        Method(WRPT, 1, NotSerialized) {
> > +            Store(Arg0, PEPT)
> > +        }
> > +
> > +        Name(_CRS, ResourceTemplate() {
> > +            IO(Decode16, 0x0505, 0x0505, 0x01, 0x01)
> > +        })
> > +    }
> >  }
> > -- 
> > 1.8.1.4
> 
> --
> 			Gleb.

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

* Re: [Qemu-devel] [PATCH] Add pvevent device driver
  2013-03-14  9:33   ` Hu Tao
@ 2013-03-14  9:37     ` Gleb Natapov
  0 siblings, 0 replies; 8+ messages in thread
From: Gleb Natapov @ 2013-03-14  9:37 UTC (permalink / raw)
  To: Hu Tao
  Cc: Peter Maydell, Michael S. Tsirkin, Jan Kiszka, seabios,
	qemu-devel, Markus Armbruster, Blue Swirl, Orit Wasserman,
	Juan Quintela, Alexander Graf, Christian Borntraeger,
	Andrew Jones, Alex Williamson, Sasha Levin, Stefan Hajnoczi,
	Luiz Capitulino, KAMEZAWA Hiroyuki, Kevin Wolf, Anthony Liguori,
	Marcelo Tosatti, Paolo Bonzini

On Thu, Mar 14, 2013 at 05:33:19PM +0800, Hu Tao wrote:
> On Thu, Mar 14, 2013 at 10:57:18AM +0200, Gleb Natapov wrote:
> > On Thu, Mar 14, 2013 at 04:48:47PM +0800, Hu Tao wrote:
> > > pvevent device is used to notify host(qemu) when guest panic
> > > happens.
> > > 
> > > ref: http://lists.nongnu.org/archive/html/qemu-devel/2013-03/msg02293.html
> > > 
> > > Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
> > > ---
> > >  src/acpi-dsdt-isa.dsl | 30 ++++++++++++++++++++++++++++++
> > >  1 file changed, 30 insertions(+)
> > > 
> > > diff --git a/src/acpi-dsdt-isa.dsl b/src/acpi-dsdt-isa.dsl
> > > index 23761db..d083245 100644
> > > --- a/src/acpi-dsdt-isa.dsl
> > > +++ b/src/acpi-dsdt-isa.dsl
> > > @@ -99,4 +99,34 @@ Scope(\_SB.PCI0.ISA) {
> > >              IRQNoFlags() { 3 }
> > >          })
> > >      }
> > > +
> > > +    Device(PEVT) {
> > > +        Name(_HID, "MSFT0001")
> > We cannot use MSFT!
> 
> OK, I see now, we have to use QEMU0001 or like. More question: if I
> request ACPI ID: QEMU  from pnpid@microsoft.com, who should be CCed,
> Anthony, qemu-list or any others?
> 
Cannot really answer that. I do not think mailing list should be
included. My be Anthony should request the ID on behalf of QEMU project.

> 
> > 
> > > +        OperationRegion(PEOR, SystemIO, 0x0505, 0x01)
> > IO port should be received form QEMU by fw_cfg and patched here at run time.
> 
> If I'm right, io port can be passed to seabios through fw_cfg file
> interface, but I'm still figuring out how to patch DSDT here and below at
> run time.  Maybe build_ssdt() is close to this.
> 
Yes, we already are doing similar things in build_ssdt().

--
			Gleb.

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

* Re: [Qemu-devel] [SeaBIOS] [PATCH] Add pvevent device driver
  2013-03-14  8:57 ` Gleb Natapov
  2013-03-14  9:33   ` Hu Tao
@ 2013-03-14 10:08   ` David Woodhouse
  2013-03-14 10:11     ` Gleb Natapov
  1 sibling, 1 reply; 8+ messages in thread
From: David Woodhouse @ 2013-03-14 10:08 UTC (permalink / raw)
  To: Gleb Natapov
  Cc: Peter Maydell, Michael S. Tsirkin, Hu Tao, seabios, qemu-devel,
	Alexander Graf, Blue Swirl, Orit Wasserman, Juan Quintela,
	Markus Armbruster, Christian Borntraeger, Jan Kiszka,
	Andrew Jones, Alex Williamson, Stefan Hajnoczi, Luiz Capitulino,
	KAMEZAWA Hiroyuki, Kevin Wolf, Anthony Liguori, Paolo Bonzini

[-- Attachment #1: Type: text/plain, Size: 272 bytes --]

On Thu, 2013-03-14 at 10:57 +0200, Gleb Natapov wrote:
> 
> > +        OperationRegion(PEOR, SystemIO, 0x0505, 0x01)
> IO port should be received form QEMU by fw_cfg and patched here at run
> time.

Pfft. ACPI table should be received from QEMU. :)


-- 
dwmw2

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 6171 bytes --]

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

* Re: [Qemu-devel] [SeaBIOS] [PATCH] Add pvevent device driver
  2013-03-14 10:08   ` [Qemu-devel] [SeaBIOS] " David Woodhouse
@ 2013-03-14 10:11     ` Gleb Natapov
  0 siblings, 0 replies; 8+ messages in thread
From: Gleb Natapov @ 2013-03-14 10:11 UTC (permalink / raw)
  To: David Woodhouse
  Cc: Peter Maydell, Michael S. Tsirkin, Hu Tao, seabios, qemu-devel,
	Alexander Graf, Blue Swirl, Orit Wasserman, Juan Quintela,
	Markus Armbruster, Christian Borntraeger, Jan Kiszka,
	Andrew Jones, Alex Williamson, Stefan Hajnoczi, Luiz Capitulino,
	KAMEZAWA Hiroyuki, Kevin Wolf, Anthony Liguori, Paolo Bonzini

On Thu, Mar 14, 2013 at 10:08:09AM +0000, David Woodhouse wrote:
> On Thu, 2013-03-14 at 10:57 +0200, Gleb Natapov wrote:
> > 
> > > +        OperationRegion(PEOR, SystemIO, 0x0505, 0x01)
> > IO port should be received form QEMU by fw_cfg and patched here at run
> > time.
> 
> Pfft. ACPI table should be received from QEMU. :)
> 
That's the feature that, as far as I understand, everyone agreed upon,
but since we want to apply these patches before that feature is here we
will have to do it old fashioned way for now.

--
			Gleb.

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

end of thread, other threads:[~2013-03-14 10:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-14  8:48 [Qemu-devel] [PATCH] Add pvevent device driver Hu Tao
2013-03-14  8:57 ` Gleb Natapov
2013-03-14  9:33   ` Hu Tao
2013-03-14  9:37     ` Gleb Natapov
2013-03-14 10:08   ` [Qemu-devel] [SeaBIOS] " David Woodhouse
2013-03-14 10:11     ` Gleb Natapov
2013-03-14  9:15 ` [Qemu-devel] " Paolo Bonzini
2013-03-14  9:17   ` 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).