Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Few XEN fixes:
details: https://anonhg.NetBSD.org/src/rev/b91555457c39
branches: trunk
changeset: 766111:b91555457c39
user: rmind <rmind%NetBSD.org@localhost>
date: Wed Jun 15 20:50:02 2011 +0000
description:
Few XEN fixes:
- cpu_load_pmap: perform tlbflush() after xen_set_user_pgd().
- xen_pmap_bootstrap: perform xpq_queue_tlb_flush() in the end.
- pmap_tlb_shootdown: do not check PG_G for Xen.
diffstat:
sys/arch/x86/x86/pmap_tlb.c | 6 ++++--
sys/arch/xen/x86/cpu.c | 6 +++---
sys/arch/xen/x86/x86_xpmap.c | 11 ++++++-----
3 files changed, 13 insertions(+), 10 deletions(-)
diffs (103 lines):
diff -r 4f6aa210b773 -r b91555457c39 sys/arch/x86/x86/pmap_tlb.c
--- a/sys/arch/x86/x86/pmap_tlb.c Wed Jun 15 19:54:16 2011 +0000
+++ b/sys/arch/x86/x86/pmap_tlb.c Wed Jun 15 20:50:02 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap_tlb.c,v 1.2 2011/06/12 03:35:50 rmind Exp $ */
+/* $NetBSD: pmap_tlb.c,v 1.3 2011/06/15 20:50:02 rmind Exp $ */
/*-
* Copyright (c) 2008-2011 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.2 2011/06/12 03:35:50 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_tlb.c,v 1.3 2011/06/15 20:50:02 rmind Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -209,7 +209,9 @@
pmap_tlb_packet_t *tp;
int s;
+#ifndef XEN
KASSERT((pte & PG_G) == 0 || pm == pmap_kernel());
+#endif
/*
* If tearing down the pmap, do nothing. We will flush later
diff -r 4f6aa210b773 -r b91555457c39 sys/arch/xen/x86/cpu.c
--- a/sys/arch/xen/x86/cpu.c Wed Jun 15 19:54:16 2011 +0000
+++ b/sys/arch/xen/x86/cpu.c Wed Jun 15 20:50:02 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.58 2011/06/15 19:54:16 rmind Exp $ */
+/* $NetBSD: cpu.c,v 1.59 2011/06/15 20:50:02 rmind 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.58 2011/06/15 19:54:16 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.59 2011/06/15 20:50:02 rmind Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
@@ -1170,9 +1170,9 @@
if ((new_pgd[i] & PG_V) || (old_pgd[i] & PG_V))
xpq_queue_pte_update(addr, new_pgd[i]);
}
- tlbflush();
xen_set_user_pgd(pmap_pdirpa(pmap, 0));
ci->ci_xen_current_user_pgd = pmap_pdirpa(pmap, 0);
+ tlbflush();
splx(s);
}
#endif /* __x86_64__ */
diff -r 4f6aa210b773 -r b91555457c39 sys/arch/xen/x86/x86_xpmap.c
--- a/sys/arch/xen/x86/x86_xpmap.c Wed Jun 15 19:54:16 2011 +0000
+++ b/sys/arch/xen/x86/x86_xpmap.c Wed Jun 15 20:50:02 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: x86_xpmap.c,v 1.27 2011/06/15 19:54:16 rmind Exp $ */
+/* $NetBSD: x86_xpmap.c,v 1.28 2011/06/15 20:50:02 rmind Exp $ */
/*
* Copyright (c) 2006 Mathieu Ropert <mro%adviseo.fr@localhost>
@@ -69,7 +69,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.27 2011/06/15 19:54:16 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.28 2011/06/15 20:50:02 rmind Exp $");
#include "opt_xen.h"
#include "opt_ddb.h"
@@ -498,6 +498,10 @@
/* zero out free space after tables */
memset((void *)(init_tables + ((count + l2_4_count) * PAGE_SIZE)), 0,
(UPAGES + 1) * NBPG);
+
+ /* Finally, flush TLB. */
+ xpq_queue_tlb_flush();
+
return (init_tables + ((count + l2_4_count) * PAGE_SIZE));
}
@@ -508,8 +512,6 @@
* new_count is # of new tables (PTE only)
* we assume areas don't overlap
*/
-
-
static void
xen_bootstrap_tables (vaddr_t old_pgd, vaddr_t new_pgd,
int old_count, int new_count, int final)
@@ -854,7 +856,6 @@
pte++;
}
xpq_flush_queue();
- xpq_queue_tlb_flush();
}
Home |
Main Index |
Thread Index |
Old Index