From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7244A21AEB0A2 for ; Wed, 26 Jul 2017 01:34:37 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jul 2017 01:36:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,414,1496127600"; d="scan'208";a="131384018" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga005.fm.intel.com with ESMTP; 26 Jul 2017 01:36:39 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 26 Jul 2017 01:36:39 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 26 Jul 2017 01:36:38 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.146]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0319.002; Wed, 26 Jul 2017 16:36:37 +0800 From: "Zeng, Star" To: "Yao, Jiewen" , "edk2-devel@lists.01.org" CC: "Zeng, Star" Thread-Topic: [PATCH 2/7] IntelSiliconPkg/Include: Add PlatformVtdPolicy Protocol Thread-Index: AQHS/5reFZLBxcdMgkuqe1BNPCFHPKJl1Ntw Date: Wed, 26 Jul 2017 08:36:37 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103B8F6131@shsmsx102.ccr.corp.intel.com> References: <1500364297-17072-1-git-send-email-jiewen.yao@intel.com> <1500364297-17072-3-git-send-email-jiewen.yao@intel.com> In-Reply-To: <1500364297-17072-3-git-send-email-jiewen.yao@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 2/7] IntelSiliconPkg/Include: Add PlatformVtdPolicy Protocol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jul 2017 08:34:37 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable How about we update the description for EDKII_PLATFORM_VTD_POLICY_GET_EXCEP= TION_DEVICE_LIST? + Get a list of handles for the exception devices. -> + Get a list of the exception devices. With this update, Reviewed-by: Star Zeng to the whole= patch series. Thanks, Star -----Original Message----- From: Yao, Jiewen=20 Sent: Tuesday, July 18, 2017 3:52 PM To: edk2-devel@lists.01.org Cc: Zeng, Star Subject: [PATCH 2/7] IntelSiliconPkg/Include: Add PlatformVtdPolicy Protoco= l Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao --- IntelSiliconPkg/Include/Protocol/PlatformVtdPolicy.h | 100 +++++++++++++++= +++++ 1 file changed, 100 insertions(+) diff --git a/IntelSiliconPkg/Include/Protocol/PlatformVtdPolicy.h b/IntelSi= liconPkg/Include/Protocol/PlatformVtdPolicy.h new file mode 100644 index 0000000..1bd9365 --- /dev/null +++ b/IntelSiliconPkg/Include/Protocol/PlatformVtdPolicy.h @@ -0,0 +1,100 @@ +/** @file + The definition for platform VTD policy. + + Copyright (c) 2017, Intel Corporation. All rights reserved.
This=20 + program and the accompanying materials are licensed and made=20 + available under the terms and conditions of the BSD License which=20 + accompanies this distribution. The full text of the license may be=20 + found at http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, =20 + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPL= IED. + +**/ + +#ifndef __PLATFORM_VTD_POLICY_PROTOCOL_H__ +#define __PLATFORM_VTD_POLICY_PROTOCOL_H__ + +#include + +#define EDKII_PLATFORM_VTD_POLICY_PROTOCOL_GUID \ + { \ + 0x3d17e448, 0x466, 0x4e20, { 0x99, 0x9f, 0xb2, 0xe1, 0x34, 0x88, 0xe= e, 0x22 } \ + } + +typedef struct _EDKII_PLATFORM_VTD_POLICY_PROTOCOL =20 +EDKII_PLATFORM_VTD_POLICY_PROTOCOL; + +#define EDKII_PLATFORM_VTD_POLICY_PROTOCOL_REVISION 0x00010000 + +typedef struct { + UINT16 Segment; + VTD_SOURCE_ID SourceId; +} EDKII_PLATFORM_VTD_DEVICE_INFO; + +/** + Get the VTD SourceId from the device handler. + This function is required for non PCI device handler. + + Pseudo-algo in Intel VTd driver: + Status =3D PlatformGetVTdDeviceId (); + if (EFI_ERROR(Status)) { + if (DeviceHandle is PCI) { + Get SourceId from Bus/Device/Function + } else { + return EFI_UNSUPPORTED + } + } + Get VTd engine by Segment/Bus/Device/Function. + + @param[in] This The protocol instance pointer. + @param[in] DeviceHandle Device Identifier in UEFI. + @param[out] DeviceInfo DeviceInfo for indentify the VTd engin= e in ACPI Table + and the VTd page entry. + + @retval EFI_SUCCESS The VtdIndex and SourceId are returned. + @retval EFI_INVALID_PARAMETER DeviceHandle is not a valid handler. + @retval EFI_INVALID_PARAMETER DeviceInfo is NULL. + @retval EFI_NOT_FOUND The Segment or SourceId information is NOT= found. + @retval EFI_UNSUPPORTED This function is not supported. + +**/ +typedef +EFI_STATUS +(EFIAPI *EDKII_PLATFORM_VTD_POLICY_GET_DEVICE_ID) ( + IN EDKII_PLATFORM_VTD_POLICY_PROTOCOL *This, + IN EFI_HANDLE DeviceHandle, + OUT EDKII_PLATFORM_VTD_DEVICE_INFO *DeviceInfo + ); + +/** + Get a list of handles for the exception devices. + + The VTd driver should always set ALLOW for the device in this list. + + @param[in] This The protocol instance pointer. + @param[out] DeviceInfoCount The count of the list of DeviceInfo. + @param[out] DeviceInfo A callee allocated buffer to hold a li= st of DeviceInfo. + + @retval EFI_SUCCESS The DeviceInfoCount and DeviceInfo are ret= urned. + @retval EFI_INVALID_PARAMETER DeviceInfoCount is NULL, or DeviceInfo is = NULL. + @retval EFI_UNSUPPORTED This function is not supported. + +**/ +typedef +EFI_STATUS +(EFIAPI *EDKII_PLATFORM_VTD_POLICY_GET_EXCEPTION_DEVICE_LIST) ( + IN EDKII_PLATFORM_VTD_POLICY_PROTOCOL *This, + OUT UINTN *DeviceInfoCount, + OUT EDKII_PLATFORM_VTD_DEVICE_INFO **DeviceInfo + ); + +struct _EDKII_PLATFORM_VTD_POLICY_PROTOCOL { + UINT64 Revision; + EDKII_PLATFORM_VTD_POLICY_GET_DEVICE_ID GetDeviceId; + EDKII_PLATFORM_VTD_POLICY_GET_EXCEPTION_DEVICE_LIST =20 +GetExceptionDeviceList; }; + +extern EFI_GUID gEdkiiPlatformVTdPolicyProtocolGuid; + +#endif + -- 2.7.4.windows.1