From patchwork Sun Sep 13 12:43:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 53524 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by patches.linaro.org (Postfix) with ESMTPS id 9181222B26 for ; Sun, 13 Sep 2015 12:45:21 +0000 (UTC) Received: by wicmn1 with SMTP id mn1sf32584080wic.1 for ; Sun, 13 Sep 2015 05:45:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=KGthzW93YJJjzgKy9I9rSWRH7Ix4yuLiKeoo3C3WIKc=; b=bpJapAjzOu5v2vwF74G2K/wy0uhi+MilYwP0DTMKS4FEG1rV3qNa9KySzgxrwZwRtq omicEdMf42X5kytNsT0npSu0xjHtpG56DM+tjeQq7ka2k86mou2Wbjlh8fToJdu12IKb cp7uUbH1NboYGlw7Uwq1UUUTHQexwdfygfgEdYnxlHeV7BItudf4byHQjYR3Al+2TnBA K7IJpdvFW3WgX/Y1leixD7oJvBa1F/IpWCk+PgNUjHHMv1W6Rkikk+j9vO212+XZso7T PHl5G9qq+JovfUOYaT0+F8PHaDnH2hlhoo6n/4f6exllcnPAcZ40z6oqBhFY466v1sn8 Y6MQ== X-Gm-Message-State: ALoCoQmUJjGbLBZeOm+nW8Bfntbml7MKGUO6DzvJ62kF2Ut+YvWhgQmu9Kw87M4Qs365FKFX1vZ2 X-Received: by 10.180.87.199 with SMTP id ba7mr1836662wib.5.1442148320900; Sun, 13 Sep 2015 05:45:20 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.45.100 with SMTP id l4ls524725lam.80.gmail; Sun, 13 Sep 2015 05:45:20 -0700 (PDT) X-Received: by 10.153.4.40 with SMTP id cb8mr8564368lad.100.1442148320562; Sun, 13 Sep 2015 05:45:20 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id f8si6429128lbc.78.2015.09.13.05.45.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Sep 2015 05:45:20 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbmp1 with SMTP id mp1so56150486lbb.1 for ; Sun, 13 Sep 2015 05:45:20 -0700 (PDT) X-Received: by 10.112.135.9 with SMTP id po9mr3221162lbb.56.1442148320441; Sun, 13 Sep 2015 05:45:20 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp700760lbq; Sun, 13 Sep 2015 05:45:19 -0700 (PDT) X-Received: by 10.107.138.233 with SMTP id c102mr16500552ioj.187.1442148319503; Sun, 13 Sep 2015 05:45:19 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id hg20si4898696igb.85.2015.09.13.05.45.18 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 13 Sep 2015 05:45:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:35721 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zb6ek-00056R-AW for patch@linaro.org; Sun, 13 Sep 2015 08:45:18 -0400 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) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-23.ams2.redhat.com [10.36.116.23]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8DChnOx024712; Sun, 13 Sep 2015 08:44:10 -0400 From: Laszlo Ersek To: qemu-devel@nongnu.org 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> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Gal Hammer , Paolo Bonzini , "Michael S. Tsirkin" , Igor Mammedov Subject: [Qemu-devel] [PATCH FYI 07/13] hw/acpi: introduce the AcpiQemuParamTable structure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lersek@redhat.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 */