Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/xen/x86 MMUEXT_INVLPG_MULTI and MMUEXT_TLB_FLUSH_MU...



details:   https://anonhg.NetBSD.org/src/rev/ca7d4cd246e9
branches:  trunk
changeset: 777727:ca7d4cd246e9
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Fri Mar 02 16:37:38 2012 +0000

description:
MMUEXT_INVLPG_MULTI and MMUEXT_TLB_FLUSH_MULTI use a long as cpu mask,
not uint32_t, so  pass a pointer of the right type.
While there, cleanup includes and delete local, redundant define of PG_k.

diffstat:

 sys/arch/xen/x86/x86_xpmap.c |  20 ++++++++------------
 1 files changed, 8 insertions(+), 12 deletions(-)

diffs (76 lines):

diff -r 87864eb77293 -r ca7d4cd246e9 sys/arch/xen/x86/x86_xpmap.c
--- a/sys/arch/xen/x86/x86_xpmap.c      Fri Mar 02 16:37:16 2012 +0000
+++ b/sys/arch/xen/x86/x86_xpmap.c      Fri Mar 02 16:37:38 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: x86_xpmap.c,v 1.41 2012/02/24 08:06:08 cherry Exp $    */
+/*     $NetBSD: x86_xpmap.c,v 1.42 2012/03/02 16:37:38 bouyer 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.41 2012/02/24 08:06:08 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_xpmap.c,v 1.42 2012/03/02 16:37:38 bouyer Exp $");
 
 #include "opt_xen.h"
 #include "opt_ddb.h"
@@ -78,10 +78,11 @@
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/mutex.h>
+#include <sys/cpu.h>
 
 #include <uvm/uvm.h>
 
-#include <machine/pmap.h>
+#include <x86/pmap.h>
 #include <machine/gdt.h>
 #include <xen/xenfunc.h>
 
@@ -106,13 +107,6 @@
 #define        PRINTF(x) printf x
 #define        PRINTK(x) printk x
 
-/* on x86_64 kernel runs in ring 3 */
-#ifdef __x86_64__
-#define PG_k PG_u
-#else
-#define PG_k 0
-#endif
-
 volatile shared_info_t *HYPERVISOR_shared_info;
 /* Xen requires the start_info struct to be page aligned */
 union start_info_union start_info_union __aligned(PAGE_SIZE);
@@ -371,13 +365,14 @@
 xen_mcast_invlpg(vaddr_t va, uint32_t cpumask)
 {
        mmuext_op_t op;
+       u_long xcpumask = cpumask;
 
        /* Flush pending page updates */
        xpq_flush_queue();
 
        op.cmd = MMUEXT_INVLPG_MULTI;
        op.arg1.linear_addr = va;
-       op.arg2.vcpumask = &cpumask;
+       op.arg2.vcpumask = &xcpumask;
 
        if (HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0) {
                panic("xpq_queue_invlpg_all");
@@ -409,12 +404,13 @@
 xen_mcast_tlbflush(uint32_t cpumask)
 {
        mmuext_op_t op;
+       u_long xcpumask = cpumask;
 
        /* Flush pending page updates */
        xpq_flush_queue();
 
        op.cmd = MMUEXT_TLB_FLUSH_MULTI;
-       op.arg2.vcpumask = &cpumask;
+       op.arg2.vcpumask = &xcpumask;
 
        if (HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0) {
                panic("xpq_queue_invlpg_all");



Home | Main Index | Thread Index | Old Index