Module Name: src Committed By: cherry Date: Thu Feb 23 04:10:51 UTC 2012
Modified Files: src/sys/arch/xen/x86: cpu.c Log Message: cpu_load_pmap() should not be used to load pmap_kernel(), since in the x86 model, its mappings are shared across pmaps. KASSERT() for this and remove unused codepaths. To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/sys/arch/xen/x86/cpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/xen/x86/cpu.c diff -u src/sys/arch/xen/x86/cpu.c:1.83 src/sys/arch/xen/x86/cpu.c:1.84 --- src/sys/arch/xen/x86/cpu.c:1.83 Wed Feb 22 18:29:31 2012 +++ src/sys/arch/xen/x86/cpu.c Thu Feb 23 04:10:51 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.83 2012/02/22 18:29:31 bouyer Exp $ */ +/* $NetBSD: cpu.c,v 1.84 2012/02/23 04:10:51 cherry Exp $ */ /* NetBSD: cpu.c,v 1.18 2004/02/20 17:35:01 yamt Exp */ /*- @@ -66,7 +66,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.83 2012/02/22 18:29:31 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.84 2012/02/23 04:10:51 cherry Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" @@ -1176,6 +1176,8 @@ x86_cpu_idle_xen(void) void cpu_load_pmap(struct pmap *pmap, struct pmap *oldpmap) { + KASSERT(pmap != pmap_kernel()); + #if defined(__x86_64__) || defined(PAE) struct cpu_info *ci = curcpu(); uint32_t cpumask = ci->ci_cpumask; @@ -1226,14 +1228,8 @@ cpu_load_pmap(struct pmap *pmap, struct } } - if (__predict_true(pmap != pmap_kernel())) { - xen_set_user_pgd(pmap_pdirpa(pmap, 0)); - ci->ci_xen_current_user_pgd = pmap_pdirpa(pmap, 0); - } - else { - xpq_queue_pt_switch(l4_pd_ma); - ci->ci_xen_current_user_pgd = 0; - } + xen_set_user_pgd(pmap_pdirpa(pmap, 0)); + ci->ci_xen_current_user_pgd = pmap_pdirpa(pmap, 0); tlbflush(); }