]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/IoMmuDxe/IoMmuDxe.c
UefiCpuPkg CpuCommFeaturesLib: Fix GP fault issue about ProcTrace
[mirror_edk2.git] / OvmfPkg / IoMmuDxe / IoMmuDxe.c
CommitLineData
f9d129e6
BS
1/** @file\r
2\r
3 IoMmuDxe driver installs EDKII_IOMMU_PROTOCOL to provide the support for DMA\r
4 operations when SEV is enabled.\r
5\r
6 Copyright (c) 2017, AMD Inc. All rights reserved.<BR>\r
7\r
b26f0cf9 8 SPDX-License-Identifier: BSD-2-Clause-Patent\r
f9d129e6
BS
9\r
10**/\r
11\r
f9d129e6
BS
12#include "AmdSevIoMmu.h"\r
13\r
14EFI_STATUS\r
15EFIAPI\r
16IoMmuDxeEntryPoint (\r
17 IN EFI_HANDLE ImageHandle,\r
18 IN EFI_SYSTEM_TABLE *SystemTable\r
19 )\r
20{\r
5e365a97
LE
21 EFI_STATUS Status;\r
22 EFI_HANDLE Handle;\r
23\r
f9d129e6
BS
24 //\r
25 // When SEV is enabled, install IoMmu protocol otherwise install the\r
26 // placeholder protocol so that other dependent module can run.\r
27 //\r
28 if (MemEncryptSevIsEnabled ()) {\r
db125079 29 Status = AmdSevInstallIoMmuProtocol ();\r
f9d129e6 30 } else {\r
5e365a97
LE
31 Handle = NULL;\r
32\r
f9d129e6
BS
33 Status = gBS->InstallMultipleProtocolInterfaces (\r
34 &Handle,\r
35 &gIoMmuAbsentProtocolGuid,\r
36 NULL, NULL);\r
37 }\r
38\r
39 return Status;\r
40}\r