Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 37737
b: refs/heads/master
c: 23002d8
h: refs/heads/master
i:
  37735: 665a004
v: v3
  • Loading branch information
Zachary Amsden authored and Linus Torvalds committed Oct 1, 2006
1 parent 16be8bb commit 2d3e3ca
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 25e4df5bae333a06cd2c9b88baf14432652dc9f7
refs/heads/master: 23002d88be309a7c78db69363c9d933a29a3b0bb
18 changes: 7 additions & 11 deletions trunk/arch/i386/mm/highmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,19 @@ void *kmap_atomic(struct page *page, enum km_type type)

idx = type + KM_TYPE_NR*smp_processor_id();
vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
#ifdef CONFIG_DEBUG_HIGHMEM
if (!pte_none(*(kmap_pte-idx)))
BUG();
#endif
set_pte(kmap_pte-idx, mk_pte(page, kmap_prot));
__flush_tlb_one(vaddr);

return (void*) vaddr;
}

void kunmap_atomic(void *kvaddr, enum km_type type)
{
#ifdef CONFIG_DEBUG_HIGHMEM
unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();

#ifdef CONFIG_DEBUG_HIGHMEM
if (vaddr >= PAGE_OFFSET && vaddr < (unsigned long)high_memory) {
dec_preempt_count();
preempt_check_resched();
Expand All @@ -62,14 +59,14 @@ void kunmap_atomic(void *kvaddr, enum km_type type)

if (vaddr != __fix_to_virt(FIX_KMAP_BEGIN+idx))
BUG();

#endif
/*
* force other mappings to Oops if they'll try to access
* this pte without first remap it
* Force other mappings to Oops if they'll try to access this pte
* without first remap it. Keeping stale mappings around is a bad idea
* also, in case the page changes cacheability attributes or becomes
* a protected page in a hypervisor.
*/
pte_clear(&init_mm, vaddr, kmap_pte-idx);
__flush_tlb_one(vaddr);
#endif
kpte_clear_flush(kmap_pte-idx, vaddr);

dec_preempt_count();
preempt_check_resched();
Expand All @@ -88,7 +85,6 @@ void *kmap_atomic_pfn(unsigned long pfn, enum km_type type)
idx = type + KM_TYPE_NR*smp_processor_id();
vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
set_pte(kmap_pte-idx, pfn_pte(pfn, kmap_prot));
__flush_tlb_one(vaddr);

return (void*) vaddr;
}
Expand Down
7 changes: 7 additions & 0 deletions trunk/include/asm-i386/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,13 @@ extern pte_t *lookup_address(unsigned long address);
#define pte_unmap_nested(pte) do { } while (0)
#endif

/* Clear a kernel PTE and flush it from the TLB */
#define kpte_clear_flush(ptep, vaddr) \
do { \
pte_clear(&init_mm, vaddr, ptep); \
__flush_tlb_one(vaddr); \
} while (0)

/*
* The i386 doesn't have any external MMU info: the kernel page
* tables contain all the necessary information.
Expand Down

0 comments on commit 2d3e3ca

Please sign in to comment.