search for: gpte

Displaying 20 results from an estimated 28 matches for "gpte".

Did you mean: _pte
2005 Mar 14
4
[patch/unstable] page table cleanups
...near_pg_table[ (va>>L1_PAGETABLE_SHIFT) & ~(L1_PAGETABLE_ENTRIES-1)]); for ( i = 0; i < L1_PAGETABLE_ENTRIES; i++ ) @@ -584,7 +586,8 @@ static void shadow_map_l1_into_current_l void shadow_invlpg(struct exec_domain *ed, unsigned long va) { - unsigned long gpte, spte; + l1_pgentry_t gpte, spte; + l1_pgentry_t zero = mk_l1_pgentry(0); ASSERT(shadow_mode_enabled(ed->domain)); @@ -592,21 +595,22 @@ void shadow_invlpg(struct exec_domain *e * XXX KAF: Why is this set-to-zero required? * Why, on failure, must we bin all ou...
2007 Apr 30
0
[PATCH] lguest: properly kill guest userspace programs accessing kernel mem
...is NULL, this won't hurt. */ =================================================================== --- a/drivers/lguest/lg.h +++ b/drivers/lguest/lg.h @@ -216,7 +216,7 @@ void guest_set_pte(struct lguest *lg, un void guest_set_pte(struct lguest *lg, unsigned long cr3, unsigned long vaddr, gpte_t val); void map_switcher_in_guest(struct lguest *lg, struct lguest_pages *pages); -int demand_page(struct lguest *info, unsigned long cr2, int write); +int demand_page(struct lguest *info, unsigned long cr2, int errcode); void pin_page(struct lguest *lg, unsigned long vaddr); /* lguest_user.c...
2007 Apr 30
0
[PATCH] lguest: properly kill guest userspace programs accessing kernel mem
...is NULL, this won't hurt. */ =================================================================== --- a/drivers/lguest/lg.h +++ b/drivers/lguest/lg.h @@ -216,7 +216,7 @@ void guest_set_pte(struct lguest *lg, un void guest_set_pte(struct lguest *lg, unsigned long cr3, unsigned long vaddr, gpte_t val); void map_switcher_in_guest(struct lguest *lg, struct lguest_pages *pages); -int demand_page(struct lguest *info, unsigned long cr2, int write); +int demand_page(struct lguest *info, unsigned long cr2, int errcode); void pin_page(struct lguest *lg, unsigned long vaddr); /* lguest_user.c...
2009 Sep 21
1
[PATCH 2/5] lguest: use set_pte/set_pmd uniformly for real page table entries
...pmd_flags(gpmd))); + set_pmd(spmd, __pmd(__pa(ptepage) | pmd_flags(gpmd))); } /* @@ -447,7 +447,7 @@ bool demand_page(struct lg_cpu *cpu, uns * we will come back here when a write does actually occur, so * we can update the Guest's _PAGE_DIRTY flag. */ - native_set_pte(spte, gpte_to_spte(cpu, pte_wrprotect(gpte), 0)); + set_pte(spte, gpte_to_spte(cpu, pte_wrprotect(gpte), 0)); /* * Finally, we write the Guest PTE entry back: we've set the @@ -528,7 +528,7 @@ static void release_pmd(pmd_t *spmd) /* Now we can free the page of PTEs */ free_page((long)ptepage...
2009 Sep 21
1
[PATCH 2/5] lguest: use set_pte/set_pmd uniformly for real page table entries
...pmd_flags(gpmd))); + set_pmd(spmd, __pmd(__pa(ptepage) | pmd_flags(gpmd))); } /* @@ -447,7 +447,7 @@ bool demand_page(struct lg_cpu *cpu, uns * we will come back here when a write does actually occur, so * we can update the Guest's _PAGE_DIRTY flag. */ - native_set_pte(spte, gpte_to_spte(cpu, pte_wrprotect(gpte), 0)); + set_pte(spte, gpte_to_spte(cpu, pte_wrprotect(gpte), 0)); /* * Finally, we write the Guest PTE entry back: we've set the @@ -528,7 +528,7 @@ static void release_pmd(pmd_t *spmd) /* Now we can free the page of PTEs */ free_page((long)ptepage...
2009 Apr 16
1
NULL pointer dereference at __switch_to() ( __unlazy_fpu ) with lguest PAE patch
...+ index; +} + +#ifdef CONFIG_X86_PAE +static unsigned long gpmd_addr(pgd_t gpgd, unsigned long vaddr) +{ + unsigned long gpage = pgd_pfn(gpgd) << PAGE_SHIFT; + BUG_ON(!(pgd_flags(gpgd) & _PAGE_PRESENT)); + return gpage + pmd_index(vaddr) * sizeof(pmd_t); } +#endif -static unsigned long gpte_addr(pgd_t gpgd, unsigned long vaddr) +static unsigned long gpte_addr(struct lg_cpu *cpu, + pgd_t gpgd, unsigned long vaddr) { +#ifdef CONFIG_X86_PAE + pmd_t gpmd = lgread(cpu, + (unsigned long) gpmd_addr(gpgd, vaddr), pmd_t); + unsigned long gpage = pmd_pfn(gpmd) << PAGE_SHIFT; +#else...
2009 Apr 16
1
NULL pointer dereference at __switch_to() ( __unlazy_fpu ) with lguest PAE patch
...+ index; +} + +#ifdef CONFIG_X86_PAE +static unsigned long gpmd_addr(pgd_t gpgd, unsigned long vaddr) +{ + unsigned long gpage = pgd_pfn(gpgd) << PAGE_SHIFT; + BUG_ON(!(pgd_flags(gpgd) & _PAGE_PRESENT)); + return gpage + pmd_index(vaddr) * sizeof(pmd_t); } +#endif -static unsigned long gpte_addr(pgd_t gpgd, unsigned long vaddr) +static unsigned long gpte_addr(struct lg_cpu *cpu, + pgd_t gpgd, unsigned long vaddr) { +#ifdef CONFIG_X86_PAE + pmd_t gpmd = lgread(cpu, + (unsigned long) gpmd_addr(gpgd, vaddr), pmd_t); + unsigned long gpage = pmd_pfn(gpmd) << PAGE_SHIFT; +#else...
2009 Jun 05
1
[PATCH] lguest: PAE support
...G_ON(!(pgd_flags(spgd) & _PAGE_PRESENT)); +#endif + return &page[pte_index(vaddr)]; } @@ -101,10 +147,31 @@ static unsigned long gpgd_addr(struct lg_cpu *cpu, unsigned long vaddr) return cpu->lg->pgdirs[cpu->cpu_pgd].gpgdir + index * sizeof(pgd_t); } -static unsigned long gpte_addr(pgd_t gpgd, unsigned long vaddr) +#ifdef CONFIG_X86_PAE +static unsigned long gpmd_addr(pgd_t gpgd, unsigned long vaddr) { unsigned long gpage = pgd_pfn(gpgd) << PAGE_SHIFT; BUG_ON(!(pgd_flags(gpgd) & _PAGE_PRESENT)); + return gpage + pmd_index(vaddr) * sizeof(pmd_t); +} +#endif...
2009 Jun 05
1
[PATCH] lguest: PAE support
...G_ON(!(pgd_flags(spgd) & _PAGE_PRESENT)); +#endif + return &page[pte_index(vaddr)]; } @@ -101,10 +147,31 @@ static unsigned long gpgd_addr(struct lg_cpu *cpu, unsigned long vaddr) return cpu->lg->pgdirs[cpu->cpu_pgd].gpgdir + index * sizeof(pgd_t); } -static unsigned long gpte_addr(pgd_t gpgd, unsigned long vaddr) +#ifdef CONFIG_X86_PAE +static unsigned long gpmd_addr(pgd_t gpgd, unsigned long vaddr) { unsigned long gpage = pgd_pfn(gpgd) << PAGE_SHIFT; BUG_ON(!(pgd_flags(gpgd) & _PAGE_PRESENT)); + return gpage + pmd_index(vaddr) * sizeof(pmd_t); +} +#endif...
2005 Jun 30
0
[PATCH][10/10] Use copy_from_user when accessing guest_pt
...c Thu Jun 30 05:26:09 2005 +++ b/xen/arch/x86/shadow.c Thu Jun 30 05:26:24 2005 @@ -1906,7 +1906,7 @@ unsigned long gpfn, unsigned index) { unsigned long smfn = __shadow_status(d, gpfn, PGT_snapshot); - l1_pgentry_t *snapshot; // could be L1s or L2s or ... + l1_pgentry_t *snapshot, gpte; // could be L1s or L2s or ... int entries_match; perfc_incrc(snapshot_entry_matches_calls); @@ -1916,10 +1916,14 @@ snapshot = map_domain_page(smfn); + if (__copy_from_user(&gpte, &guest_pt[index], + sizeof(gpte))) + return 0; + /...
2007 Apr 18
1
[PATCH] Lguest32, use guest page tables to find paddr for emulated instructions
...lguest_device_init(void); Index: linux-2.6.21-rc5-mm2/drivers/lguest/page_tables.c =================================================================== --- linux-2.6.21-rc5-mm2.orig/drivers/lguest/page_tables.c +++ linux-2.6.21-rc5-mm2/drivers/lguest/page_tables.c @@ -105,6 +105,25 @@ static spte_t gpte_to_spte(struct lguest return spte; } +unsigned long lguest_find_guest_paddr(struct lguest *lg, unsigned long vaddr) +{ + gpgd_t gpgd; + gpte_t gpte; + unsigned long gpte_ptr; + + gpgd = mkgpgd(lgread_u32(lg, gpgd_addr(lg, vaddr))); + if (!(gpgd.flags & _PAGE_PRESENT)) + return -1; + + gpt...
2007 Apr 18
1
[PATCH] Lguest32, use guest page tables to find paddr for emulated instructions
...lguest_device_init(void); Index: linux-2.6.21-rc5-mm2/drivers/lguest/page_tables.c =================================================================== --- linux-2.6.21-rc5-mm2.orig/drivers/lguest/page_tables.c +++ linux-2.6.21-rc5-mm2/drivers/lguest/page_tables.c @@ -105,6 +105,25 @@ static spte_t gpte_to_spte(struct lguest return spte; } +unsigned long lguest_find_guest_paddr(struct lguest *lg, unsigned long vaddr) +{ + gpgd_t gpgd; + gpte_t gpte; + unsigned long gpte_ptr; + + gpgd = mkgpgd(lgread_u32(lg, gpgd_addr(lg, vaddr))); + if (!(gpgd.flags & _PAGE_PRESENT)) + return -1; + + gpt...
2007 May 09
1
[patch 3/9] lguest: the host code
...t;edx, regs->ebx, regs->ecx); + break; + case LHCALL_NEW_PGTABLE: + guest_new_pagetable(lg, regs->edx); + break; + case LHCALL_SET_STACK: + guest_set_stack(lg, regs->edx, regs->ebx, regs->ecx); + break; + case LHCALL_SET_PTE: + guest_set_pte(lg, regs->edx, regs->ebx, mkgpte(regs->ecx)); + break; + case LHCALL_SET_PMD: + guest_set_pmd(lg, regs->edx, regs->ebx); + break; + case LHCALL_LOAD_TLS: + guest_load_tls(lg, (struct desc_struct __user*)regs->edx); + break; + case LHCALL_TS: + lg->ts = regs->edx; + break; + case LHCALL_HALT: + lg->halt...
2007 May 09
1
[patch 3/9] lguest: the host code
...t;edx, regs->ebx, regs->ecx); + break; + case LHCALL_NEW_PGTABLE: + guest_new_pagetable(lg, regs->edx); + break; + case LHCALL_SET_STACK: + guest_set_stack(lg, regs->edx, regs->ebx, regs->ecx); + break; + case LHCALL_SET_PTE: + guest_set_pte(lg, regs->edx, regs->ebx, mkgpte(regs->ecx)); + break; + case LHCALL_SET_PMD: + guest_set_pmd(lg, regs->edx, regs->ebx); + break; + case LHCALL_LOAD_TLS: + guest_load_tls(lg, (struct desc_struct __user*)regs->edx); + break; + case LHCALL_TS: + lg->ts = regs->edx; + break; + case LHCALL_HALT: + lg->halt...
2009 Apr 22
7
Consult some concepts about shadow paging mechanism
Dear All: I am pretty new to xen-devel, please correct me in the following. Assume we have the following terms GPT: guest page table SPT: shadow page table (Question a) When guest OS is running, is it always using SPT for address translation? If it is the case, how does guest OS refer and modify its own GPT content? It seems that there is a page table entry in SPT for the GPT page. (Question
2005 Jun 30
0
[PATCH][2/10] Extend the VMX intercept mechanism to include mmio as well as portio.
...xen/arch/x86/vmx.c --- a/xen/arch/x86/vmx.c Thu Jun 30 03:20:48 2005 +++ b/xen/arch/x86/vmx.c Thu Jun 30 04:08:50 2005 @@ -135,17 +135,20 @@ } #endif - if (!vmx_paging_enabled(current)) + if (!vmx_paging_enabled(current)){ handle_mmio(va, va); - + return 1; + } gpte = gva_to_gpte(va); if (!(l1e_get_flags(gpte) & _PAGE_PRESENT) ) return 0; gpa = l1e_get_paddr(gpte) + (va & ~PAGE_MASK); /* Use 1:1 page table to identify MMIO address space */ - if (mmio_space(gpa)) + if (mmio_space(gpa)){ handle_mmio(va, gpa);...
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 18
1
[RFC/PATCH LGUEST X86_64 03/13] lguest64 core
...ist_for_each_entry(pmdir, &linfo->pmd_hash[idx], list) + if (pmdir->gpmd == gpmd) + break; + + if (pmdir == list_entry(&linfo->pmd_hash[idx], struct lguest_pmd, list)) + return NULL; + + return pmdir; +} + +static struct lguest_pte *find_pte(struct lguest_guest_info *linfo, u64 gpte) +{ + unsigned idx = HASH_PTE(gpte); + struct lguest_pte *pte; + + list_for_each_entry(pte, &linfo->pte_hash[idx], list) + if (pte->gpte == gpte) + break; + + if (pte == list_entry(&linfo->pte_hash[idx], struct lguest_pte, list)) + return NULL; + + return pte; +} + +static void...
2007 Apr 18
1
[RFC/PATCH LGUEST X86_64 03/13] lguest64 core
...ist_for_each_entry(pmdir, &linfo->pmd_hash[idx], list) + if (pmdir->gpmd == gpmd) + break; + + if (pmdir == list_entry(&linfo->pmd_hash[idx], struct lguest_pmd, list)) + return NULL; + + return pmdir; +} + +static struct lguest_pte *find_pte(struct lguest_guest_info *linfo, u64 gpte) +{ + unsigned idx = HASH_PTE(gpte); + struct lguest_pte *pte; + + list_for_each_entry(pte, &linfo->pte_hash[idx], list) + if (pte->gpte == gpte) + break; + + if (pte == list_entry(&linfo->pte_hash[idx], struct lguest_pte, list)) + return NULL; + + return pte; +} + +static void...