Commit 3412b6ae authored by Rusty Russell's avatar Rusty Russell

lguest: don't share Switcher PTE pages between guests.

We currently use the whole top PGD entry for the switcher, so we
simply share a fixed page of PTEs between all guests (actually, it's
one per Host CPU, to ensure isolation between guests).

Changes to a scheme where every guest has its own mappings.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent f1f394b1
...@@ -333,15 +333,10 @@ static int __init init(void) ...@@ -333,15 +333,10 @@ static int __init init(void)
if (err) if (err)
goto out; goto out;
/* Now we set up the pagetable implementation for the Guests. */
err = init_pagetables(lg_switcher_pages);
if (err)
goto unmap;
/* We might need to reserve an interrupt vector. */ /* We might need to reserve an interrupt vector. */
err = init_interrupts(); err = init_interrupts();
if (err) if (err)
goto free_pgtables; goto unmap;
/* /dev/lguest needs to be registered. */ /* /dev/lguest needs to be registered. */
err = lguest_device_init(); err = lguest_device_init();
...@@ -356,8 +351,6 @@ static int __init init(void) ...@@ -356,8 +351,6 @@ static int __init init(void)
free_interrupts: free_interrupts:
free_interrupts(); free_interrupts();
free_pgtables:
free_pagetables();
unmap: unmap:
unmap_switcher(); unmap_switcher();
out: out:
...@@ -369,7 +362,6 @@ static void __exit fini(void) ...@@ -369,7 +362,6 @@ static void __exit fini(void)
{ {
lguest_device_remove(); lguest_device_remove();
free_interrupts(); free_interrupts();
free_pagetables();
unmap_switcher(); unmap_switcher();
lguest_arch_host_fini(); lguest_arch_host_fini();
......
...@@ -14,9 +14,6 @@ ...@@ -14,9 +14,6 @@
#include <asm/lguest.h> #include <asm/lguest.h>
void free_pagetables(void);
int init_pagetables(struct page **switcher_pages);
struct pgdir { struct pgdir {
unsigned long gpgdir; unsigned long gpgdir;
pgd_t *pgdir; pgd_t *pgdir;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment