Skip to content

Commit

Permalink
xen: allow set_pte_at on init_mm to be lockless
Browse files Browse the repository at this point in the history
The usual pagetable locking protocol doesn't seem to apply to updates
to init_mm, so don't rely on preemption being disabled in xen_set_pte_at
on init_mm.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Jeremy Fitzhardinge authored and Ingo Molnar committed Apr 24, 2008
1 parent 41e332b commit 2bd5003
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions arch/x86/xen/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,19 +156,27 @@ void set_pte_mfn(unsigned long vaddr, unsigned long mfn, pgprot_t flags)
void xen_set_pte_at(struct mm_struct *mm, unsigned long addr,
pte_t *ptep, pte_t pteval)
{
/* updates to init_mm may be done without lock */
if (mm == &init_mm)
preempt_disable();

if (mm == current->mm || mm == &init_mm) {
if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_MMU) {
struct multicall_space mcs;
mcs = xen_mc_entry(0);

MULTI_update_va_mapping(mcs.mc, addr, pteval, 0);
xen_mc_issue(PARAVIRT_LAZY_MMU);
return;
goto out;
} else
if (HYPERVISOR_update_va_mapping(addr, pteval, 0) == 0)
return;
goto out;
}
xen_set_pte(ptep, pteval);

out:
if (mm == &init_mm)
preempt_enable();
}

pteval_t xen_pte_val(pte_t pte)
Expand Down

0 comments on commit 2bd5003

Please sign in to comment.