hvmloader: Add an ACPI device exposing a package called ADDR,
authorPaul Durrant <paul.durrant@citrix.com>
Wed, 30 Nov 2011 14:47:16 +0000 (06:47 -0800)
committerPaul Durrant <paul.durrant@citrix.com>
Wed, 30 Nov 2011 14:47:16 +0000 (06:47 -0800)
evaluating to two integers, and with _CID and _DDN set to
"VM_Gen_Counter".

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
tools/firmware/hvmloader/acpi/build.c
tools/firmware/hvmloader/acpi/dsdt.asl

index 837e3442eac4183ef44812d96f4c8d557ded9a13..306d1105b8dae6a06205f2caa6702603c092e035 100644 (file)
@@ -47,6 +47,7 @@ struct acpi_info {
     uint32_t pci_min, pci_len;  /* 4, 8 - PCI I/O hole boundaries */
     uint32_t madt_csum_addr;    /* 12   - Address of MADT checksum */
     uint32_t madt_lapic0_addr;  /* 16   - Address of first MADT LAPIC struct */
+    uint32_t vm_gid_addr;       /* 20   - Address of VM generation id buffer */
 };
 
 /* Number of processor objects in the chosen DSDT. */
index d8a67b35f9461d5de163e16939a8ae15a90d1707..ca64feca610e04575efea91929ff33ad112670fb 100644 (file)
@@ -55,7 +55,8 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
            PMIN, 32,
            PLEN, 32,
            MSUA, 32, /* MADT checksum address */
-           MAPA, 32  /* MADT LAPIC0 address */
+           MAPA, 32, /* MADT LAPIC0 address */
+           VGIA, 32  /* VM generation id address */
        }
 
         /* Fix HCT test for 0x400 pci memory:
@@ -396,6 +397,31 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
                         IRQNoFlags () {7}
                     })
                 } 
+
+                Device(VGID) {
+                    Name(_HID, EisaID ("PNP0A06"))
+                    Name(_UID, 0x00)
+                    Name(_CID, "VM_Gen_Counter")
+                    Name(_DDN, "VM_Gen_Counter")
+                    Method(_STA, 0, NotSerialized)
+                    {
+                        If(LEqual(\_SB.VGIA, 0x00000000)) {
+                            Return(0x00)
+                        } Else {
+                            Return(0x0F)
+                        }
+                    }
+                    Name(PKG, Package ()
+                    {
+                        0x00000000,
+                        0x00000000
+                    })
+                    Method(ADDR, 0, NotSerialized)
+                    {
+                        Store(\_SB.VGIA, Index(PKG, 0))
+                        Return(PKG)
+                    }
+                }
             }
         }
     }