|
@@ -22,14 +22,6 @@ struct paging_config {
|
|
|
/* Buffer to preserve trampoline memory */
|
|
|
static char trampoline_save[TRAMPOLINE_32BIT_SIZE];
|
|
|
|
|
|
-/*
|
|
|
- * The page table is going to be used instead of page table in the trampoline
|
|
|
- * memory.
|
|
|
- *
|
|
|
- * It must not be in BSS as BSS is cleared after cleanup_trampoline().
|
|
|
- */
|
|
|
-static char top_pgtable[PAGE_SIZE] __aligned(PAGE_SIZE) __section(.data);
|
|
|
-
|
|
|
/*
|
|
|
* Trampoline address will be printed by extract_kernel() for debugging
|
|
|
* purposes.
|
|
@@ -134,7 +126,7 @@ out:
|
|
|
return paging_config;
|
|
|
}
|
|
|
|
|
|
-void cleanup_trampoline(void)
|
|
|
+void cleanup_trampoline(void *pgtable)
|
|
|
{
|
|
|
void *trampoline_pgtable;
|
|
|
|
|
@@ -145,8 +137,8 @@ void cleanup_trampoline(void)
|
|
|
* if it's there.
|
|
|
*/
|
|
|
if ((void *)__native_read_cr3() == trampoline_pgtable) {
|
|
|
- memcpy(top_pgtable, trampoline_pgtable, PAGE_SIZE);
|
|
|
- native_write_cr3((unsigned long)top_pgtable);
|
|
|
+ memcpy(pgtable, trampoline_pgtable, PAGE_SIZE);
|
|
|
+ native_write_cr3((unsigned long)pgtable);
|
|
|
}
|
|
|
|
|
|
/* Restore trampoline memory */
|