search for: demand_page

Displaying 20 results from an estimated 26 matches for "demand_page".

2007 Apr 30
0
[PATCH] lguest: properly kill guest userspace programs accessing kernel mem
..., 10 insertions(+), 6 deletions(-) =================================================================== --- a/drivers/lguest/core.c +++ b/drivers/lguest/core.c @@ -346,7 +346,7 @@ int run_guest(struct lguest *lg, char *_ } break; case 14: /* We've intercepted a page fault. */ - if (demand_page(lg, cr2, lg->regs->errcode & 2)) + if (demand_page(lg, cr2, lg->regs->errcode)) continue; /* If lguest_data is NULL, this won't hurt. */ =================================================================== --- a/drivers/lguest/lg.h +++ b/drivers/lguest/lg.h @@ -216,7...
2007 Apr 30
0
[PATCH] lguest: properly kill guest userspace programs accessing kernel mem
..., 10 insertions(+), 6 deletions(-) =================================================================== --- a/drivers/lguest/core.c +++ b/drivers/lguest/core.c @@ -346,7 +346,7 @@ int run_guest(struct lguest *lg, char *_ } break; case 14: /* We've intercepted a page fault. */ - if (demand_page(lg, cr2, lg->regs->errcode & 2)) + if (demand_page(lg, cr2, lg->regs->errcode)) continue; /* If lguest_data is NULL, this won't hurt. */ =================================================================== --- a/drivers/lguest/lg.h +++ b/drivers/lguest/lg.h @@ -216,7...
2009 Sep 21
1
[PATCH 2/5] lguest: use set_pte/set_pmd uniformly for real page table entries
...-- drivers/lguest/page_tables.c | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/drivers/lguest/page_tables.c b/drivers/lguest/page_tables.c --- a/drivers/lguest/page_tables.c +++ b/drivers/lguest/page_tables.c @@ -380,7 +380,7 @@ bool demand_page(struct lg_cpu *cpu, uns * And we copy the flags to the shadow PMD entry. The page * number in the shadow PMD is the page we just allocated. */ - native_set_pmd(spmd, __pmd(__pa(ptepage) | pmd_flags(gpmd))); + set_pmd(spmd, __pmd(__pa(ptepage) | pmd_flags(gpmd))); } /* @@ -447,7...
2009 Sep 21
1
[PATCH 2/5] lguest: use set_pte/set_pmd uniformly for real page table entries
...-- drivers/lguest/page_tables.c | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/drivers/lguest/page_tables.c b/drivers/lguest/page_tables.c --- a/drivers/lguest/page_tables.c +++ b/drivers/lguest/page_tables.c @@ -380,7 +380,7 @@ bool demand_page(struct lg_cpu *cpu, uns * And we copy the flags to the shadow PMD entry. The page * number in the shadow PMD is the page we just allocated. */ - native_set_pmd(spmd, __pmd(__pa(ptepage) | pmd_flags(gpmd))); + set_pmd(spmd, __pmd(__pa(ptepage) | pmd_flags(gpmd))); } /* @@ -447,7...
2009 Mar 26
1
[PATCH 3/5] lguest: avoid accidental recycling of pgdir pages
...ers/lguest/lg.h index 5faefea..363c231 100644 --- a/drivers/lguest/lg.h +++ b/drivers/lguest/lg.h @@ -174,6 +174,7 @@ void guest_set_pte(struct lg_cpu *cpu, unsigned long gpgdir, unsigned long vaddr, pte_t val); void map_switcher_in_guest(struct lg_cpu *cpu, struct lguest_pages *pages); int demand_page(struct lg_cpu *cpu, unsigned long cr2, int errcode); +void invalidate_pagetable(struct lg_cpu *cpu, unsigned long pgtable); void pin_page(struct lg_cpu *cpu, unsigned long vaddr); unsigned long guest_pa(struct lg_cpu *cpu, unsigned long vaddr); void page_table_guest_data_init(struct lg_cpu *cpu)...
2009 Mar 26
1
[PATCH 3/5] lguest: avoid accidental recycling of pgdir pages
...ers/lguest/lg.h index 5faefea..363c231 100644 --- a/drivers/lguest/lg.h +++ b/drivers/lguest/lg.h @@ -174,6 +174,7 @@ void guest_set_pte(struct lg_cpu *cpu, unsigned long gpgdir, unsigned long vaddr, pte_t val); void map_switcher_in_guest(struct lg_cpu *cpu, struct lguest_pages *pages); int demand_page(struct lg_cpu *cpu, unsigned long cr2, int errcode); +void invalidate_pagetable(struct lg_cpu *cpu, unsigned long pgtable); void pin_page(struct lg_cpu *cpu, unsigned long vaddr); unsigned long guest_pa(struct lg_cpu *cpu, unsigned long vaddr); void page_table_guest_data_init(struct lg_cpu *cpu)...
2009 Jun 05
1
[PATCH] lguest: PAE support
...u *cpu, pmd_t gpmd) +{ + if ((pmd_flags(gpmd) & ~_PAGE_TABLE) || + (pmd_pfn(gpmd) >= cpu->lg->pfn_limit)) + kill_guest(cpu, "bad page middle directory entry"); +} +#endif + /*H:330 * (i) Looking up a page table entry when the Guest faults. * @@ -207,6 +283,11 @@ bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode) pte_t gpte; pte_t *spte; +#ifdef CONFIG_X86_PAE + pmd_t *spmd; + pmd_t gpmd; +#endif + /* First step: get the top-level Guest page table entry. */ gpgd = lgread(cpu, gpgd_addr(cpu, vaddr), pgd_t); /* Toplevel not present? We can'...
2009 Jun 05
1
[PATCH] lguest: PAE support
...u *cpu, pmd_t gpmd) +{ + if ((pmd_flags(gpmd) & ~_PAGE_TABLE) || + (pmd_pfn(gpmd) >= cpu->lg->pfn_limit)) + kill_guest(cpu, "bad page middle directory entry"); +} +#endif + /*H:330 * (i) Looking up a page table entry when the Guest faults. * @@ -207,6 +283,11 @@ bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode) pte_t gpte; pte_t *spte; +#ifdef CONFIG_X86_PAE + pmd_t *spmd; + pmd_t gpmd; +#endif + /* First step: get the top-level Guest page table entry. */ gpgd = lgread(cpu, gpgd_addr(cpu, vaddr), pgd_t); /* Toplevel not present? We can'...
2009 Apr 16
1
NULL pointer dereference at __switch_to() ( __unlazy_fpu ) with lguest PAE patch
...u *cpu, pmd_t gpmd) +{ + if ((pmd_flags(gpmd) & ~_PAGE_TABLE) || + (pmd_pfn(gpmd) >= cpu->lg->pfn_limit)) + kill_guest(cpu, "bad page middle directory entry"); +} +#endif + /*H:330 * (i) Looking up a page table entry when the Guest faults. * @@ -207,8 +279,14 @@ bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode) pte_t gpte; pte_t *spte; +#ifdef CONFIG_X86_PAE + pmd_t *spmd; + pmd_t gpmd; +#endif + /* First step: get the top-level Guest page table entry. */ - gpgd = lgread(cpu, gpgd_addr(cpu, vaddr), pgd_t); + gpgd = lgread(cpu, (unsigned long) g...
2009 Apr 16
1
NULL pointer dereference at __switch_to() ( __unlazy_fpu ) with lguest PAE patch
...u *cpu, pmd_t gpmd) +{ + if ((pmd_flags(gpmd) & ~_PAGE_TABLE) || + (pmd_pfn(gpmd) >= cpu->lg->pfn_limit)) + kill_guest(cpu, "bad page middle directory entry"); +} +#endif + /*H:330 * (i) Looking up a page table entry when the Guest faults. * @@ -207,8 +279,14 @@ bool demand_page(struct lg_cpu *cpu, unsigned long vaddr, int errcode) pte_t gpte; pte_t *spte; +#ifdef CONFIG_X86_PAE + pmd_t *spmd; + pmd_t gpmd; +#endif + /* First step: get the top-level Guest page table entry. */ - gpgd = lgread(cpu, gpgd_addr(cpu, vaddr), pgd_t); + gpgd = lgread(cpu, (unsigned long) g...
2008 Jan 17
1
[PATCH 0/7] More lguest massage.
This series takes one more step towards cpu-ification of lguest. As for rusty's last suggestion, I get rid of the whole bunch of "struct lguest *lg = cpu->lg" statements around by using lg_cpu as our base structure wherever it matters. (this saves us 11 lines)
2008 Jan 17
1
[PATCH 0/7] More lguest massage.
This series takes one more step towards cpu-ification of lguest. As for rusty's last suggestion, I get rid of the whole bunch of "struct lguest *lg = cpu->lg" statements around by using lg_cpu as our base structure wherever it matters. (this saves us 11 lines)
2007 Apr 27
0
[PATCH] lguest simplification: don't pin guest trap handlers
...================================================================== --- a/drivers/lguest/page_tables.c +++ b/drivers/lguest/page_tables.c @@ -186,7 +186,7 @@ void pin_page(struct lguest *lg, unsigne void pin_page(struct lguest *lg, unsigned long vaddr) { if (!page_writable(lg, vaddr) && !demand_page(lg, vaddr, 0)) - kill_guest(lg, "bad trap page %#lx", vaddr); + kill_guest(lg, "bad stack page %#lx", vaddr); } static void release_pgd(struct lguest *lg, spgd_t *spgd) @@ -253,7 +253,7 @@ void guest_new_pagetable(struct lguest * newpgdir = new_pgdir(lg, pgtable, &r...
2007 Apr 27
0
[PATCH] lguest simplification: don't pin guest trap handlers
...================================================================== --- a/drivers/lguest/page_tables.c +++ b/drivers/lguest/page_tables.c @@ -186,7 +186,7 @@ void pin_page(struct lguest *lg, unsigne void pin_page(struct lguest *lg, unsigned long vaddr) { if (!page_writable(lg, vaddr) && !demand_page(lg, vaddr, 0)) - kill_guest(lg, "bad trap page %#lx", vaddr); + kill_guest(lg, "bad stack page %#lx", vaddr); } static void release_pgd(struct lguest *lg, spgd_t *spgd) @@ -253,7 +253,7 @@ void guest_new_pagetable(struct lguest * newpgdir = new_pgdir(lg, pgtable, &r...
2007 Apr 18
1
[PATCH] Lguest32, use guest page tables to find paddr for emulated instructions
...============================================================ --- linux-2.6.21-rc5-mm2.orig/drivers/lguest/lg.h +++ linux-2.6.21-rc5-mm2/drivers/lguest/lg.h @@ -218,6 +218,7 @@ void guest_set_pte(struct lguest *lg, un void map_hypervisor_in_guest(struct lguest *lg, struct lguest_pages *pages); int demand_page(struct lguest *info, unsigned long cr2, int write); void pin_page(struct lguest *lg, unsigned long vaddr); +unsigned long lguest_find_guest_paddr(struct lguest *lg, unsigned long vaddr); /* lguest_user.c: */ int lguest_device_init(void); Index: linux-2.6.21-rc5-mm2/drivers/lguest/page_tables.c...
2007 Apr 18
1
[PATCH] Lguest32, use guest page tables to find paddr for emulated instructions
...============================================================ --- linux-2.6.21-rc5-mm2.orig/drivers/lguest/lg.h +++ linux-2.6.21-rc5-mm2/drivers/lguest/lg.h @@ -218,6 +218,7 @@ void guest_set_pte(struct lguest *lg, un void map_hypervisor_in_guest(struct lguest *lg, struct lguest_pages *pages); int demand_page(struct lguest *info, unsigned long cr2, int write); void pin_page(struct lguest *lg, unsigned long vaddr); +unsigned long lguest_find_guest_paddr(struct lguest *lg, unsigned long vaddr); /* lguest_user.c: */ int lguest_device_init(void); Index: linux-2.6.21-rc5-mm2/drivers/lguest/page_tables.c...
2007 May 09
1
[patch 3/9] lguest: the host code
...) + math_state_restore(); + local_irq_enable(); + + switch (lg->regs->trapnum) { + case 13: /* We've intercepted a GPF. */ + if (lg->regs->errcode == 0) { + if (emulate_insn(lg)) + continue; + } + break; + case 14: /* We've intercepted a page fault. */ + if (demand_page(lg, cr2, lg->regs->errcode)) + continue; + + /* If lguest_data is NULL, this won't hurt. */ + if (put_user(cr2, &lg->lguest_data->cr2)) + kill_guest(lg, "Writing cr2"); + break; + case 7: /* We've intercepted a Device Not Available fault. */ + /* If...
2007 May 09
1
[patch 3/9] lguest: the host code
...) + math_state_restore(); + local_irq_enable(); + + switch (lg->regs->trapnum) { + case 13: /* We've intercepted a GPF. */ + if (lg->regs->errcode == 0) { + if (emulate_insn(lg)) + continue; + } + break; + case 14: /* We've intercepted a page fault. */ + if (demand_page(lg, cr2, lg->regs->errcode)) + continue; + + /* If lguest_data is NULL, this won't hurt. */ + if (put_user(cr2, &lg->lguest_data->cr2)) + kill_guest(lg, "Writing cr2"); + break; + case 7: /* We've intercepted a Device Not Available fault. */ + /* If...
2007 Aug 08
13
[PATCH 0/7] Modify lguest32 to make room for lguest64
Hi all, I've been working on lguest64 and in order to do this, I had to move a lot of the i386 specific out of the way. Well, the lguest64 port is still not ready to display, but before Rusty makes too many changes I would like this in upstream so I don't have to keep repeating my changes :-) So this patch series moves lguest32 out of the way for other archs. -- Steve
2007 Aug 08
13
[PATCH 0/7] Modify lguest32 to make room for lguest64
Hi all, I've been working on lguest64 and in order to do this, I had to move a lot of the i386 specific out of the way. Well, the lguest64 port is still not ready to display, but before Rusty makes too many changes I would like this in upstream so I don't have to keep repeating my changes :-) So this patch series moves lguest32 out of the way for other archs. -- Steve