提交 5ab97b7f 编写于 作者: A Alex Rozenman 提交者: Anthony Liguori

phys_page_find_alloc: Use correct initial region_offset.

This fixes a common bug with initial region_offset value.
Usually, the pages are re-assigned afterwards, so the bug
has a very small effect on regular QEMU use flows.
Signed-off-by: NAlex Rozenman <Alex_Rozenman@mentor.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 885660bd
......@@ -418,6 +418,7 @@ static PhysPageDesc *phys_page_find_alloc(target_phys_addr_t index, int alloc)
pd = *lp;
if (pd == NULL) {
int i;
int first_index = index & ~(L2_SIZE - 1);
if (!alloc) {
return NULL;
......@@ -427,7 +428,7 @@ static PhysPageDesc *phys_page_find_alloc(target_phys_addr_t index, int alloc)
for (i = 0; i < L2_SIZE; i++) {
pd[i].phys_offset = IO_MEM_UNASSIGNED;
pd[i].region_offset = (index + i) << TARGET_PAGE_BITS;
pd[i].region_offset = (first_index + i) << TARGET_PAGE_BITS;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册