mirror of
https://github.com/drasko/codezero.git
synced 2026-01-19 22:33:15 +01:00
Adding support for refcounted page tables. Fixed freeing of kernel pmds on copy_page_tables
This commit is contained in:
@@ -460,9 +460,11 @@ pgd_table_t *copy_page_tables(pgd_table_t *from)
|
||||
return pgd;
|
||||
|
||||
out_error:
|
||||
/* Find all allocated pmds and free them */
|
||||
/* Find all allocated non-kernel pmds and free them */
|
||||
for (int i = 0; i < PGD_ENTRY_TOTAL; i++) {
|
||||
if ((pgd->entry[i] & PGD_TYPE_MASK) == PGD_TYPE_COARSE) {
|
||||
/* Non-kernel pmd that has just been allocated. */
|
||||
if (!is_kern_pgdi(i) &&
|
||||
(pgd->entry[i] & PGD_TYPE_MASK) == PGD_TYPE_COARSE) {
|
||||
/* Obtain the pmd handle */
|
||||
pmd = (pmd_table_t *)
|
||||
phys_to_virt((pgd->entry[i] &
|
||||
|
||||
Reference in New Issue
Block a user