summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/include
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2009-06-06 23:45:37 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2009-06-06 23:45:37 +0000
commit607b546d377ba7a0e5f3fadc5fd881da89586906 (patch)
tree754b0ae3b4b6291e8f71428f94dfac1d2fa48c70 /sys/arch/amd64/include
parentc26bc5bfd3f3cdd7eb49c47edc6e7bf88684cc7d (diff)
Unrevert the curpmap change with the addition of correct %gs handling
in the IPI handler so that it works when it interrupts userspace, waiting for the droppmap IPI to complete when destroying it, and (most importantly) don't call pmap_tlb_droppmap() from cpu_exit(). Tested by myself and ckuethe, as our machines choked on the original. ok @art
Diffstat (limited to 'sys/arch/amd64/include')
-rw-r--r--sys/arch/amd64/include/cpu.h4
-rw-r--r--sys/arch/amd64/include/i82489var.h2
-rw-r--r--sys/arch/amd64/include/pmap.h7
3 files changed, 10 insertions, 3 deletions
diff --git a/sys/arch/amd64/include/cpu.h b/sys/arch/amd64/include/cpu.h
index d0308306356..ea0f25751dd 100644
--- a/sys/arch/amd64/include/cpu.h
+++ b/sys/arch/amd64/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.46 2009/06/05 10:51:45 guenther Exp $ */
+/* $OpenBSD: cpu.h,v 1.47 2009/06/06 23:45:36 guenther Exp $ */
/* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */
/*-
@@ -80,6 +80,8 @@ struct cpu_info {
struct pcb *ci_idle_pcb;
int ci_idle_tss_sel;
+ struct pmap *ci_curpmap;
+
struct intrsource *ci_isources[MAX_INTR_SOURCES];
u_int32_t ci_ipending;
int ci_ilevel;
diff --git a/sys/arch/amd64/include/i82489var.h b/sys/arch/amd64/include/i82489var.h
index 0cfbe6771c3..67f61beff9e 100644
--- a/sys/arch/amd64/include/i82489var.h
+++ b/sys/arch/amd64/include/i82489var.h
@@ -86,10 +86,12 @@ extern void Xresume_lapic_ipi(void);
#define LAPIC_IPI_INVLTLB (LAPIC_IPI_OFFSET + 0)
#define LAPIC_IPI_INVLPG (LAPIC_IPI_OFFSET + 1)
#define LAPIC_IPI_INVLRANGE (LAPIC_IPI_OFFSET + 2)
+#define LAPIC_IPI_RELOADCR3 (LAPIC_IPI_OFFSET + 3)
extern void Xipi_invltlb(void);
extern void Xipi_invlpg(void);
extern void Xipi_invlrange(void);
+extern void Xipi_reloadcr3(void);
/*
* Vector used for local apic timer interrupts.
diff --git a/sys/arch/amd64/include/pmap.h b/sys/arch/amd64/include/pmap.h
index 939228b9bec..750f342a0a0 100644
--- a/sys/arch/amd64/include/pmap.h
+++ b/sys/arch/amd64/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.25 2009/06/05 10:51:45 guenther Exp $ */
+/* $OpenBSD: pmap.h,v 1.26 2009/06/06 23:45:36 guenther Exp $ */
/* $NetBSD: pmap.h,v 1.1 2003/04/26 18:39:46 fvdl Exp $ */
/*
@@ -325,7 +325,6 @@ struct pmap {
union descriptor *pm_ldt; /* user-set LDT */
int pm_ldt_len; /* number of LDT entries */
int pm_ldt_sel; /* LDT selector */
- u_int32_t pm_cpus; /* mask of CPUs using pmap */
};
/*
@@ -416,6 +415,8 @@ static void pmap_update_pg(vaddr_t);
static void pmap_update_2pg(vaddr_t,vaddr_t);
void pmap_write_protect(struct pmap *, vaddr_t,
vaddr_t, vm_prot_t);
+void pmap_switch(struct proc *, struct proc *);
+
vaddr_t reserve_dumppages(vaddr_t); /* XXX: not a pmap fn */
@@ -423,8 +424,10 @@ void pmap_tlb_shootpage(struct pmap *, vaddr_t);
void pmap_tlb_shootrange(struct pmap *, vaddr_t, vaddr_t);
void pmap_tlb_shoottlb(void);
#ifdef MULTIPROCESSOR
+void pmap_tlb_droppmap(struct pmap *);
void pmap_tlb_shootwait(void);
#else
+#define pmap_tlb_droppmap(pm)
#define pmap_tlb_shootwait()
#endif