Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177654646
D16618.1794956412.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D16618.1794956412.diff
View Options
Index: sys/amd64/amd64/mp_machdep.c
===================================================================
--- sys/amd64/amd64/mp_machdep.c
+++ sys/amd64/amd64/mp_machdep.c
@@ -58,6 +58,7 @@
#include <vm/vm_param.h>
#include <vm/pmap.h>
#include <vm/vm_kern.h>
+#include <vm/vm_map.h>
#include <vm/vm_extern.h>
#include <x86/apicreg.h>
@@ -293,7 +294,6 @@
pc->pc_gs32p = &gdt[NGDT * cpu + GUGS32_SEL];
pc->pc_ldt = (struct system_segment_descriptor *)&gdt[NGDT * cpu +
GUSERLDT_SEL];
- pc->pc_curpmap = kernel_pmap;
pc->pc_pcid_gen = 1;
pc->pc_pcid_next = PMAP_PCID_KERN + 1;
common_tss[cpu].tss_rsp0 = 0;
@@ -338,6 +338,7 @@
while (atomic_load_acq_int(&aps_ready) == 0)
ia32_pause();
+ pmap_activate_boot(vmspace_pmap(proc0.p_vmspace));
init_secondary_tail();
}
Index: sys/amd64/amd64/pmap.c
===================================================================
--- sys/amd64/amd64/pmap.c
+++ sys/amd64/amd64/pmap.c
@@ -2655,9 +2655,7 @@
__pcpu[i].pc_ucr3 = PMAP_NO_CR3;
}
}
- PCPU_SET(curpmap, kernel_pmap);
- pmap_activate(curthread);
- CPU_FILL(&kernel_pmap->pm_active);
+ pmap_activate_boot(pmap);
}
void
@@ -7529,7 +7527,7 @@
intr_restore(rflags);
if (cached)
PCPU_INC(pm_save_cnt);
- } else if (cr3 != pmap->pm_cr3) {
+ } else {
load_cr3(pmap->pm_cr3);
PCPU_SET(curpmap, pmap);
if (pti) {
@@ -7559,6 +7557,20 @@
critical_exit();
}
+void
+pmap_activate_boot(pmap_t pmap)
+{
+ u_int cpuid;
+
+ cpuid = PCPU_GET(cpuid);
+#ifdef SMP
+ CPU_SET_ATOMIC(cpuid, &pmap->pm_active);
+#else
+ CPU_SET(cpuid, &pmap->pm_active);
+#endif
+ PCPU_SET(curpmap, pmap);
+}
+
void
pmap_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t sz)
{
Index: sys/amd64/include/pmap.h
===================================================================
--- sys/amd64/include/pmap.h
+++ sys/amd64/include/pmap.h
@@ -407,6 +407,7 @@
struct thread;
+void pmap_activate_boot(pmap_t pmap);
void pmap_activate_sw(struct thread *);
void pmap_bootstrap(vm_paddr_t *);
int pmap_cache_bits(pmap_t pmap, int mode, boolean_t is_pde);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 17, 11:00 PM (13 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41809802
Default Alt Text
D16618.1794956412.diff (2 KB)
Attached To
Mode
D16618: amd64: ensure that curproc->p_vmspace pmap always matches PCPU curpmap.
Attached
Detach File
Event Timeline