diff --git a/devicemodel/hw/platform/acpi/rtct.c b/devicemodel/hw/platform/acpi/rtct.c index 169319674..8fc66d2aa 100644 --- a/devicemodel/hw/platform/acpi/rtct.c +++ b/devicemodel/hw/platform/acpi/rtct.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -203,6 +204,14 @@ static void remap_software_sram_regions(struct acpi_table_hdr *vrtct, int rtct_v } pr_info("%s, hpa_bottom:%lx, hpa_top:%lx.\n", __func__, hpa_bottom, hpa_top); + if (((hpa_bottom & ~PAGE_MASK) != 0) || ((hpa_top & ~PAGE_MASK) != 0)) { + pr_warn("%s, Warning: hpa_bottom:%lx OR hpa_top:%lx is not page-aligned!\n", + __func__, hpa_bottom, hpa_top); + + hpa_bottom &= PAGE_MASK; + hpa_top &= PAGE_MASK; + } + software_sram_base_hpa = hpa_bottom; software_sram_size = hpa_top - hpa_bottom;