Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80426
b: refs/heads/master
c: 1c70e9b
h: refs/heads/master
v: v3
  • Loading branch information
Jeremy Fitzhardinge authored and Ingo Molnar committed Jan 30, 2008
1 parent ba98a91 commit 0fd9f17
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 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: a5a19c63f4e55e32dc0bc3d936d7f94793d8b380
refs/heads/master: 1c70e9bd832642b712181e32d1bbf2436058a3df
30 changes: 25 additions & 5 deletions trunk/arch/x86/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,13 @@ static __init void xen_alloc_pt_init(struct mm_struct *mm, u32 pfn)
make_lowmem_page_readonly(__va(PFN_PHYS(pfn)));
}

/* Early release_pt assumes that all pts are pinned, since there's
only init_mm and anything attached to that is pinned. */
static void xen_release_pt_init(u32 pfn)
{
make_lowmem_page_readwrite(__va(PFN_PHYS(pfn)));
}

static void pin_pagetable_pfn(unsigned level, unsigned long pfn)
{
struct mmuext_op op;
Expand All @@ -669,7 +676,7 @@ static void pin_pagetable_pfn(unsigned level, unsigned long pfn)

/* This needs to make sure the new pte page is pinned iff its being
attached to a pinned pagetable. */
static void xen_alloc_pt(struct mm_struct *mm, u32 pfn)
static void xen_alloc_ptpage(struct mm_struct *mm, u32 pfn, unsigned level)
{
struct page *page = pfn_to_page(pfn);

Expand All @@ -678,14 +685,24 @@ static void xen_alloc_pt(struct mm_struct *mm, u32 pfn)

if (!PageHighMem(page)) {
make_lowmem_page_readonly(__va(PFN_PHYS(pfn)));
pin_pagetable_pfn(MMUEXT_PIN_L1_TABLE, pfn);
pin_pagetable_pfn(level, pfn);
} else
/* make sure there are no stray mappings of
this page */
kmap_flush_unused();
}
}

static void xen_alloc_pt(struct mm_struct *mm, u32 pfn)
{
xen_alloc_ptpage(mm, pfn, MMUEXT_PIN_L1_TABLE);
}

static void xen_alloc_pd(struct mm_struct *mm, u32 pfn)
{
xen_alloc_ptpage(mm, pfn, MMUEXT_PIN_L2_TABLE);
}

/* This should never happen until we're OK to use struct page */
static void xen_release_pt(u32 pfn)
{
Expand Down Expand Up @@ -788,6 +805,9 @@ static __init void xen_pagetable_setup_done(pgd_t *base)
/* This will work as long as patching hasn't happened yet
(which it hasn't) */
pv_mmu_ops.alloc_pt = xen_alloc_pt;
pv_mmu_ops.alloc_pd = xen_alloc_pd;
pv_mmu_ops.release_pt = xen_release_pt;
pv_mmu_ops.release_pd = xen_release_pt;
pv_mmu_ops.set_pte = xen_set_pte;

if (!xen_feature(XENFEAT_auto_translated_physmap)) {
Expand Down Expand Up @@ -1011,10 +1031,10 @@ static const struct pv_mmu_ops xen_mmu_ops __initdata = {
.pte_update_defer = paravirt_nop,

.alloc_pt = xen_alloc_pt_init,
.release_pt = xen_release_pt,
.alloc_pd = paravirt_nop,
.release_pt = xen_release_pt_init,
.alloc_pd = xen_alloc_pt_init,
.alloc_pd_clone = paravirt_nop,
.release_pd = paravirt_nop,
.release_pd = xen_release_pt_init,

#ifdef CONFIG_HIGHPTE
.kmap_atomic_pte = xen_kmap_atomic_pte,
Expand Down

0 comments on commit 0fd9f17

Please sign in to comment.