From patchwork Mon Apr 5 21:15:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Kaneda X-Patchwork-Id: 415307 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp4018823jai; Mon, 5 Apr 2021 14:52:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxP4/+WbtNySkHd3KFo9mSwbQjLDhSGOcNZe4TfkPNHBIeFeZaPzzoI5n/6Y7MQ3TfIgDPu X-Received: by 2002:a05:6602:342a:: with SMTP id n42mr21436387ioz.88.1617659409112; Mon, 05 Apr 2021 14:50:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617659409; cv=none; d=google.com; s=arc-20160816; b=Y39WMlN63iYD1JFz7/00xstZ2rnBbJorm0AP2SyrSg61sgaDRt5cgL4xv5YVs/pcb/ s19xqkZSeBvLWy0f/1h5HuZqSn2KO0kcOC4oa3xJmrJrKO4kFbrzeqpjWFMuojfx9hS6 8pDjMrSxp3erDYwVkTKlrZuC6MlN0Zd/LJI5yPetDi0U31sbYmq4jmlwxwJC7DPu5qI6 Sd3cmD+CzOi8U9z7XFOxid9B0/yzrBFMno5+zD/1UoYt82rIBESzZvaombGc33ZH3s1/ cl0+tgnV7n7n4msjiOFUVRrPX1MPkZ/D3Cj63QZ8BYXmUsCcgV72OTiT5hrA+Wj6bvqj vdHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=Q36Fil6aeAv3JmuaK5ie6ryrZQA/Lpo0SJSb18x11y4=; b=kt5bXdz4awHzLrTYqCQiT1u1x4dKnMQBtbiu1kCdNF4jVqrArtp48a/M1HF3tfVMcb YawzNfC4VU1cPrdYRkD6YJ1tGjk+vlMwEqcCjphN1jdSm72lipqOJuIX9gj+RDUwIe/5 gt0h8L9M7KVbhWHP94+16Ej3WmmtJqU0xjf642HV+srH9QywYti2tJl3fpRewDX8J1YK DQ42RRnY9uF1H6hbs0KE4z1fzWdH0KdOFYzQTiOmThkdW9rO04lfSwVAaxc/J4MATW3I kCXawWk4LaP1MYOud3pkolWU24YLcvwZ2konn0UEY5MdzqRRqCmDctlso6tbYl/baOVo yCcA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z8si14833162jat.80.2021.04.05.14.50.08; Mon, 05 Apr 2021 14:50:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-acpi-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241806AbhDEVuO (ORCPT + 4 others); Mon, 5 Apr 2021 17:50:14 -0400 Received: from mga01.intel.com ([192.55.52.88]:26882 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242300AbhDEVuL (ORCPT ); Mon, 5 Apr 2021 17:50:11 -0400 IronPort-SDR: yuSgFBtbZQFCeJnE3UTLOmR/3TU7FQgiiUyC04mq4KydYruU6FmYZmqP5hdvItueYbLKkdmrt/ gDZzWnaj0PRw== X-IronPort-AV: E=McAfee;i="6000,8403,9945"; a="213278759" X-IronPort-AV: E=Sophos;i="5.81,307,1610438400"; d="scan'208";a="213278759" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2021 14:49:59 -0700 IronPort-SDR: kyOlIPsr93IHvQODYc7pNNDs16w3UBuFKm4VMgOQAoeFoZx1UkMILdw+5Z8aVR2DL7nym1/QnZ tP0Fa38X3Tyw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,307,1610438400"; d="scan'208";a="380673615" Received: from sibelius.jf.intel.com ([10.54.75.166]) by orsmga006.jf.intel.com with ESMTP; 05 Apr 2021 14:49:58 -0700 From: Erik Kaneda To: "Rafael J . Wysocki" , ACPI Devel Maling List Cc: Jean-Philippe Brucker , Bob Moore , Erik Kaneda Subject: [PATCH 13/22] ACPICA: iASL: Add definitions for the VIOT table Date: Mon, 5 Apr 2021 14:15:01 -0700 Message-Id: <20210405211510.484603-14-erik.kaneda@intel.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210405211510.484603-1-erik.kaneda@intel.com> References: <20210405211510.484603-1-erik.kaneda@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Jean-Philippe Brucker ACPICA commit fc4e33319c1ee08f20f5c44853dd8426643f6dfd Add definitions for the VIOT table and its subtables. Link: https://github.com/acpica/acpica/commit/fc4e3331 Signed-off-by: Jean-Philippe Brucker Signed-off-by: Bob Moore Signed-off-by: Erik Kaneda --- include/acpi/actbl3.h | 66 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) -- 2.29.2 diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h index bf61a70deb22..e9bd7ce65f7c 100644 --- a/include/acpi/actbl3.h +++ b/include/acpi/actbl3.h @@ -33,6 +33,7 @@ #define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */ #define ACPI_SIG_TPM2 "TPM2" /* Trusted Platform Module 2.0 H/W interface table */ #define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */ +#define ACPI_SIG_VIOT "VIOT" /* Virtual I/O Translation Table */ #define ACPI_SIG_WAET "WAET" /* Windows ACPI Emulated devices Table */ #define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */ #define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */ @@ -484,6 +485,71 @@ struct acpi_table_uefi { u16 data_offset; /* Offset of remaining data in table */ }; +/******************************************************************************* + * + * VIOT - Virtual I/O Translation Table + * Version 1 + * + ******************************************************************************/ + +struct acpi_table_viot { + struct acpi_table_header header; /* Common ACPI table header */ + u16 node_count; + u16 node_offset; + u8 reserved[8]; +}; + +/* VIOT subtable header */ + +struct acpi_viot_header { + u8 type; + u8 reserved; + u16 length; +}; + +/* Values for Type field above */ + +enum acpi_viot_node_type { + ACPI_VIOT_NODE_PCI_RANGE = 0x01, + ACPI_VIOT_NODE_MMIO = 0x02, + ACPI_VIOT_NODE_VIRTIO_IOMMU_PCI = 0x03, + ACPI_VIOT_NODE_VIRTIO_IOMMU_MMIO = 0x04, +}; + +/* VIOT subtables */ + +struct acpi_viot_pci_range { + ACPI_VIOT_HEADER header; + u32 endpoint_start; + u16 segment_start; + u16 segment_end; + u16 bdf_start; + u16 bdf_end; + u16 output_node; + u8 reserved[6]; +}; + +struct acpi_viot_mmio { + ACPI_VIOT_HEADER header; + u32 endpoint; + u64 base_address; + u16 output_node; + u8 reserved[6]; +}; + +struct acpi_viot_virtio_iommu_pci { + ACPI_VIOT_HEADER header; + u16 segment; + u16 bdf; + u8 reserved[8]; +}; + +struct acpi_viot_virtio_iommu_mmio { + ACPI_VIOT_HEADER header; + u8 reserved[4]; + u64 base_address; +}; + /******************************************************************************* * * WAET - Windows ACPI Emulated devices Table