[SeaBIOS] [PATCH] Add pvevent device driver

2013-03-14 Thread Hu Tao
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 hu...@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


___
SeaBIOS mailing list
SeaBIOS@seabios.org
http://www.seabios.org/mailman/listinfo/seabios


Re: [SeaBIOS] [PATCH] Add pvevent device driver

2013-03-14 Thread Hu Tao
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 hu...@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 pn...@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.

___
SeaBIOS mailing list
SeaBIOS@seabios.org
http://www.seabios.org/mailman/listinfo/seabios


Re: [SeaBIOS] [PATCH] Add pvevent device driver

2013-03-14 Thread Gleb Natapov
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 hu...@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 pn...@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.

___
SeaBIOS mailing list
SeaBIOS@seabios.org
http://www.seabios.org/mailman/listinfo/seabios


Re: [SeaBIOS] [PATCH] Add pvevent device driver

2013-03-14 Thread Gleb Natapov
On Thu, Mar 14, 2013 at 10:08:09AM +, 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.

___
SeaBIOS mailing list
SeaBIOS@seabios.org
http://www.seabios.org/mailman/listinfo/seabios