Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Aug 2021 13:49:52 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 7f39284c271b - stable/13 - amd64: Set MSR_KGSBASE to 0 during AP startup
Message-ID:  <202108121349.17CDnq8U052519@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by markj:

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

commit 7f39284c271b6c5801b6af9a9f0e46805528b244
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-07-29 14:14:05 +0000
Commit:     Mark Johnston <markj@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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108121349.17CDnq8U052519>