[NTOS]: A PFN entry is not necessarily physical only if it is higher than MmHighestPhysicalPage. It can also be physical if it lies in a memory hole within the min-max physical page range. We can detect this by using our PFN Bitmap. So replace all "Is this an I/O mapping?" checks with a check on whether or not the PFN Database entry is NULL (which will check for us both of these statements). This ought to be a macro...

svn path=/trunk/; revision=47623
This commit is contained in:
Sir Richard
2010-06-06 14:15:18 +00:00
parent abefb827e7
commit aa574a3c90
3 changed files with 6 additions and 8 deletions
+3 -3
View File
@@ -90,8 +90,8 @@ MmMapIoSpace(IN PHYSICAL_ADDRESS PhysicalAddress,
// Also translate the cache attribute
//
Pfn = (PFN_NUMBER)(PhysicalAddress.QuadPart >> PAGE_SHIFT);
IsIoMapping = (Pfn > MmHighestPhysicalPage) ? TRUE : FALSE;
if (!IsIoMapping) Pfn1 = MiGetPfnEntry(Pfn);
Pfn1 = MiGetPfnEntry(Pfn);
IsIoMapping = (Pfn1 == NULL) ? TRUE : FALSE;
CacheAttribute = MiPlatformCacheAttributes[IsIoMapping][CacheType];
//
@@ -219,7 +219,7 @@ MmUnmapIoSpace(IN PVOID BaseAddress,
//
// Is this an I/O mapping?
//
if (Pfn > MmHighestPhysicalPage)
if (!MiGetPfnEntry(Pfn))
{
//
// Destroy the PTE
+1 -1
View File
@@ -129,7 +129,7 @@ MmBuildMdlForNonPagedPool(IN PMDL Mdl)
//
// Check if this is an I/O mapping
//
if (Pfn > MmHighestPhysicalPage) Mdl->MdlFlags |= MDL_IO_SPACE;
if (!MiGetPfnEntry(Pfn)) Mdl->MdlFlags |= MDL_IO_SPACE;
}
/*
+2 -4
View File
@@ -85,10 +85,8 @@ MiDbgTranslatePhysicalAddress(IN ULONG64 PhysicalAddress,
//
Pfn = (PFN_NUMBER)(PhysicalAddress >> PAGE_SHIFT);
//
// Check if this could be an I/O mapping
//
if (Pfn > MmHighestPhysicalPage)
/* Check if this could be an I/O mapping */
if (!MiGetPfnEntry(Pfn))
{
//
// FIXME: We don't support this yet