]> git.proxmox.com Git - mirror_edk2.git/blame - IntelSiliconPkg/Feature/VTd/IntelVTdDxe/DmaProtection.h
IntelSiliconPkg VTdDxe: Report status code for VTd error
[mirror_edk2.git] / IntelSiliconPkg / Feature / VTd / IntelVTdDxe / DmaProtection.h
CommitLineData
c049fc99
JY
1/** @file\r
2\r
0bc94c74 3 Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>\r
c049fc99
JY
4 This program and the accompanying materials\r
5 are licensed and made available under the terms and conditions of the BSD License\r
6 which accompanies this distribution. The full text of the license may be found at\r
7 http://opensource.org/licenses/bsd-license.php.\r
8\r
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
11\r
12**/\r
13\r
14#ifndef _DMAR_PROTECTION_H_\r
15#define _DMAR_PROTECTION_H_\r
16\r
17#include <Uefi.h>\r
18#include <PiDxe.h>\r
19\r
20#include <Library/BaseLib.h>\r
21#include <Library/BaseMemoryLib.h>\r
22#include <Library/MemoryAllocationLib.h>\r
23#include <Library/UefiBootServicesTableLib.h>\r
24#include <Library/IoLib.h>\r
25#include <Library/PciSegmentLib.h>\r
26#include <Library/DebugLib.h>\r
27#include <Library/UefiLib.h>\r
4ad5f597
JY
28#include <Library/CacheMaintenanceLib.h>\r
29#include <Library/PerformanceLib.h>\r
30#include <Library/PrintLib.h>\r
27bf6712 31#include <Library/ReportStatusCodeLib.h>\r
c049fc99
JY
32\r
33#include <Guid/EventGroup.h>\r
34#include <Guid/Acpi.h>\r
35\r
36#include <Protocol/DxeSmmReadyToLock.h>\r
37#include <Protocol/PciRootBridgeIo.h>\r
38#include <Protocol/PciIo.h>\r
39#include <Protocol/PciEnumerationComplete.h>\r
c049fc99
JY
40#include <Protocol/PlatformVtdPolicy.h>\r
41#include <Protocol/IoMmu.h>\r
42\r
43#include <IndustryStandard/Pci.h>\r
44#include <IndustryStandard/DmaRemappingReportingTable.h>\r
45#include <IndustryStandard/Vtd.h>\r
46\r
76c6f69c
SZ
47#define VTD_64BITS_ADDRESS(Lo, Hi) (LShiftU64 (Lo, 12) | LShiftU64 (Hi, 32))\r
48\r
c049fc99
JY
49#define ALIGN_VALUE_UP(Value, Alignment) (((Value) + (Alignment) - 1) & (~((Alignment) - 1)))\r
50#define ALIGN_VALUE_LOW(Value, Alignment) ((Value) & (~((Alignment) - 1)))\r
51\r
3a716706
SZ
52#define VTD_TPL_LEVEL TPL_NOTIFY\r
53\r
c049fc99 54//\r
f77d35c7 55// This is the initial max PCI DATA number.\r
c049fc99
JY
56// The number may be enlarged later.\r
57//\r
f77d35c7 58#define MAX_VTD_PCI_DATA_NUMBER 0x100\r
c049fc99
JY
59\r
60typedef struct {\r
f77d35c7
JY
61 UINT8 DeviceType;\r
62 VTD_SOURCE_ID PciSourceId;\r
63 EDKII_PLATFORM_VTD_PCI_DEVICE_ID PciDeviceId;\r
4ad5f597 64 // for statistic analysis\r
f77d35c7
JY
65 UINTN AccessCount;\r
66} PCI_DEVICE_DATA;\r
67\r
68typedef struct {\r
69 BOOLEAN IncludeAllFlag;\r
70 UINTN PciDeviceDataNumber;\r
71 UINTN PciDeviceDataMaxNumber;\r
72 PCI_DEVICE_DATA *PciDeviceData;\r
c049fc99
JY
73} PCI_DEVICE_INFORMATION;\r
74\r
75typedef struct {\r
76 UINTN VtdUnitBaseAddress;\r
77 UINT16 Segment;\r
78 VTD_CAP_REG CapReg;\r
79 VTD_ECAP_REG ECapReg;\r
80 VTD_ROOT_ENTRY *RootEntryTable;\r
81 VTD_EXT_ROOT_ENTRY *ExtRootEntryTable;\r
82 VTD_SECOND_LEVEL_PAGING_ENTRY *FixedSecondLevelPagingEntry;\r
4ad5f597 83 BOOLEAN HasDirtyContext;\r
c049fc99
JY
84 BOOLEAN HasDirtyPages;\r
85 PCI_DEVICE_INFORMATION PciDeviceInfo;\r
86} VTD_UNIT_INFORMATION;\r
87\r
0bc94c74
SZ
88//\r
89// This is the initial max ACCESS request.\r
90// The number may be enlarged later.\r
91//\r
92#define MAX_VTD_ACCESS_REQUEST 0x100\r
93\r
94typedef struct {\r
95 UINT16 Segment;\r
96 VTD_SOURCE_ID SourceId;\r
97 UINT64 BaseAddress;\r
98 UINT64 Length;\r
99 UINT64 IoMmuAccess;\r
100} VTD_ACCESS_REQUEST;\r
101\r
102\r
f77d35c7
JY
103/**\r
104 The scan bus callback function.\r
105\r
106 It is called in PCI bus scan for each PCI device under the bus.\r
107\r
108 @param[in] Context The context of the callback.\r
109 @param[in] Segment The segment of the source.\r
110 @param[in] Bus The bus of the source.\r
111 @param[in] Device The device of the source.\r
112 @param[in] Function The function of the source.\r
113\r
114 @retval EFI_SUCCESS The specific PCI device is processed in the callback.\r
115**/\r
116typedef\r
117EFI_STATUS\r
118(EFIAPI *SCAN_BUS_FUNC_CALLBACK_FUNC) (\r
119 IN VOID *Context,\r
120 IN UINT16 Segment,\r
121 IN UINT8 Bus,\r
122 IN UINT8 Device,\r
123 IN UINT8 Function\r
124 );\r
125\r
c049fc99
JY
126extern EFI_ACPI_DMAR_HEADER *mAcpiDmarTable;\r
127\r
c049fc99
JY
128extern UINTN mVtdUnitNumber;\r
129extern VTD_UNIT_INFORMATION *mVtdUnitInformation;\r
130\r
131extern UINT64 mBelow4GMemoryLimit;\r
132extern UINT64 mAbove4GMemoryLimit;\r
133\r
134extern EDKII_PLATFORM_VTD_POLICY_PROTOCOL *mPlatformVTdPolicy;\r
135\r
136/**\r
137 Prepare VTD configuration.\r
138**/\r
139VOID\r
140PrepareVtdConfig (\r
141 VOID\r
142 );\r
143\r
144/**\r
145 Setup VTd translation table.\r
146\r
147 @retval EFI_SUCCESS Setup translation table successfully.\r
148 @retval EFI_OUT_OF_RESOURCE Setup translation table fail.\r
149**/\r
150EFI_STATUS\r
151SetupTranslationTable (\r
152 VOID\r
153 );\r
154\r
155/**\r
156 Enable DMAR translation.\r
157\r
158 @retval EFI_SUCCESS DMAR translation is enabled.\r
159 @retval EFI_DEVICE_ERROR DMAR translation is not enabled.\r
160**/\r
161EFI_STATUS\r
162EnableDmar (\r
163 VOID\r
164 );\r
165\r
166/**\r
167 Disable DMAR translation.\r
168\r
169 @retval EFI_SUCCESS DMAR translation is disabled.\r
170 @retval EFI_DEVICE_ERROR DMAR translation is not disabled.\r
171**/\r
172EFI_STATUS\r
173DisableDmar (\r
174 VOID\r
175 );\r
176\r
c049fc99
JY
177/**\r
178 Invalid VTd global IOTLB.\r
179\r
180 @param[in] VtdIndex The index of VTd engine.\r
181\r
182 @retval EFI_SUCCESS VTd global IOTLB is invalidated.\r
183 @retval EFI_DEVICE_ERROR VTd global IOTLB is not invalidated.\r
184**/\r
185EFI_STATUS\r
186InvalidateVtdIOTLBGlobal (\r
187 IN UINTN VtdIndex\r
188 );\r
189\r
190/**\r
191 Dump VTd registers.\r
192\r
193 @param[in] VtdIndex The index of VTd engine.\r
194**/\r
195VOID\r
196DumpVtdRegs (\r
197 IN UINTN VtdIndex\r
198 );\r
199\r
200/**\r
201 Dump VTd registers for all VTd engine.\r
202**/\r
203VOID\r
204DumpVtdRegsAll (\r
205 VOID\r
206 );\r
207\r
208/**\r
209 Dump VTd capability registers.\r
210\r
211 @param[in] CapReg The capability register.\r
212**/\r
213VOID\r
214DumpVtdCapRegs (\r
215 IN VTD_CAP_REG *CapReg\r
216 );\r
217\r
218/**\r
219 Dump VTd extended capability registers.\r
220\r
221 @param[in] ECapReg The extended capability register.\r
222**/\r
223VOID\r
224DumpVtdECapRegs (\r
225 IN VTD_ECAP_REG *ECapReg\r
226 );\r
227\r
228/**\r
f77d35c7 229 Register PCI device to VTd engine.\r
c049fc99
JY
230\r
231 @param[in] VtdIndex The index of VTd engine.\r
232 @param[in] Segment The segment of the source.\r
233 @param[in] SourceId The SourceId of the source.\r
f77d35c7 234 @param[in] DeviceType The DMAR device scope type.\r
c049fc99
JY
235 @param[in] CheckExist TRUE: ERROR will be returned if the PCI device is already registered.\r
236 FALSE: SUCCESS will be returned if the PCI device is registered.\r
237\r
238 @retval EFI_SUCCESS The PCI device is registered.\r
239 @retval EFI_OUT_OF_RESOURCES No enough resource to register a new PCI device.\r
240 @retval EFI_ALREADY_STARTED The device is already registered.\r
241**/\r
242EFI_STATUS\r
243RegisterPciDevice (\r
244 IN UINTN VtdIndex,\r
245 IN UINT16 Segment,\r
246 IN VTD_SOURCE_ID SourceId,\r
f77d35c7 247 IN UINT8 DeviceType,\r
c049fc99
JY
248 IN BOOLEAN CheckExist\r
249 );\r
250\r
251/**\r
f77d35c7 252 The scan bus callback function to always enable page attribute.\r
c049fc99 253\r
f77d35c7 254 @param[in] Context The context of the callback.\r
c049fc99
JY
255 @param[in] Segment The segment of the source.\r
256 @param[in] Bus The bus of the source.\r
f77d35c7
JY
257 @param[in] Device The device of the source.\r
258 @param[in] Function The function of the source.\r
c049fc99 259\r
f77d35c7 260 @retval EFI_SUCCESS The VTd entry is updated to always enable all DMA access for the specific device.\r
c049fc99
JY
261**/\r
262EFI_STATUS\r
f77d35c7
JY
263EFIAPI\r
264ScanBusCallbackRegisterPciDevice (\r
265 IN VOID *Context,\r
c049fc99 266 IN UINT16 Segment,\r
f77d35c7
JY
267 IN UINT8 Bus,\r
268 IN UINT8 Device,\r
269 IN UINT8 Function\r
270 );\r
271\r
272/**\r
273 Scan PCI bus and invoke callback function for each PCI devices under the bus.\r
274\r
275 @param[in] Context The context of the callback function.\r
276 @param[in] Segment The segment of the source.\r
277 @param[in] Bus The bus of the source.\r
278 @param[in] Callback The callback function in PCI scan.\r
279\r
280 @retval EFI_SUCCESS The PCI devices under the bus are scaned.\r
281**/\r
282EFI_STATUS\r
283ScanPciBus (\r
284 IN VOID *Context,\r
285 IN UINT16 Segment,\r
286 IN UINT8 Bus,\r
287 IN SCAN_BUS_FUNC_CALLBACK_FUNC Callback\r
c049fc99
JY
288 );\r
289\r
290/**\r
291 Dump the PCI device information managed by this VTd engine.\r
292\r
293 @param[in] VtdIndex The index of VTd engine.\r
294**/\r
295VOID\r
296DumpPciDeviceInfo (\r
297 IN UINTN VtdIndex\r
298 );\r
299\r
300/**\r
301 Find the VTd index by the Segment and SourceId.\r
302\r
303 @param[in] Segment The segment of the source.\r
304 @param[in] SourceId The SourceId of the source.\r
305 @param[out] ExtContextEntry The ExtContextEntry of the source.\r
306 @param[out] ContextEntry The ContextEntry of the source.\r
307\r
f77d35c7
JY
308 @return The index of the VTd engine.\r
309 @retval (UINTN)-1 The VTd engine is not found.\r
c049fc99
JY
310**/\r
311UINTN\r
312FindVtdIndexByPciDevice (\r
313 IN UINT16 Segment,\r
314 IN VTD_SOURCE_ID SourceId,\r
315 OUT VTD_EXT_CONTEXT_ENTRY **ExtContextEntry,\r
316 OUT VTD_CONTEXT_ENTRY **ContextEntry\r
317 );\r
318\r
319/**\r
320 Get the DMAR ACPI table.\r
321\r
7729e3c4
SZ
322 @retval EFI_SUCCESS The DMAR ACPI table is got.\r
323 @retval EFI_ALREADY_STARTED The DMAR ACPI table has been got previously.\r
324 @retval EFI_NOT_FOUND The DMAR ACPI table is not found.\r
c049fc99
JY
325**/\r
326EFI_STATUS\r
327GetDmarAcpiTable (\r
328 VOID\r
329 );\r
330\r
331/**\r
332 Parse DMAR DRHD table.\r
333\r
334 @return EFI_SUCCESS The DMAR DRHD table is parsed.\r
335**/\r
336EFI_STATUS\r
337ParseDmarAcpiTableDrhd (\r
338 VOID\r
339 );\r
340\r
341/**\r
342 Parse DMAR RMRR table.\r
343\r
344 @return EFI_SUCCESS The DMAR RMRR table is parsed.\r
345**/\r
346EFI_STATUS\r
347ParseDmarAcpiTableRmrr (\r
348 VOID\r
349 );\r
350\r
351/**\r
352 Dump DMAR context entry table.\r
353\r
354 @param[in] RootEntry DMAR root entry.\r
355**/\r
356VOID\r
357DumpDmarContextEntryTable (\r
358 IN VTD_ROOT_ENTRY *RootEntry\r
359 );\r
360\r
361/**\r
362 Dump DMAR extended context entry table.\r
363\r
364 @param[in] ExtRootEntry DMAR extended root entry.\r
365**/\r
366VOID\r
367DumpDmarExtContextEntryTable (\r
368 IN VTD_EXT_ROOT_ENTRY *ExtRootEntry\r
369 );\r
370\r
371/**\r
372 Dump DMAR second level paging entry.\r
373\r
374 @param[in] SecondLevelPagingEntry The second level paging entry.\r
375**/\r
376VOID\r
377DumpSecondLevelPagingEntry (\r
378 IN VOID *SecondLevelPagingEntry\r
379 );\r
380\r
381/**\r
382 Set VTd attribute for a system memory.\r
383\r
384 @param[in] VtdIndex The index used to identify a VTd engine.\r
d654bf85 385 @param[in] DomainIdentifier The domain ID of the source.\r
c049fc99
JY
386 @param[in] SecondLevelPagingEntry The second level paging entry in VTd table for the device.\r
387 @param[in] BaseAddress The base of device memory address to be used as the DMA memory.\r
388 @param[in] Length The length of device memory address to be used as the DMA memory.\r
389 @param[in] IoMmuAccess The IOMMU access.\r
390\r
391 @retval EFI_SUCCESS The IoMmuAccess is set for the memory range specified by BaseAddress and Length.\r
392 @retval EFI_INVALID_PARAMETER BaseAddress is not IoMmu Page size aligned.\r
393 @retval EFI_INVALID_PARAMETER Length is not IoMmu Page size aligned.\r
394 @retval EFI_INVALID_PARAMETER Length is 0.\r
395 @retval EFI_INVALID_PARAMETER IoMmuAccess specified an illegal combination of access.\r
396 @retval EFI_UNSUPPORTED The bit mask of IoMmuAccess is not supported by the IOMMU.\r
397 @retval EFI_UNSUPPORTED The IOMMU does not support the memory range specified by BaseAddress and Length.\r
398 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to modify the IOMMU access.\r
399 @retval EFI_DEVICE_ERROR The IOMMU device reported an error while attempting the operation.\r
400**/\r
401EFI_STATUS\r
402SetPageAttribute (\r
403 IN UINTN VtdIndex,\r
4ad5f597 404 IN UINT16 DomainIdentifier,\r
c049fc99
JY
405 IN VTD_SECOND_LEVEL_PAGING_ENTRY *SecondLevelPagingEntry,\r
406 IN UINT64 BaseAddress,\r
407 IN UINT64 Length,\r
408 IN UINT64 IoMmuAccess\r
409 );\r
410\r
411/**\r
412 Set VTd attribute for a system memory.\r
413\r
414 @param[in] Segment The Segment used to identify a VTd engine.\r
415 @param[in] SourceId The SourceId used to identify a VTd engine and table entry.\r
416 @param[in] BaseAddress The base of device memory address to be used as the DMA memory.\r
417 @param[in] Length The length of device memory address to be used as the DMA memory.\r
418 @param[in] IoMmuAccess The IOMMU access.\r
419\r
420 @retval EFI_SUCCESS The IoMmuAccess is set for the memory range specified by BaseAddress and Length.\r
421 @retval EFI_INVALID_PARAMETER BaseAddress is not IoMmu Page size aligned.\r
422 @retval EFI_INVALID_PARAMETER Length is not IoMmu Page size aligned.\r
423 @retval EFI_INVALID_PARAMETER Length is 0.\r
424 @retval EFI_INVALID_PARAMETER IoMmuAccess specified an illegal combination of access.\r
425 @retval EFI_UNSUPPORTED The bit mask of IoMmuAccess is not supported by the IOMMU.\r
426 @retval EFI_UNSUPPORTED The IOMMU does not support the memory range specified by BaseAddress and Length.\r
427 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to modify the IOMMU access.\r
428 @retval EFI_DEVICE_ERROR The IOMMU device reported an error while attempting the operation.\r
429**/\r
430EFI_STATUS\r
431SetAccessAttribute (\r
432 IN UINT16 Segment,\r
433 IN VTD_SOURCE_ID SourceId,\r
434 IN UINT64 BaseAddress,\r
435 IN UINT64 Length,\r
436 IN UINT64 IoMmuAccess\r
437 );\r
438\r
439/**\r
f77d35c7 440 Return the index of PCI data.\r
c049fc99
JY
441\r
442 @param[in] VtdIndex The index used to identify a VTd engine.\r
443 @param[in] Segment The Segment used to identify a VTd engine.\r
444 @param[in] SourceId The SourceId used to identify a VTd engine and table entry.\r
445\r
f77d35c7
JY
446 @return The index of the PCI data.\r
447 @retval (UINTN)-1 The PCI data is not found.\r
c049fc99
JY
448**/\r
449UINTN\r
f77d35c7 450GetPciDataIndex (\r
c049fc99
JY
451 IN UINTN VtdIndex,\r
452 IN UINT16 Segment,\r
453 IN VTD_SOURCE_ID SourceId\r
454 );\r
455\r
456/**\r
457 Dump VTd registers if there is error.\r
458**/\r
459VOID\r
460DumpVtdIfError (\r
461 VOID\r
462 );\r
463\r
464/**\r
465 Initialize platform VTd policy.\r
466**/\r
467VOID\r
468InitializePlatformVTdPolicy (\r
469 VOID\r
470 );\r
471\r
472/**\r
473 Always enable the VTd page attribute for the device.\r
474\r
475 @param[in] Segment The Segment used to identify a VTd engine.\r
476 @param[in] SourceId The SourceId used to identify a VTd engine and table entry.\r
477\r
478 @retval EFI_SUCCESS The VTd entry is updated to always enable all DMA access for the specific device.\r
479**/\r
480EFI_STATUS\r
481AlwaysEnablePageAttribute (\r
482 IN UINT16 Segment,\r
483 IN VTD_SOURCE_ID SourceId\r
484 );\r
485\r
486/**\r
487 Convert the DeviceHandle to SourceId and Segment.\r
488\r
489 @param[in] DeviceHandle The device who initiates the DMA access request.\r
490 @param[out] Segment The Segment used to identify a VTd engine.\r
491 @param[out] SourceId The SourceId used to identify a VTd engine and table entry.\r
492\r
493 @retval EFI_SUCCESS The Segment and SourceId are returned.\r
494 @retval EFI_INVALID_PARAMETER DeviceHandle is an invalid handle.\r
495 @retval EFI_UNSUPPORTED DeviceHandle is unknown by the IOMMU.\r
496**/\r
497EFI_STATUS\r
498DeviceHandleToSourceId (\r
499 IN EFI_HANDLE DeviceHandle,\r
500 OUT UINT16 *Segment,\r
501 OUT VTD_SOURCE_ID *SourceId\r
502 );\r
503\r
504/**\r
505 Get device information from mapping.\r
506\r
507 @param[in] Mapping The mapping.\r
508 @param[out] DeviceAddress The device address of the mapping.\r
509 @param[out] NumberOfPages The number of pages of the mapping.\r
510\r
511 @retval EFI_SUCCESS The device information is returned.\r
512 @retval EFI_INVALID_PARAMETER The mapping is invalid.\r
513**/\r
514EFI_STATUS\r
515GetDeviceInfoFromMapping (\r
516 IN VOID *Mapping,\r
517 OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,\r
518 OUT UINTN *NumberOfPages\r
519 );\r
520\r
521/**\r
522 Initialize DMA protection.\r
523**/\r
524VOID\r
525InitializeDmaProtection (\r
526 VOID\r
527 );\r
528\r
529/**\r
530 Allocate zero pages.\r
531\r
532 @param[in] Pages the number of pages.\r
533\r
534 @return the page address.\r
535 @retval NULL No resource to allocate pages.\r
536**/\r
537VOID *\r
538EFIAPI\r
539AllocateZeroPages (\r
540 IN UINTN Pages\r
541 );\r
542\r
4ad5f597
JY
543/**\r
544 Flush VTD page table and context table memory.\r
545\r
546 This action is to make sure the IOMMU engine can get final data in memory.\r
547\r
548 @param[in] VtdIndex The index used to identify a VTd engine.\r
549 @param[in] Base The base address of memory to be flushed.\r
550 @param[in] Size The size of memory in bytes to be flushed.\r
551**/\r
552VOID\r
553FlushPageTableMemory (\r
554 IN UINTN VtdIndex,\r
555 IN UINTN Base,\r
556 IN UINTN Size\r
557 );\r
558\r
f77d35c7
JY
559/**\r
560 Get PCI device information from DMAR DevScopeEntry.\r
561\r
562 @param[in] Segment The segment number.\r
563 @param[in] DmarDevScopeEntry DMAR DevScopeEntry\r
564 @param[out] Bus The bus number.\r
565 @param[out] Device The device number.\r
566 @param[out] Function The function number.\r
567\r
568 @retval EFI_SUCCESS The PCI device information is returned.\r
569**/\r
570EFI_STATUS\r
571GetPciBusDeviceFunction (\r
572 IN UINT16 Segment,\r
573 IN EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER *DmarDevScopeEntry,\r
574 OUT UINT8 *Bus,\r
575 OUT UINT8 *Device,\r
576 OUT UINT8 *Function\r
577 );\r
578\r
0bc94c74
SZ
579/**\r
580 Append VTd Access Request to global.\r
581\r
582 @param[in] Segment The Segment used to identify a VTd engine.\r
583 @param[in] SourceId The SourceId used to identify a VTd engine and table entry.\r
584 @param[in] BaseAddress The base of device memory address to be used as the DMA memory.\r
585 @param[in] Length The length of device memory address to be used as the DMA memory.\r
586 @param[in] IoMmuAccess The IOMMU access.\r
587\r
588 @retval EFI_SUCCESS The IoMmuAccess is set for the memory range specified by BaseAddress and Length.\r
589 @retval EFI_INVALID_PARAMETER BaseAddress is not IoMmu Page size aligned.\r
590 @retval EFI_INVALID_PARAMETER Length is not IoMmu Page size aligned.\r
591 @retval EFI_INVALID_PARAMETER Length is 0.\r
592 @retval EFI_INVALID_PARAMETER IoMmuAccess specified an illegal combination of access.\r
593 @retval EFI_UNSUPPORTED The bit mask of IoMmuAccess is not supported by the IOMMU.\r
594 @retval EFI_UNSUPPORTED The IOMMU does not support the memory range specified by BaseAddress and Length.\r
595 @retval EFI_OUT_OF_RESOURCES There are not enough resources available to modify the IOMMU access.\r
596 @retval EFI_DEVICE_ERROR The IOMMU device reported an error while attempting the operation.\r
597\r
598**/\r
599EFI_STATUS\r
600RequestAccessAttribute (\r
601 IN UINT16 Segment,\r
602 IN VTD_SOURCE_ID SourceId,\r
603 IN UINT64 BaseAddress,\r
604 IN UINT64 Length,\r
605 IN UINT64 IoMmuAccess\r
606 );\r
607\r
c049fc99 608#endif\r