On 23/06/16 17:26, Julien Grall wrote:
  enum {
      RSDP,
      XSDT,
@@ -110,6 +113,30 @@ static void make_acpi_xsdt(libxl__gc *gc, struct
xc_dom_image *dom)
      dom->acpitable_size += ROUNDUP(acpitables[XSDT].size, 3);
  }

+static void make_acpi_gtdt(libxl__gc *gc, struct xc_dom_image *dom)
+{
+    struct acpi_table_gtdt *gtdt;
+    size_t size = sizeof(*gtdt);
+
+    gtdt = libxl__zalloc(gc, size);
+
+    gtdt->non_secure_el1_interrupt = GUEST_TIMER_PHYS_NS_PPI;
+    gtdt->non_secure_el1_flags =
+                             (ACPI_LEVEL_SENSITIVE <<
ACPI_GTDT_INTERRUPT_MODE)
+                             |(ACPI_ACTIVE_LOW <<
ACPI_GTDT_INTERRUPT_POLARITY);
+    gtdt->virtual_timer_interrupt = GUEST_TIMER_VIRT_PPI;
+    gtdt->virtual_timer_flags =
+                             (ACPI_LEVEL_SENSITIVE <<
ACPI_GTDT_INTERRUPT_MODE)
+                             |(ACPI_ACTIVE_LOW <<
ACPI_GTDT_INTERRUPT_POLARITY);
+
+    make_acpi_header(&gtdt->header, "GTDT", size, 2);
+
+    acpitables[GTDT].table = gtdt;
+    acpitables[GTDT].size = size;
+    /* Align to 64bit. */
+    dom->acpitable_size += ROUNDUP(acpitables[GTDT].size, 3);

I am not sure how ROUNDUP(..., 3) will align to 64-bit.

Hmmm I found why. The ROUNDUP macro in libxl is taking an order which is odd.

Cheers,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to