X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=IntelSiliconPkg%2FFeature%2FVTd%2FIntelVTdDxe%2FIntelVTdDxe.c;h=570b47cf73647a8b0e7e270a5f07847b2649c001;hp=89d9bea3fc0fdd5086ad6189e6ec87be36d39dd8;hb=3a71670618dfa463b3377b752858df7964ad038c;hpb=dcd39e09ff3dbec468152a32b343e68e6c87f4b6 diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/IntelVTdDxe.c b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/IntelVTdDxe.c index 89d9bea3fc..570b47cf73 100644 --- a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/IntelVTdDxe.c +++ b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/IntelVTdDxe.c @@ -12,16 +12,6 @@ **/ -#include - -#include -#include - -#include -#include -#include -#include - #include "DmaProtection.h" /** @@ -306,18 +296,22 @@ IoMmuSetAttribute ( EFI_STATUS Status; EFI_PHYSICAL_ADDRESS DeviceAddress; UINTN NumberOfPages; + EFI_TPL OriginalTpl; + + OriginalTpl = gBS->RaiseTPL (VTD_TPL_LEVEL); Status = GetDeviceInfoFromMapping (Mapping, &DeviceAddress, &NumberOfPages); - if (EFI_ERROR(Status)) { - return Status; + if (!EFI_ERROR(Status)) { + Status = VTdSetAttribute ( + This, + DeviceHandle, + DeviceAddress, + EFI_PAGES_TO_SIZE(NumberOfPages), + IoMmuAccess + ); } - Status = VTdSetAttribute ( - This, - DeviceHandle, - DeviceAddress, - EFI_PAGES_TO_SIZE(NumberOfPages), - IoMmuAccess - ); + + gBS->RestoreTPL (OriginalTpl); return Status; }