From e4a9bd6d91e829b5f42266943d5fb92fecd0a402 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 6 Dec 2018 19:23:07 -0500 Subject: Fixed off-by-one edge case in memory type assignment --- shvvmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shvvmx.c b/shvvmx.c index d7e9958..f2dc98f 100644 --- a/shvvmx.c +++ b/shvvmx.c @@ -96,7 +96,7 @@ ShvVmxMtrrAdjustEffectiveMemoryType ( // Check if this large page falls within the boundary. If a single // physical page (4KB) touches it, we need to override the entire 2MB. // - if (((LargePageAddress + _2MB) >= VpData->MtrrData[i].PhysicalAddressMin) && + if (((LargePageAddress + _2MB - 1) >= VpData->MtrrData[i].PhysicalAddressMin) && (LargePageAddress <= VpData->MtrrData[i].PhysicalAddressMax)) { // -- cgit v1.2.3