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