From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0626.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe42::626]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DB20E21C8D0A5 for ; Fri, 26 May 2017 07:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=kMd6pgl4AVmoPlA80M5f/X+XBQCEOsknhE0mlFl+5jM=; b=DSfWe7CcPsfkIWbzKK6bX27ODc+YAM0iAdA5qg2zOOWHWrx91HpkZ86lKDw+GCBZQQ6bEIiX9k1X/f03cYA5HWiwbp9rXHK3vzPNbCM4YdDF4GViShPbtsmeFSbagT5VQTjCbYmG0ivku9qdJo2026CNh5PWu3nWn+Mr4CVcWBs= Authentication-Results: lists.01.org; dkim=none (message not signed) header.d=none;lists.01.org; dmarc=none action=none header.from=amd.com; Received: from brijesh-build-machine.amd.com (165.204.77.1) by SN1PR12MB0158.namprd12.prod.outlook.com (10.162.3.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Fri, 26 May 2017 14:44:32 +0000 From: Brijesh Singh To: CC: , , Brijesh Singh , Jordan Justen , Laszlo Ersek Date: Fri, 26 May 2017 10:43:56 -0400 Message-ID: <1495809845-32472-9-git-send-email-brijesh.singh@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1495809845-32472-1-git-send-email-brijesh.singh@amd.com> References: <1495809845-32472-1-git-send-email-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: CY4PR16CA0024.namprd16.prod.outlook.com (10.172.173.34) To SN1PR12MB0158.namprd12.prod.outlook.com (10.162.3.145) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PR12MB0158: X-MS-Office365-Filtering-Correlation-Id: ad99dd1d-9434-4feb-ace0-08d4a445b8ec X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:SN1PR12MB0158; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 3:3e+iPFsbGvecum0oDUSTfmIRNVmrApIcankHzwnwzJosa/qK46H0kjPAByP8wTvkjaQsVlwp44gxzekUm9h3Hmt3woy55mmpwI0XoqCC89iA0RHVWb9froGvTfNiM6G2fVcPDB+hRgcfE3pM5NAgqTidz+4f7CMGxgqpW3t+PgM3nncERmJQDNkFk7jxa7o9S9UFgReLm0oNjQ4OthwAXQReyvmw1Q/wCvxCTLDpGICuqw94I4NKdW3m8oVWTp/E5GQfWoESM4qhqZBA38BXOjKQ+8fbqnG63VzEDgHnsizn+rOkzTbCTwx2qG98x7b86MhrXAPyT0lG/cgI/9zq5ytYnraHCdsQA6885AP1oBA=; 25:sPXriBNqK3ZAIxssAoxutylTuPea+U4lw7Kgf0bgh0rHQ+0FAHPEzXP3WRLdcyFw+2VtOmOJMaihIEWpvN9UUPwqv+ilYwOPjRt6TF+dxDKihlUxfgCbG6PJKxnayXYAsxsa8JVkFE+Kk5fWstZmiHWaw1DkOH/uqZ7foz3djjTAA7j2pkIKd+56FJr0qgVoxg79e6mOwogZEkyXTci7INziOe4F/QSZoUC1T/RS6mSASP8QhmZnaxbSPUdl1DdPnboVDou7mEDt/A2iPg4wNKy+N9mg07FypMYIZBKYkoiehM8SzrgMEp5oNZDN7WWWrPAYnu7JOD92LyUqKrkNxF6Fp0m99PdmBwNtLTajI4+NjLeMealQum5yCmZ3MYE9EnGZmyAVX5oZGE5usaYmXXCudiesHNJCD152bhIjibpiO4KUbvNdOIvr1ZC9/QXhF6YGIkKuwnnXKgLu+8RwDrL5JBooJFz7grGacy3p3T4= X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 31:q0mD7/Ifs7I8yrwge7UW4IJ7CicALjC2VH7AhGaOFo1AsT0jdqN9hXI8cgNPpOW7SNaelNG6YyM81RLX2fniWoxk+EpND+Uly8Dx9p+QUUULdE5uPKFrdFOE8n52J6Kiv16+aXqoeL1OwX9P4eOFULfqXvHdqioT8K4dElopIFSXyAJ6nZZ6LW6i8bevDxXi0COVGydZJWJnTLMFdKO/rnCIhx2NoJWQSFn2HocP3vw=; 20:ziSgEHL+kB3j4oQc3rzMg/d2fjiIbtKFopDMVlO56Tm62/HUBq06gqOey7Qbr/7a+IoiXw2cQIGPVwC+b0F398dLCafQSn+nFM3sgtXDPwVkEFlo+jhVppGQsJq3fB7yerzlv9shp0z1PQUjLxPLcSacM94PZysKq6KB1xOYKQW1iWsum+mTsDYjYrdu6AY8aJAN8YYE+RN2xyj+x3tQLvNr0i9YlFd/nhUTtcyqwtxyKlg1lZ9dHFdJyHv/u+PhQVbnPzB8Lb/7WsuVocVZOHJlfuvLq7QlXM3k1iI7j9fe8jMxAql4Ex6gZgXM8ko9sgAb4LLoYHy9GwBnz0cH4Xzb4FSsc+09SuSy7hjZ4GUc7uOiJe/k9KCAGm5kLoQPu7EEODpn5DkqwwBuun6peUZKLUSdBcXAD12IRvKocpekET5MJnoHu2nNb5glBSDrME47xOfcbnpDgTMpytFv4iw0Dx5fsmEP6RS2QrJUOiWU5LeLoCAp89+4faV7yyHj X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148); SRVR:SN1PR12MB0158; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0158; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0158; 4:ECixsY0Z0PP+mfWDAIugp4X+Z4tRkjTC+aKYUrT2ue2DdNBFXXo0DGXCH6q09Dd0j4Tsm5mcvCwgdrfTF5+UgFyLB7GLLN9+7sMtXmK91Ldw6ZKWEdExBqEjuHdTMQ6gHZszbUahp5vVnM7qXL/NqfUe8w9wfxv5cP7w2rSIhxQUBi8VIHlULiuUzo2MSHDT7OK7RnvD+srJ2XqMeDHM2hfV2qnDfLwu+VN9e4u1QFyKbuC0XOo+tRSCm8DgkmAwbeKcUZWR+IwO9qOdWDmYc+1ebqotDCfudHu+fr5k1TwYHIroVzC84Byj8ls357WUMJ5Q3SHRA1nM3bxcMIEpGZAO7bZ9QkPb2PFrlDA/epFpYlSRhYIAZI+qmMXVeF7ByHTb1zWD2wNX62P3poTAR3AlZbWG2IUjXhwbebicteXmAeuEw/y/8+bKe6d22LAkU4gCXcUckYviyqhmt9RJ4cgfEPuE6C9nm5HS7Iaf70mUmK4FJdI4PoKPEZhXGaz69oURJsSzXuGiLeHKFB0eZrQYy465DiSlSlKApxetjcEWMdM/kbqfMXe75yYV1EOPdciJYAr5tozPr75ZzKBj7+2SCWnuuKLc1J95PGrQQsCDP9sK9MYaJhUiMS+0fiy0u94Qm5UQ3uGDDlaGY+sEgDLF3VW/ap+24MkyLNEdCi62z9r4ocj0cQTB+MyTif54fdO+Y+WoFxgHtD5ltCo2p0M67o7tNf182A7f7V11QqeXvH6+F6+nXAXeO2gKRCuB7M4p2HRcX/eNWSzNA95YJBrtRqZc6mMz1L+yQG7nbA4aZLthiRSq/LJXmpaavUMSVbxbTaHTRUQxx1f0g6AzDwiwHp7fV3WTtKdMyrkQ0VbIM/GExZLgjniZD2qC9qXh X-Forefront-PRVS: 031996B7EF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6029001)(39450400003)(39410400002)(39840400002)(39860400002)(39400400002)(39850400002)(2950100002)(53376002)(6916009)(6666003)(38730400002)(110136004)(50226002)(6306002)(76176999)(36756003)(81166006)(8676002)(53936002)(16799955002)(86362001)(478600001)(48376002)(15188155005)(54906002)(25786009)(5660300001)(50986999)(189998001)(5003940100001)(33646002)(305945005)(6486002)(2906002)(53416004)(47776003)(2351001)(42186005)(966005)(3846002)(6116002)(66066001)(4326008)(50466002)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0158; H:brijesh-build-machine.amd.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0158; 23:+ywQR5qjrYD1n73ekEt0AW5hO3cQP82ESLIGJhtU5?= =?us-ascii?Q?DOvLHGwiAevK3DME+IIftY6uPZ7LDJSSPrqX+0ps53nd5KB/X/g7KBJjT1DK?= =?us-ascii?Q?/yPAN4nXtMtnwYmFSrSSMM3LUphAGonr9jJi+X93I6oWrver4/cUZiE9OGkD?= =?us-ascii?Q?25D+ppHkHtwLl2ebDyoPfYjLbBn0X3jiBEUa4FLoM2BgYSu3KnR4m3hNdMSa?= =?us-ascii?Q?I9sBVUCMbOdSya2qc4jPN4wdziOGWBIj8UUb3STb31LyPZFhXdibAvz/28nh?= =?us-ascii?Q?lePEUOfYnxKZBJIObTfIao1fz9KC7vQcCnxiSEAv88ua+14LlV3kvDKH4duE?= =?us-ascii?Q?azcc0xcu71ZLwgUtaNJQEi1/pFOCkC6KsipNrMYPd+BP4gcGaAQ3vCU5pAid?= =?us-ascii?Q?YsEJDfL3rEXXh+Z6utYIWi+gU9BfxuGw9YsqcXGdjl1NMvGD52fw6eCB7Dnd?= =?us-ascii?Q?u9w8aVG06GEBmnoWFVtT4wkF2WBgGFpuSHMqUIrgEtRZoQHVnF6h4u7TEAqT?= =?us-ascii?Q?42VFm7EJdKa+6/r/cL9rfzm40AJgqlPYCHd0ydXyTzmTWsw531b8KsBWtgWP?= =?us-ascii?Q?GKhDRpLPpSU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PFHyOuM2Pu257ATKq7ASvVVCE6fxB6ruJi/NjfhQ/ytruYu0qVghjGqsr+i9cRf/irhDz67m3aAn1pPKlqqUUQp81IsRWWrPl73aFbMJ88tjBEXJWj8sLd9gyGgXyZcdNKzNTICVvMrH6AdFCEqA60hpwE+wlP X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 May 2017 14:44:32.3515 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0158 Subject: [PATCH v6 08/17] OvmfPkg: Add PlatformHasIoMmuLib 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: Fri, 26 May 2017 14:44:34 -0000 Content-Type: text/plain Add the shorter-term library instance outlined in the previous patch to OvmfPkg, so that we can imbue PciHostBridgeDxe with a protocol dependency on gEdkiiIoMmuProtocolGuid OR gIoMmuAbsentProtocolGuid. Cc: Jordan Justen Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.0 Suggested-by: Laszlo Ersek Signed-off-by: Brijesh Singh --- OvmfPkg/Library/PlatformHasIoMmuLib/PlatformHasIoMmuLib.inf | 37 ++++++++++++++++++++ OvmfPkg/Library/PlatformHasIoMmuLib/PlatformHasIoMmuLib.c | 32 +++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/OvmfPkg/Library/PlatformHasIoMmuLib/PlatformHasIoMmuLib.inf b/OvmfPkg/Library/PlatformHasIoMmuLib/PlatformHasIoMmuLib.inf new file mode 100644 index 000000000000..6d97293a3334 --- /dev/null +++ b/OvmfPkg/Library/PlatformHasIoMmuLib/PlatformHasIoMmuLib.inf @@ -0,0 +1,37 @@ +## @file +# A hook-in library for MdeModulePkg/Bus/Pci/PciHostBridgeDxe. +# +# Plugging this library instance into PciHostBridgeDxe makes +# EFI_IOMMU_PROTOCOL depend on the platform's dynamic decision whether +# to provide IOMMU implementation (usually through IoMmuDxe driver). +# +# Copyright (C) 2017, AMD, Inc. +# +# 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 IMPLIED. +## + +[Defines] + INF_VERSION = 1.25 + BASE_NAME = PlatformHasIoMmuLib + FILE_GUID = 49b4b018-0558-448b-1e1a-12226342877d + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = PlatformHasIoMmuLib|DXE_DRIVER + CONSTRUCTOR = PlatformHasIoMmuInitialize + +[Sources] + PlatformHasIoMmuLib.c + +[Packages] + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec + +[Depex] + gEdkiiIoMmuProtocolGuid OR gIoMmuAbsentProtocolGuid diff --git a/OvmfPkg/Library/PlatformHasIoMmuLib/PlatformHasIoMmuLib.c b/OvmfPkg/Library/PlatformHasIoMmuLib/PlatformHasIoMmuLib.c new file mode 100644 index 000000000000..9ead2637e2c8 --- /dev/null +++ b/OvmfPkg/Library/PlatformHasIoMmuLib/PlatformHasIoMmuLib.c @@ -0,0 +1,32 @@ +/** @file + A hook-in library for MdeModulePkg/Bus/Pci/PciHostBridgeDxe. + + Plugging this library instance into PciHostBridgeDxe makes + EFI_IOMMU_PROTOCOL depend on the platform's dynamic decision whether + to provide IOMMU implementation (usually through IoMmuDxe driver). + + Copyright (C) 2017, AMD, Inc. + + 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 IMPLIED. +**/ + +#include + +RETURN_STATUS +EFIAPI +PlatformHasIoMmuInitialize ( + VOID + ) +{ + // + // Do nothing, just imbue PciHostBridgeDxe with a protocol dependency on + // gIoMmuAbsentProtocolGuid OR gEdkiiIoMmuProtocolGuid. + // + return RETURN_SUCCESS; +} -- 2.7.4