Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 6989
b: refs/heads/master
c: d7271b1
h: refs/heads/master
i:
  6987: bf7f075
v: v3
  • Loading branch information
Zachary Amsden authored and Linus Torvalds committed Sep 5, 2005
1 parent 4f20049 commit 5fc8965
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 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: 748f2edb52712aa3d926470a888608dc500d17e8
refs/heads/master: d7271b14b2e9e5905aba0fbf5c4dc4f8980c0cb2
4 changes: 2 additions & 2 deletions trunk/arch/i386/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,8 +1017,8 @@ int __devinit smp_prepare_cpu(int cpu)
tsc_sync_disabled = 1;

/* init low mem mapping */
memcpy(swapper_pg_dir, swapper_pg_dir + USER_PGD_PTRS,
sizeof(swapper_pg_dir[0]) * KERNEL_PGD_PTRS);
clone_pgd_range(swapper_pg_dir, swapper_pg_dir + USER_PGD_PTRS,
KERNEL_PGD_PTRS);
flush_tlb_all();
schedule_work(&task);
wait_for_completion(&done);
Expand Down
10 changes: 5 additions & 5 deletions trunk/arch/i386/mm/pgtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,19 +207,19 @@ void pgd_ctor(void *pgd, kmem_cache_t *cache, unsigned long unused)
{
unsigned long flags;

if (PTRS_PER_PMD == 1)
if (PTRS_PER_PMD == 1) {
memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
spin_lock_irqsave(&pgd_lock, flags);
}

memcpy((pgd_t *)pgd + USER_PTRS_PER_PGD,
clone_pgd_range((pgd_t *)pgd + USER_PTRS_PER_PGD,
swapper_pg_dir + USER_PTRS_PER_PGD,
(PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t));

KERNEL_PGD_PTRS);
if (PTRS_PER_PMD > 1)
return;

pgd_list_add(pgd);
spin_unlock_irqrestore(&pgd_lock, flags);
memset(pgd, 0, USER_PTRS_PER_PGD*sizeof(pgd_t));
}

/* never called when PTRS_PER_PMD > 1 */
Expand Down
15 changes: 15 additions & 0 deletions trunk/include/asm-i386/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,21 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
clear_bit(_PAGE_BIT_RW, &ptep->pte_low);
}

/*
* clone_pgd_range(pgd_t *dst, pgd_t *src, int count);
*
* dst - pointer to pgd range anwhere on a pgd page
* src - ""
* count - the number of pgds to copy.
*
* dst and src can be on the same page, but the range must not overlap,
* and must not cross a page boundary.
*/
static inline void clone_pgd_range(pgd_t *dst, pgd_t *src, int count)
{
memcpy(dst, src, count * sizeof(pgd_t));
}

/*
* Macro to mark a page protection value as "uncacheable". On processors which do not support
* it, this is a no-op.
Expand Down

0 comments on commit 5fc8965

Please sign in to comment.