search for: pte_offset_kernel

Displaying 20 results from an estimated 107 matches for "pte_offset_kernel".

2007 Apr 18
0
[PATCH 1/2] Whitespace cleanup in pageattr.c
...== --- linux-2.6.13.orig/arch/i386/mm/pageattr.c 2005-08-31 14:41:45.000000000 -0700 +++ linux-2.6.13/arch/i386/mm/pageattr.c 2005-08-31 14:41:49.000000000 -0700 @@ -33,7 +33,7 @@ pte_t *lookup_address(unsigned long addr return NULL; if (pmd_large(*pmd)) return (pte_t *)pmd; - return pte_offset_kernel(pmd, address); + return pte_offset_kernel(pmd, address); } static struct page *split_large_page(unsigned long address, pgprot_t prot) @@ -54,8 +54,8 @@ static struct page *split_large_page(uns pbase = (pte_t *)page_address(base); SetPagePTE(virt_to_page(pbase)); for (i = 0; i < PTRS_P...
2007 Apr 18
0
[PATCH 1/2] Whitespace cleanup in pageattr.c
...== --- linux-2.6.13.orig/arch/i386/mm/pageattr.c 2005-08-31 14:41:45.000000000 -0700 +++ linux-2.6.13/arch/i386/mm/pageattr.c 2005-08-31 14:41:49.000000000 -0700 @@ -33,7 +33,7 @@ pte_t *lookup_address(unsigned long addr return NULL; if (pmd_large(*pmd)) return (pte_t *)pmd; - return pte_offset_kernel(pmd, address); + return pte_offset_kernel(pmd, address); } static struct page *split_large_page(unsigned long address, pgprot_t prot) @@ -54,8 +54,8 @@ static struct page *split_large_page(uns pbase = (pte_t *)page_address(base); SetPagePTE(virt_to_page(pbase)); for (i = 0; i < PTRS_P...
2008 May 15
0
[PATCH] linux/x86: utilize lookup_address() for virt_to_ptep()
...ke_pages_writable(void *va, unsigned int nr, unsigned int feature); -#define virt_to_ptep(__va) \ -({ \ - pgd_t *__pgd = pgd_offset_k((unsigned long)(__va)); \ - pud_t *__pud = pud_offset(__pgd, (unsigned long)(__va)); \ - pmd_t *__pmd = pmd_offset(__pud, (unsigned long)(__va)); \ - pte_offset_kernel(__pmd, (unsigned long)(__va)); \ -}) - -#define arbitrary_virt_to_machine(__va) \ -({ \ - maddr_t m = (maddr_t)pte_mfn(*virt_to_ptep(__va)) << PAGE_SHIFT;\ - m | ((unsigned long)(__va) & (PAGE_SIZE-1)); \ -}) +#define virt_to_ptep(va) \ +({ \ + pte_t *__ptep =...
2020 Nov 03
0
[patch V3 14/37] nds32/mm/highmem: Switch to generic kmap atomic
...ge *page, pgprot_t prot) -{ - unsigned int idx; - unsigned long vaddr, pte; - int type; - pte_t *ptep; - - type = kmap_atomic_idx_push(); - - idx = type + KM_TYPE_NR * smp_processor_id(); - vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); - pte = (page_to_pfn(page) << PAGE_SHIFT) | prot; - ptep = pte_offset_kernel(pmd_off_k(vaddr), vaddr); - set_pte(ptep, pte); - - __nds32__tlbop_inv(vaddr); - __nds32__mtsr_dsb(vaddr, NDS32_SR_TLB_VPN); - __nds32__tlbop_rwr(pte); - __nds32__isb(); - return (void *)vaddr; -} -EXPORT_SYMBOL(kmap_atomic_high_prot); - -void kunmap_atomic_high(void *kvaddr) -{ - if (kvaddr >=...
2014 Oct 13
2
kernel crashes after soft lockups in xen domU
...10be97d>] ? pagevec_lru_move_fn+0x8f/0xb5 [354047.224054] [<ffffffff810beb8a>] ? __lru_cache_add+0x4a/0x51 [354047.224054] [<ffffffff810d1537>] ? handle_pte_fault+0x224/0x79f [354047.224054] [<ffffffff810ceacb>] ? pmd_val+0x7/0x8 [354047.224054] [<ffffffff810ceb49>] ? pte_offset_kernel+0x16/0x35 [354047.224054] [<ffffffff813533ee>] ? do_page_fault+0x320/0x345 [354047.224054] [<ffffffff81003223>] ? xen_end_context_switch+0xe/0x1c [354047.224054] [<ffffffff81003ba5>] ? xen_mc_issue.constprop.23+0x31/0x49 [354047.224054] [<ffffffff8100d750>] ? __switch_t...
2007 Apr 18
1
[PATCH 1/5] Add pagetable allocation notifiers
...4 09:31:31.000000000 -0700 @@ -79,6 +79,7 @@ static pte_t * __init one_page_table_ini { if (pmd_none(*pmd)) { pte_t *page_table = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); + SetPagePTE(virt_to_page(page_table)); set_pmd(pmd, __pmd(__pa(page_table) | _PAGE_TABLE)); if (page_table != pte_offset_kernel(pmd, 0)) BUG(); Index: linux-2.6.13/arch/i386/mm/pageattr.c =================================================================== --- linux-2.6.13.orig/arch/i386/mm/pageattr.c 2005-08-24 09:31:05.000000000 -0700 +++ linux-2.6.13/arch/i386/mm/pageattr.c 2005-08-24 09:31:31.000000000 -0700 @@ -52,...
2007 Apr 18
1
[PATCH 1/5] Add pagetable allocation notifiers
...4 09:31:31.000000000 -0700 @@ -79,6 +79,7 @@ static pte_t * __init one_page_table_ini { if (pmd_none(*pmd)) { pte_t *page_table = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); + SetPagePTE(virt_to_page(page_table)); set_pmd(pmd, __pmd(__pa(page_table) | _PAGE_TABLE)); if (page_table != pte_offset_kernel(pmd, 0)) BUG(); Index: linux-2.6.13/arch/i386/mm/pageattr.c =================================================================== --- linux-2.6.13.orig/arch/i386/mm/pageattr.c 2005-08-24 09:31:05.000000000 -0700 +++ linux-2.6.13/arch/i386/mm/pageattr.c 2005-08-24 09:31:31.000000000 -0700 @@ -52,...
2007 Apr 18
0
[PATCH 4/5] Add address translation
...\ + pgd_t *pgd = pgd_offset_k(_address); \ + pud_t *pud = pud_offset(pgd, (_address)); \ + pmd_t *pmd = pmd_offset(pud, (_address)); \ + if (pmd_large(*pmd)) \ + __paddr = (pmd_val(*pmd) & LARGE_PAGE_MASK) | \ + ((_address) & ~LARGE_PAGE_MASK); \ + else { \ + pte_t *pte = pte_offset_kernel(pmd, (_address));\ + __paddr = (pte_val(*pte) & PAGE_MASK) | \ + ((_address) & ~PAGE_MASK); \ + } \ + __paddr >>= PAGE_SHIFT; \ + __paddr; \ +}) + +/* * Make a given kernel text page executable/non-executable. * Returns the previous executability setting of th...
2005 Apr 15
0
[PATCH] Eliminate kernel version checks from i386/kernel/pci-dma.c
...inux-2.6.11-xen-sparse/arch/xen/i386/kernel/pci-dma.c 2005-04-15 11:11:09 -07:00 @@ -14,14 +14,7 @@ #include <linux/version.h> #include <asm/io.h> #include <asm-xen/balloon.h> - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) #include <asm/tlbflush.h> -#else -#define pte_offset_kernel pte_offset -#define pud_t pgd_t -#define pud_offset(d, va) d -#endif struct dma_coherent_mem { void *virt_base; @@ -85,24 +78,13 @@ xen_contig_memory(unsigned long vstart, balloon_unlock(flags); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) -void *pci_alloc_consistent(struct pci_...
2007 Apr 18
0
[PATCH 4/5] Add address translation
...\ + pgd_t *pgd = pgd_offset_k(_address); \ + pud_t *pud = pud_offset(pgd, (_address)); \ + pmd_t *pmd = pmd_offset(pud, (_address)); \ + if (pmd_large(*pmd)) \ + __paddr = (pmd_val(*pmd) & LARGE_PAGE_MASK) | \ + ((_address) & ~LARGE_PAGE_MASK); \ + else { \ + pte_t *pte = pte_offset_kernel(pmd, (_address));\ + __paddr = (pte_val(*pte) & PAGE_MASK) | \ + ((_address) & ~PAGE_MASK); \ + } \ + __paddr >>= PAGE_SHIFT; \ + __paddr; \ +}) + +/* * Make a given kernel text page executable/non-executable. * Returns the previous executability setting of th...
2014 Nov 05
0
kernel crashes after soft lockups in xen domU
...ec_lru_move_fn+0x8f/0xb5 > [354047.224054] [<ffffffff810beb8a>] ? __lru_cache_add+0x4a/0x51 > [354047.224054] [<ffffffff810d1537>] ? handle_pte_fault+0x224/0x79f > [354047.224054] [<ffffffff810ceacb>] ? pmd_val+0x7/0x8 > [354047.224054] [<ffffffff810ceb49>] ? pte_offset_kernel+0x16/0x35 > [354047.224054] [<ffffffff813533ee>] ? do_page_fault+0x320/0x345 > [354047.224054] [<ffffffff81003223>] ? xen_end_context_switch+0xe/0x1c > [354047.224054] [<ffffffff81003ba5>] ? > xen_mc_issue.constprop.23+0x31/0x49 > [354047.224054] [<ffffffff8...
2007 Apr 18
0
[PATCH 2/5] Add subarch mmu queue flush hook
...nux-2.6.13/arch/i386/mm/fault.c =================================================================== --- linux-2.6.13.orig/arch/i386/mm/fault.c 2005-08-24 09:30:53.000000000 -0700 +++ linux-2.6.13/arch/i386/mm/fault.c 2005-08-24 09:43:27.000000000 -0700 @@ -562,6 +562,15 @@ vmalloc_fault: pte_k = pte_offset_kernel(pmd_k, address); if (!pte_present(*pte_k)) goto no_context; + + /* + * We have just updated this root with a copy of the kernel + * pmd. To return without flushing would introduce a fault + * loop if running on a hypervisor which uses queued page + * table updates. + */ + update...
2007 Apr 18
0
[PATCH 2/5] Add subarch mmu queue flush hook
...nux-2.6.13/arch/i386/mm/fault.c =================================================================== --- linux-2.6.13.orig/arch/i386/mm/fault.c 2005-08-24 09:30:53.000000000 -0700 +++ linux-2.6.13/arch/i386/mm/fault.c 2005-08-24 09:43:27.000000000 -0700 @@ -562,6 +562,15 @@ vmalloc_fault: pte_k = pte_offset_kernel(pmd_k, address); if (!pte_present(*pte_k)) goto no_context; + + /* + * We have just updated this root with a copy of the kernel + * pmd. To return without flushing would introduce a fault + * loop if running on a hypervisor which uses queued page + * table updates. + */ + update...
2014 Jul 22
0
Bug#755753: xen-hypervisor-4.1-amd64: xen crashes at random
...3513ce>] ? oops_end+0xb1/0xb6 Jul 16 20:41:01 placka kernel: [28018.413801] [<ffffffff8134956f>] ? no_context+0x1ff/0x20e Jul 16 20:41:01 placka kernel: [28018.413801] [<ffffffff81348dfd>] ? pmd_val+0x7/0x8 Jul 16 20:41:01 placka kernel: [28018.413801] [<ffffffff81348e3c>] ? pte_offset_kernel+0x16/0x35 Jul 16 20:41:01 placka kernel: [28018.413801] [<ffffffff813533c4>] ? do_page_fault+0x1b6/0x345 Jul 16 20:41:01 placka kernel: [28018.413801] [<ffffffff810bb90e>] ? __alloc_pages_nodemask+0x186/0x7aa Jul 16 20:41:01 placka kernel: [28018.413801] [<ffffffff813505cf>] ?...
2020 Apr 28
0
[PATCH v3 22/75] x86/boot/compressed/64: Add set_page_en/decrypted() helpers
...The page is mapped at least with PMD size - so skip checks and walk + * directly to the PMD. + */ + p4dp = p4d_offset(pgdp, address); + pudp = pud_offset(p4dp, address); + pmdp = pmd_offset(pudp, address); + + if (pmd_large(*pmdp)) + ptep = split_large_pmd(info, pmdp, address); + else + ptep = pte_offset_kernel(pmdp, address); + + if (!ptep) + return -ENOMEM; + + /* + * Changing encryption attributes of a page requires to flush it from + * the caches. + */ + if ((set | clr) & _PAGE_ENC) + clflush_page(address); + + /* Update PTE */ + pte = *ptep; + pte = pte_set_flags(pte, set); + pte = pte_clear...
2008 Jun 19
0
[PATCH] ia64/xen: implement the arch specific part of xencomm.
...ally mapped. */ + pgd = pgd_offset_k(vaddr); + if (pgd_none(*pgd) || pgd_bad(*pgd)) + return ~0UL; + + pud = pud_offset(pgd, vaddr); + if (pud_none(*pud) || pud_bad(*pud)) + return ~0UL; + + pmd = pmd_offset(pud, vaddr); + if (pmd_none(*pmd) || pmd_bad(*pmd)) + return ~0UL; + + ptep = pte_offset_kernel(pmd, vaddr); + if (!ptep) + return ~0UL; + + return (pte_val(*ptep) & _PFN_MASK) | (vaddr & ~PAGE_MASK); + } + + if (vaddr > TASK_SIZE) { + /* percpu variables */ + if (REGION_NUMBER(vaddr) == 7 && + REGION_OFFSET(vaddr) >= (1ULL << IA64_MAX_PHYS_BITS)) + ia...
2008 Jun 19
0
[PATCH] ia64/xen: implement the arch specific part of xencomm.
...ally mapped. */ + pgd = pgd_offset_k(vaddr); + if (pgd_none(*pgd) || pgd_bad(*pgd)) + return ~0UL; + + pud = pud_offset(pgd, vaddr); + if (pud_none(*pud) || pud_bad(*pud)) + return ~0UL; + + pmd = pmd_offset(pud, vaddr); + if (pmd_none(*pmd) || pmd_bad(*pmd)) + return ~0UL; + + ptep = pte_offset_kernel(pmd, vaddr); + if (!ptep) + return ~0UL; + + return (pte_val(*ptep) & _PFN_MASK) | (vaddr & ~PAGE_MASK); + } + + if (vaddr > TASK_SIZE) { + /* percpu variables */ + if (REGION_NUMBER(vaddr) == 7 && + REGION_OFFSET(vaddr) >= (1ULL << IA64_MAX_PHYS_BITS)) + ia...
2007 Apr 18
0
[PATCH 1/5] Paravirt page alloc.patch
...d, 0)) @@ -82,6 +83,7 @@ static pte_t * __init one_page_table_ini { if (pmd_none(*pmd)) { pte_t *page_table = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); + paravirt_alloc_pt(__pa(page_table) >> PAGE_SHIFT); set_pmd(pmd, __pmd(__pa(page_table) | _PAGE_TABLE)); if (page_table != pte_offset_kernel(pmd, 0)) BUG(); @@ -347,6 +349,8 @@ static void __init pagetable_init (void) /* Init entries of the first-level page table to the zero page */ for (i = 0; i < PTRS_PER_PGD; i++) set_pgd(pgd_base + i, __pgd(__pa(empty_zero_page) | _PAGE_PRESENT)); +#else + paravirt_alloc_pd(__pa(swapp...
2007 Apr 18
0
[PATCH 1/5] Paravirt page alloc.patch
...d, 0)) @@ -82,6 +83,7 @@ static pte_t * __init one_page_table_ini { if (pmd_none(*pmd)) { pte_t *page_table = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); + paravirt_alloc_pt(__pa(page_table) >> PAGE_SHIFT); set_pmd(pmd, __pmd(__pa(page_table) | _PAGE_TABLE)); if (page_table != pte_offset_kernel(pmd, 0)) BUG(); @@ -347,6 +349,8 @@ static void __init pagetable_init (void) /* Init entries of the first-level page table to the zero page */ for (i = 0; i < PTRS_PER_PGD; i++) set_pgd(pgd_base + i, __pgd(__pa(empty_zero_page) | _PAGE_PRESENT)); +#else + paravirt_alloc_pd(__pa(swapp...
2007 Apr 18
0
[PATCH 1/6] Page allocation hooks for VMI backend
...d, 0)) @@ -82,6 +83,7 @@ static pte_t * __init one_page_table_ini { if (pmd_none(*pmd)) { pte_t *page_table = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); + paravirt_alloc_pt(__pa(page_table) >> PAGE_SHIFT); set_pmd(pmd, __pmd(__pa(page_table) | _PAGE_TABLE)); if (page_table != pte_offset_kernel(pmd, 0)) BUG(); @@ -347,6 +349,8 @@ static void __init pagetable_init (void) /* Init entries of the first-level page table to the zero page */ for (i = 0; i < PTRS_PER_PGD; i++) set_pgd(pgd_base + i, __pgd(__pa(empty_zero_page) | _PAGE_PRESENT)); +#else + paravirt_alloc_pd(__pa(swapp...