git: 7f39284c271b - stable/13 - amd64: Set MSR_KGSBASE to 0 during AP startup

Mark Johnston markj at FreeBSD.org
Thu Aug 12 13:49:52 UTC 2021


The branch stable/13 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=7f39284c271b6c5801b6af9a9f0e46805528b244

commit 7f39284c271b6c5801b6af9a9f0e46805528b244
Author:     Mark Johnston <markj at FreeBSD.org>
AuthorDate: 2021-07-29 14:14:05 +0000
Commit:     Mark Johnston <markj at FreeBSD.org>
CommitDate: 2021-08-12 13:43:31 +0000

    amd64: Set MSR_KGSBASE to 0 during AP startup
    
    There is no reason to initialize it to anything else, and this matches
    initialization of the BSP.  No functional change intended.
    
    Reviewed by:    kib
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit e1537450838134daaf584d1f17e661673b2c4c76)
---
 sys/amd64/amd64/mp_machdep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c
index 41c082ff40e9..d1064262891f 100644
--- a/sys/amd64/amd64/mp_machdep.c
+++ b/sys/amd64/amd64/mp_machdep.c
@@ -337,8 +337,8 @@ init_secondary(void)
 	lgdt(&ap_gdt);			/* does magic intra-segment return */
 
 	wrmsr(MSR_FSBASE, 0);		/* User value */
-	wrmsr(MSR_GSBASE, (u_int64_t)pc);
-	wrmsr(MSR_KGSBASE, (u_int64_t)pc);	/* XXX User value while we're in the kernel */
+	wrmsr(MSR_GSBASE, (uint64_t)pc);
+	wrmsr(MSR_KGSBASE, 0);		/* User value */
 	fix_cpuid();
 
 	lidt(&r_idt);


More information about the dev-commits-src-branches mailing list