diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2009-04-23 07:42:03 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2009-04-23 07:42:03 +0000 |
commit | 18121a65baee8e6d183e35718322c538346404b2 (patch) | |
tree | 380d5da9d7c0c6f93daaa67d0847668284368ebb /sys/arch/amd64/include | |
parent | 6907a4b181a62262158dcd13b0f8be32fc89ee19 (diff) |
Make pmap_deactivate a NOP.
Instead of keeping a bitmask of on which cpu the pmap might be active which
we clear in pmap_deactivate, always keep a pointer to the currently loaded
pmap in cpu_info. We can now optimize a context switch to the kernel pmap
(idle and kernel threads) to keep the previously loaded pmap still loaded
and then reuse that pmap if we context switch back to the same process.
Introduce a new IPI to force a pmap reload before the pmap is destroyed.
Clean up cpu_switchto.
toby@ ok
Diffstat (limited to 'sys/arch/amd64/include')
-rw-r--r-- | sys/arch/amd64/include/cpu.h | 14 | ||||
-rw-r--r-- | sys/arch/amd64/include/i82489var.h | 2 | ||||
-rw-r--r-- | sys/arch/amd64/include/pmap.h | 7 |
3 files changed, 10 insertions, 13 deletions
diff --git a/sys/arch/amd64/include/cpu.h b/sys/arch/amd64/include/cpu.h index ff9507bff77..8c92ab3498d 100644 --- a/sys/arch/amd64/include/cpu.h +++ b/sys/arch/amd64/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.41 2009/02/16 15:50:05 jsg Exp $ */ +/* $OpenBSD: cpu.h,v 1.42 2009/04/23 07:42:02 art Exp $ */ /* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */ /*- @@ -69,8 +69,6 @@ struct cpu_info { struct simplelock ci_slock; u_int ci_cpuid; u_int ci_apicid; - u_long ci_spin_locks; - u_long ci_simple_locks; u_int32_t ci_randseed; u_int64_t ci_scratch; @@ -78,12 +76,12 @@ struct cpu_info { struct proc *ci_fpcurproc; int ci_fpsaving; - volatile u_int32_t ci_tlb_ipi_mask; - struct pcb *ci_curpcb; 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; @@ -91,7 +89,6 @@ struct cpu_info { u_int32_t ci_imask[NIPL]; u_int32_t ci_iunmask[NIPL]; - paddr_t ci_idle_pcb_paddr; u_int ci_flags; u_int32_t ci_ipis; @@ -110,11 +107,6 @@ struct cpu_info { struct x86_cache_info ci_cinfo[CAI_COUNT]; - struct timeval ci_cc_time; - int64_t ci_cc_cc; - int64_t ci_cc_ms_delta; - int64_t ci_cc_denom; - char *ci_gdt; volatile int ci_ddb_paused; 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 019aa2cfa59..94b4dfe0619 100644 --- a/sys/arch/amd64/include/pmap.h +++ b/sys/arch/amd64/include/pmap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.h,v 1.21 2009/03/30 16:09:36 oga Exp $ */ +/* $OpenBSD: pmap.h,v 1.22 2009/04/23 07:42:02 art 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 |