HV: [v2] bugfix in 'hv_access_memory_region_update()'

- bugfix:the actual 'size' of memory region that
    to be updated is incorrect.

  - replace CONFIG_UEFI_STUB with DMAR_PARSE_ENABLED
    when update memory pages for ACPI_RECLAIM region,
    as DMAR_PARSE_ENABLED may be enabled on non-EFI
    platform.

V2 update:
    wrap roundup to 2M and rounddown to 2M inline
    functions.

Tracked-On: #2056
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
Yonghua Huang
2018-12-19 18:12:45 +08:00
committed by wenlingz
parent 59c6140347
commit 3998c97756
2 changed files with 25 additions and 11 deletions

View File

@@ -45,6 +45,7 @@
#include <cpu.h>
#include <page.h>
#include <pgtable.h>
/* Define cache line size (in bytes) */
#define CACHE_LINE_SIZE 64U
@@ -65,6 +66,16 @@ static inline uint64_t round_page_down(uint64_t addr)
return (addr & PAGE_MASK);
}
static inline uint64_t round_pde_up(uint64_t val)
{
return (((val + (uint64_t)PDE_SIZE) - 1UL) & PDE_MASK);
}
static inline uint64_t round_pde_down(uint64_t val)
{
return (val & PDE_MASK);
}
/**
* @brief Page tables level in IA32 paging mode
*/