From 9b27ceb6dc4f4ae7a978a8aa95cd0bd8c2e5052b Mon Sep 17 00:00:00 2001 From: Roman Kurakin Date: Thu, 23 Sep 2004 16:06:27 +0000 Subject: [PATCH] Invalidate cache after changing pte entry. Discussed with: jhp and njl MFC after: 5 days --- sys/i386/i386/mp_machdep.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index 915e3adc44fc..b4af6e42de80 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -737,8 +737,9 @@ install_ap_tramp(void) { int x; int size = *(int *) ((u_long) & bootMP_size); + vm_offset_t va = boot_address + KERNBASE; u_char *src = (u_char *) ((u_long) bootMP); - u_char *dst = (u_char *) boot_address + KERNBASE; + u_char *dst = (u_char *) va; u_int boot_base = (u_int) bootMP; u_int8_t *dst8; u_int16_t *dst16; @@ -746,7 +747,10 @@ install_ap_tramp(void) POSTCODE(INSTALL_AP_TRAMP_POST); - pmap_kenter(boot_address + KERNBASE, boot_address); + KASSERT (size <= PAGE_SIZE, + ("'size' do not fit into PAGE_SIZE, as expected.")); + pmap_kenter(va, boot_address); + pmap_invalidate_page (kernel_pmap, va); for (x = 0; x < size; ++x) *dst++ = *src++; @@ -757,7 +761,7 @@ install_ap_tramp(void) */ /* boot code is located in KERNEL space */ - dst = (u_char *) boot_address + KERNBASE; + dst = (u_char *) va; /* modify the lgdt arg */ dst32 = (u_int32_t *) (dst + ((u_int) & mp_gdtbase - boot_base));