mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-17 19:27:28 +00:00
mmu: refine function break_page_table
function break_page_table should return next_level_page_size, if something wrong, it return 0. the change is valid for release version, as at that time ASSERT() in break_page_table is empty. Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
6454c7be6b
commit
cbcc7c0db3
@ -787,12 +787,12 @@ static uint64_t break_page_table(struct map_params *map_params, void *paddr,
|
|||||||
/* New entry present - need to allocate a new table */
|
/* New entry present - need to allocate a new table */
|
||||||
sub_tab_addr = alloc_paging_struct();
|
sub_tab_addr = alloc_paging_struct();
|
||||||
/* Check to ensure memory available for this structure */
|
/* Check to ensure memory available for this structure */
|
||||||
if (sub_tab_addr == 0) {
|
if (sub_tab_addr == NULL) {
|
||||||
/* Error:
|
/* Error:
|
||||||
* Unable to find table memory necessary to map memory
|
* Unable to find table memory necessary to map memory
|
||||||
*/
|
*/
|
||||||
pr_err("Fail to find table memory for map memory");
|
pr_err("Fail to find table memory for map memory");
|
||||||
ASSERT(sub_tab_addr == 0, "");
|
ASSERT(0, "fail to alloc table memory for map memory");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -900,6 +900,8 @@ static int modify_paging(struct map_params *map_params, void *paddr,
|
|||||||
*/
|
*/
|
||||||
page_size = break_page_table(map_params,
|
page_size = break_page_table(map_params,
|
||||||
paddr, vaddr, page_size, direct);
|
paddr, vaddr, page_size, direct);
|
||||||
|
if (page_size == 0)
|
||||||
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
page_size = ((uint64_t)remaining_size < page_size)
|
page_size = ((uint64_t)remaining_size < page_size)
|
||||||
|
Loading…
Reference in New Issue
Block a user