From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by ml01.01.org (Postfix) with ESMTP id 1BF911A1E14 for ; Mon, 1 Aug 2016 16:44:20 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 01 Aug 2016 16:44:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,457,1464678000"; d="scan'208";a="1006626264" Received: from orsmsx101.amr.corp.intel.com ([10.22.225.128]) by orsmga001.jf.intel.com with ESMTP; 01 Aug 2016 16:44:03 -0700 Received: from orsmsx162.amr.corp.intel.com (10.22.240.85) by ORSMSX101.amr.corp.intel.com (10.22.225.128) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 1 Aug 2016 16:44:02 -0700 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.118]) by ORSMSX162.amr.corp.intel.com ([169.254.3.27]) with mapi id 14.03.0248.002; Mon, 1 Aug 2016 16:44:02 -0700 From: "Kinney, Michael D" To: "Mudusuru, Giri P" , "edk2-devel@lists.01.org" , "Kinney, Michael D" CC: "Yao, Jiewen" , "Gao, Liming" Thread-Topic: [edk2] [PATCHV2] MdePkg: Add DmaRemappingReportingTable.h Thread-Index: AQHR7ErNs5fzUu5MMki4xvBl60gFraA0wxCw Date: Mon, 1 Aug 2016 23:44:02 +0000 Message-ID: References: <881b8e14113e7137dcce3edbc369bb466ae12804.1470092989.git.giri.p.mudusuru@intel.com> In-Reply-To: <881b8e14113e7137dcce3edbc369bb466ae12804.1470092989.git.giri.p.mudusuru@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzVkY2UzZDQtZDkwNy00NzU3LTk4NDYtYThjN2M3MGMwNjAwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImJZT0cyV2VjSEN1UThuVEkrMVwvK3U5NFlBMFdxdlp0ZWc3NVlFbks3TVJJPSJ9 x-originating-ip: [10.22.254.138] MIME-Version: 1.0 Subject: Re: [PATCHV2] MdePkg: Add DmaRemappingReportingTable.h X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2016 23:44:20 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Giri, The updates look good. Reviewed-by: Michael Kinney Mike > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Gi= ri P Mudusuru > Sent: Monday, August 1, 2016 4:17 PM > To: edk2-devel@lists.01.org > Cc: Kinney, Michael D ; Yao, Jiewen ; > Gao, Liming > Subject: [edk2] [PATCHV2] MdePkg: Add DmaRemappingReportingTable.h >=20 > DMA Remapping Reporting (DMAR) ACPI table definitions from Intel(R) > Virtualization Technology for Directed I/O (VT-D) Architecture > Specification v2.4 dated June 2016. >=20 > This replaces the DMARemappingReportingTable.h from > EdkCompatibilityPkg\Foundation\Include\IndustryStandard >=20 > Patch V2: added below defines and re-arranged the file. > EFI_ACPI_DMAR_DRHD_FLAGS_INCLUDE_PCI_ALL > EFI_ACPI_DMAR_ATSR_FLAGS_ALL_PORTS >=20 > Cc: Michael Kinney > Cc: Liming Gao > Cc: Jiewen Yao > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Giri P Mudusuru > Reviewed-by: Jiewen Yao > --- > .../IndustryStandard/DmaRemappingReportingTable.h | 261 +++++++++++++++= ++++++ > 1 file changed, 261 insertions(+) > create mode 100644 MdePkg/Include/IndustryStandard/DmaRemappingReporting= Table.h >=20 > diff --git a/MdePkg/Include/IndustryStandard/DmaRemappingReportingTable.h > b/MdePkg/Include/IndustryStandard/DmaRemappingReportingTable.h > new file mode 100644 > index 0000000..a4a7e00 > --- /dev/null > +++ b/MdePkg/Include/IndustryStandard/DmaRemappingReportingTable.h > @@ -0,0 +1,261 @@ > +/** @file > + DMA Remapping Reporting (DMAR) ACPI table definition from Intel(R) > + Virtualization Technology for Directed I/O (VT-D) Architecture Specifi= cation. > + > + Copyright (c) 2016, Intel Corporation. All rights reserved.
> + This program and the accompanying materials > + are licensed and made available under the terms and conditions of the = BSD License > + which accompanies this distribution. The full text of the license may= be found at > + http://opensource.org/licenses/bsd-license.php > + > + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR I= MPLIED. > + > + @par Revision Reference: > + - Intel(R) Virtualization Technology for Directed I/O (VT-D) Archite= cture > + Specification v2.4, Dated June 2016. > + http://www.intel.com/content/dam/www/public/us/en/documents/produc= t- > specifications/vt-directed-io-spec.pdf > + > + @par Glossary: > + - HPET - High Precision Event Timer > + - NUMA - Non-uniform Memory Access > +**/ > +#ifndef _DMA_REMAPPING_REPORTING_TABLE_H_ > +#define _DMA_REMAPPING_REPORTING_TABLE_H_ > + > +#pragma pack(1) > + > +/// > +/// DMA-Remapping Reporting Structure definitions from section 8.1 > +///@{ > +#define EFI_ACPI_DMAR_REVISION 0x01 > + > +#define EFI_ACPI_DMAR_FLAGS_INTR_REMAP BIT0 > +#define EFI_ACPI_DMAR_FLAGS_X2APIC_OPT_OUT BIT1 > +///@} > + > +/// > +/// Remapping Structure Types definitions from section 8.2 > +///@{ > +#define EFI_ACPI_DMAR_TYPE_DRHD 0x00 > +#define EFI_ACPI_DMAR_TYPE_RMRR 0x01 > +#define EFI_ACPI_DMAR_TYPE_ATSR 0x02 > +#define EFI_ACPI_DMAR_TYPE_RHSA 0x03 > +#define EFI_ACPI_DMAR_TYPE_ANDD 0x04 > +///@} > + > +/// > +/// DMA-Remapping Hardware Unit definitions from section 8.3 > +/// > +#define EFI_ACPI_DMAR_DRHD_FLAGS_INCLUDE_PCI_ALL BIT0 > + > +/// > +/// DMA-Remapping Device Scope Entry Structure definitions from section = 8.3.1 > +///@{ > +#define EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_PCI_ENDPOINT 0x01 > +#define EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_PCI_BRIDGE 0x02 > +#define EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_IOAPIC 0x03 > +#define EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_MSI_CAPABLE_HPET 0x04 > +#define EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_ACPI_NAMESPACE_DEVICE 0x05 > +///@} > + > +/// > +/// Root Port ATS Capability Reporting Structure definitions from sectio= n 8.5 > +/// > +#define EFI_ACPI_DMAR_ATSR_FLAGS_ALL_PORTS BIT0 > + > +/// > +/// Definition for DMA Remapping Structure Header > +/// > +typedef struct { > + UINT16 Type; > + UINT16 Length; > +} EFI_ACPI_DMAR_STRUCTURE_HEADER; > + > +/// > +/// Definition for DMA-Remapping PCI Path > +/// > +typedef struct { > + UINT8 Device; > + UINT8 Function; > +} EFI_ACPI_DMAR_PCI_PATH; > + > +/// > +/// Device Scope Structure is defined in section 8.3.1 > +/// > +typedef struct { > + UINT8 Type; > + UINT8 Length; > + UINT16 Reserved2; > + UINT8 EnumerationId; > + UINT8 StartBusNumber; > +} EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER; > + > +/** > + DMA-remapping hardware unit definition (DRHD) structure is defined in > + section 8.3. This uniquely represents a remapping hardware unit presen= t > + in the platform. There must be at least one instance of this structure > + for each PCI segment in the platform. > +**/ > +typedef struct { > + EFI_ACPI_DMAR_STRUCTURE_HEADER Header; > + /** > + - Bit[0]: INCLUDE_PCI_ALL > + - If Set, this remapping hardware unit has under its scope= all > + PCI compatible devices in the specified Segment, except = devices > + reported under the scope of other remapping hardware uni= ts for > + the same Segment. > + - If Clear, this remapping hardware unit has under its sco= pe only > + devices in the specified Segment that are explicitly ide= ntified > + through the DeviceScope field. > + - Bits[7:1] Reserved. > + **/ > + UINT8 Flags; > + UINT8 Reserved; > + /// > + /// The PCI Segment associated with this unit. > + /// > + UINT16 SegmentNumber; > + /// > + /// Base address of remapping hardware register-set for this unit. > + /// > + UINT64 RegisterBaseAddress; > +} EFI_ACPI_DMAR_DRHD_HEADER; > + > +/** > + Reserved Memory Region Reporting Structure (RMRR) is described in sect= ion 8.4 > + Reserved memory ranges that may be DMA targets may be reported through= the > + RMRR structures, along with the devices that requires access to the sp= ecified > + reserved memory region. > +**/ > +typedef struct { > + EFI_ACPI_DMAR_STRUCTURE_HEADER Header; > + UINT8 Reserved[2]; > + /// > + /// PCI Segment Number associated with devices identified through > + /// the Device Scope field. > + /// > + UINT16 SegmentNumber; > + /// > + /// Base address of 4KB-aligned reserved memory region > + /// > + UINT64 ReservedMemoryRegionBaseAddress; > + /** > + Last address of the reserved memory region. Value in this field must= be > + greater than the value in Reserved Memory Region Base Address field. > + The reserved memory region size (Limit - Base + 1) must be an intege= r > + multiple of 4KB. > + **/ > + UINT64 ReservedMemoryRegionLimitAddress; > +} EFI_ACPI_DMAR_RMRR_HEADER; > + > +/** > + Root Port ATS Capability Reporting (ATSR) structure is defined in sect= ion 8.5. > + This structure is applicable only for platforms supporting Device-TLBs= as > + reported through the Extended Capability Register. For each PCI Segmen= t in > + the platform that supports Device-TLBs, BIOS provides an ATSR structur= e. The > + ATSR structures identifies PCI-Express Root-Ports supporting Address > + Translation Services (ATS) transactions. Software must enable ATS on e= ndpoint > + devices behind a Root Port only if the Root Port is reported as suppor= ting > + ATS transactions. > +**/ > +typedef struct { > + EFI_ACPI_DMAR_STRUCTURE_HEADER Header; > + /** > + - Bit[0]: ALL_PORTS: > + - If Set, indicates all PCI Express Root Ports in the spec= ified > + PCI Segment supports ATS transactions. > + - If Clear, indicates ATS transactions are supported only = on > + Root Ports identified through the Device Scope field. > + - Bits[7:1] Reserved. > + **/ > + UINT8 Flags; > + UINT8 Reserved; > + /// > + /// The PCI Segment associated with this ATSR structure > + /// > + UINT16 SegmentNumber; > +} EFI_ACPI_DMAR_ATSR_HEADER; > + > +/** > + Remapping Hardware Static Affinity (RHSA) is an optional structure def= ined > + in section 8.6. This is intended to be used only on NUMA platforms wit= h > + Remapping hardware units and memory spanned across multiple nodes. > + When used, there must be a RHSA structure for each Remapping hardware = unit > + reported through DRHD structure. > +**/ > +typedef struct { > + EFI_ACPI_DMAR_STRUCTURE_HEADER Header; > + UINT8 Reserved[4]; > + /// > + /// Register Base Address of this Remap hardware unit reported in the > + /// corresponding DRHD structure. > + /// > + UINT64 RegisterBaseAddress; > + /// > + /// Proximity Domain to which the Remap hardware unit identified by th= e > + /// Register Base Address field belongs. > + /// > + UINT32 ProximityDomain; > +} EFI_ACPI_DMAR_RHSA_HEADER; > + > +/** > + An ACPI Name-space Device Declaration (ANDD) structure is defined in s= ection > + 8.7 and uniquely represents an ACPI name-space enumerated device capab= le of > + issuing DMA requests in the platform. ANDD structures are used in conj= unction > + with Device-Scope entries of type ACPI_NAMESPACE_DEVICE. > +**/ > +typedef struct { > + EFI_ACPI_DMAR_STRUCTURE_HEADER Header; > + UINT8 Reserved[3]; > + /** > + Each ACPI device enumerated through an ANDD structure must have a un= ique > + value for this field. To report an ACPI device with ACPI Device Numb= er > + value of X, under the scope of a DRHD unit, a Device-Scope entry of = type > + ACPI_NAMESPACE_DEVICE is used with value of X in the Enumeration ID = field. > + The Start Bus Number and Path fields in the Device-Scope together > + provides the 16-bit source-id allocated by platform for the ACPI dev= ice. > + **/ > + UINT8 AcpiDeviceNumber; > +} EFI_ACPI_DMAR_ANDD_HEADER; > + > +/** > + DMA Remapping Reporting Structure Header as defined in section 8.1 > + This header will be followed by list of Remapping Structures listed be= low > + - DMA Remapping Hardware Unit Definition (DRHD) > + - Reserved Memory Region Reporting (RMRR) > + - Root Port ATS Capability Reporting (ATSR) > + - Remapping Hardware Static Affinity (RHSA) > + - ACPI Name-space Device Declaration (ANDD) > + These structure types must by reported in numerical order. > + i.e., All remapping structures of type 0 (DRHD) enumerated before rema= pping > + structures of type 1 (RMRR), and so forth. > +**/ > +typedef struct { > + EFI_ACPI_DESCRIPTION_HEADER Header; > + /** > + This field indicates the maximum DMA physical addressability support= ed by > + this platform. The system address map reported by the BIOS indicates= what > + portions of this addresses are populated. The Host Address Width (HA= W) of > + the platform is computed as (N+1), where N is the value reported in = this > + field. > + For example, for a platform supporting 40 bits of physical addressab= ility, > + the value of 100111b is reported in this field. > + **/ > + UINT8 HostAddressWidth; > + /** > + - Bit[0]: INTR_REMAP - If Clear, the platform does not support int= errupt > + remapping. If Set, the platform supports interrupt remap= ping. > + - Bit[1]: X2APIC_OPT_OUT - For firmware compatibility reasons, pla= tform > + firmware may Set this field to request system software t= o opt > + out of enabling Extended xAPIC (X2APIC) mode. This field= is > + valid only when the INTR_REMAP field (bit 0) is Set. > + - Bits[7:2] Reserved. > + **/ > + UINT8 Flags; > + UINT8 Reserved[10]; > +} EFI_ACPI_DMAR_HEADER; > + > +#pragma pack() > + > +#endif > -- > 2.9.0.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel