From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zb6di-0003rE-0l for qemu-devel@nongnu.org; Sun, 13 Sep 2015 08:44:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zb6dg-00006J-TB for qemu-devel@nongnu.org; Sun, 13 Sep 2015 08:44:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zb6dg-00005b-MJ for qemu-devel@nongnu.org; Sun, 13 Sep 2015 08:44:12 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 6527AA4459 for ; Sun, 13 Sep 2015 12:44:12 +0000 (UTC) From: Laszlo Ersek Date: Sun, 13 Sep 2015 14:43:41 +0200 Message-Id: <1442148227-17343-8-git-send-email-lersek@redhat.com> In-Reply-To: <1442148227-17343-1-git-send-email-lersek@redhat.com> References: <55F5647C.6030901@redhat.com> <1442148227-17343-1-git-send-email-lersek@redhat.com> Subject: [Qemu-devel] [PATCH FYI 07/13] hw/acpi: introduce the AcpiQemuParamTable structure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gal Hammer , Paolo Bonzini , "Michael S. Tsirkin" , Igor Mammedov This ACPI table is supposed to carry various parameters for OSPM. We introduce it with a single parameter field, "vmgenid_addr_base_ptr", which is described as ADBP / "ADDR base pointer" in "docs/vmgenid.txt" (along with the general structure of the table). Cc: Paolo Bonzini Cc: Gal Hammer Cc: Igor Mammedov Cc: "Michael S. Tsirkin" Signed-off-by: Laszlo Ersek --- include/hw/acpi/vmgenid.h | 72 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 include/hw/acpi/vmgenid.h diff --git a/include/hw/acpi/vmgenid.h b/include/hw/acpi/vmgenid.h new file mode 100644 index 0000000..07e813a --- /dev/null +++ b/include/hw/acpi/vmgenid.h @@ -0,0 +1,72 @@ +/* + * ACPI definitions related to the VMGENID device (see "docs/vmgenid.txt"). + * + * Copyright (C) 2015 Red Hat, Inc. + * + * Authors: + * Laszlo Ersek + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, see . + */ + +#ifndef HW_ACPI_VMGENID_H +#define HW_ACPI_VMGENID_H + +#include "hw/acpi/acpi-defs.h" + +#define ACPI_UEFI_IDENT_SIZE 16 + +struct AcpiQemuParamTable { + /* ACPI common table header */ + ACPI_TABLE_HEADER_DEF + + /* + * UEFI ACPI Data Table Sub-Header. + * + * The "UEFI" signature is reserved for this table header starting with + * ACPI 4.0. The header structure is described in the UEFI Specification, + * version 2.3 or later, in Appendix O. + + * These fields are harmless for SeaBIOS, but ensure unicity in OVMF + * ("UEFI" is a multi-instance table type). + */ + uint8_t identifier[ACPI_UEFI_IDENT_SIZE]; + uint16_t data_offset; + + /* QEMU-specific fields start here. */ + + /* Base pointer for the VMGENID device's ADDR control method. */ + uint64_t vmgenid_addr_base_ptr; +} QEMU_PACKED; +typedef struct AcpiQemuParamTable AcpiQemuParamTable; + +/* Aggregate initializer for "AcpiQemuParamTable.identifier". */ +#define QEMU_PARAM_TABLE_GUID { 0xFF, 0x5D, 0x7A, 0x41, 0x4B, 0xBF, 0xBC, 0x4A, \ + 0xA8, 0x39, 0x65, 0x93, 0xBB, 0x41, 0xF4, 0x52 } + +/* + * This offset points into the fw_cfg blob that contains both + * AcpiQemuParamTable and the "live" generation ID after it. The offset points + * at the generation ID field, skipping over the "OVMF SDT Header probe + * suppressor" and "VMGenID alignment padding" fields in the blob (which are + * located right after AcpiQemuParamTable). + * + * This is an integer constant expression. + */ +#define VM_GENERATION_ID_OFFSET \ + ROUND_UP(sizeof(AcpiQemuParamTable) + sizeof(AcpiTableHeader), 8) + +#define VM_GENERATION_ID_SIZE 16 + +#endif /* HW_ACPI_VMGENID_H */ -- 1.8.3.1