Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Sep 2008 20:28:23 GMT
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 149440 for review
Message-ID:  <200809082028.m88KSN0O003509@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=149440

Change 149440 by peter@peter_overcee on 2008/09/08 20:27:38

	revert fsbase/gsbase tweaks.  OBE.

Affected files ...

.. //depot/projects/hammer/sys/amd64/amd64/cpu_switch.S#49 edit
.. //depot/projects/hammer/sys/amd64/amd64/genassym.c#55 edit
.. //depot/projects/hammer/sys/amd64/amd64/machdep.c#172 edit
.. //depot/projects/hammer/sys/amd64/amd64/sys_machdep.c#28 edit
.. //depot/projects/hammer/sys/amd64/amd64/vm_machdep.c#93 edit
.. //depot/projects/hammer/sys/amd64/ia32/ia32_signal.c#27 edit
.. //depot/projects/hammer/sys/amd64/include/pcpu.h#32 edit
.. //depot/projects/hammer/sys/amd64/linux32/linux32_machdep.c#24 edit
.. //depot/projects/hammer/sys/amd64/linux32/linux32_sysvec.c#22 edit

Differences ...

==== //depot/projects/hammer/sys/amd64/amd64/cpu_switch.S#49 (text+ko) ====

@@ -84,7 +84,6 @@
 	movq	TD_PCB(%rsi),%r8		/* newtd->td_proc */
 	movq	PCB_CR3(%r8),%rdx
 	movq	%rdx,%cr3			/* new address space */
-	movq    TD_PCB(%rsi),%r8
 	jmp	swact
 END(cpu_throw)
 
@@ -191,33 +190,27 @@
 
 	/* Skip loading user fsbase/gsbase for kthreads */
 	testl	$TDP_KTHREAD,TD_PFLAGS(%rsi)
-	jnz	do_tss
+	jnz	do_kthread
 
 	testl	$PCB_32BIT,PCB_FLAGS(%r8)
 	jnz	load_seg
 done_load_seg:
-	movq	PCPU(FSBASE),%r10
-	movq	PCPU(GSBASE),%r11
 
-	cmpq	PCB_FSBASE(%r8),%r10
+	cmpq	PCB_FSBASE(%r8),%r9
 	jz	1f
 	/* Restore userland %fs */
 	movl	$MSR_FSBASE,%ecx
 	movl	PCB_FSBASE(%r8),%eax
 	movl	PCB_FSBASE+4(%r8),%edx
 	wrmsr
-	movq	PCB_FSBASE(%r8),%rax
-	movq	%rax,PCPU(FSBASE)
 1:
-	cmpq	PCB_GSBASE(%r8),%r11
+	cmpq	PCB_GSBASE(%r8),%r10
 	jz	2f
 	/* Restore userland %gs */
 	movl	$MSR_KGSBASE,%ecx
 	movl	PCB_GSBASE(%r8),%eax
 	movl	PCB_GSBASE+4(%r8),%edx
 	wrmsr
-	movq	PCB_GSBASE(%r8),%rax
-	movq	%rax,PCPU(GSBASE)
 2:
 
 do_tss:

==== //depot/projects/hammer/sys/amd64/amd64/genassym.c#55 (text+ko) ====

@@ -199,8 +199,6 @@
 ASSYM(PC_TSSP, offsetof(struct pcpu, pc_tssp));
 ASSYM(PC_RSP0, offsetof(struct pcpu, pc_rsp0));
 ASSYM(PC_GS32P, offsetof(struct pcpu, pc_gs32p));
-ASSYM(PC_FSBASE, offsetof(struct pcpu, pc_fsbase));
-ASSYM(PC_GSBASE, offsetof(struct pcpu, pc_gsbase));
  
 ASSYM(LA_VER, offsetof(struct LAPIC, version));
 ASSYM(LA_TPR, offsetof(struct LAPIC, tpr));

==== //depot/projects/hammer/sys/amd64/amd64/machdep.c#172 (text+ko) ====

@@ -732,8 +732,6 @@
 	critical_enter();
 	wrmsr(MSR_FSBASE, 0);
 	wrmsr(MSR_KGSBASE, 0);	/* User value while we're in the kernel */
-	PCPU_SET(fsbase, 0);
-	PCPU_SET(gsbase, 0);
 	pcb->pcb_fsbase = 0;
 	pcb->pcb_gsbase = 0;
 	critical_exit();

==== //depot/projects/hammer/sys/amd64/amd64/sys_machdep.c#28 (text+ko) ====

@@ -73,7 +73,6 @@
 		if (!error) {
 			critical_enter();
 			wrmsr(MSR_FSBASE, i386base);
-			PCPU_SET(fsbase, i386base);
 			pcb->pcb_fsbase = i386base;
 			critical_exit();
 		}
@@ -87,7 +86,6 @@
 		if (!error) {
 			critical_enter();
 			wrmsr(MSR_KGSBASE, i386base);
-			PCPU_SET(gsbase, i386base);
 			pcb->pcb_gsbase = i386base;
 			critical_exit();
 		}
@@ -102,7 +100,6 @@
 			if (a64base < VM_MAXUSER_ADDRESS) {
 				critical_enter();
 				wrmsr(MSR_FSBASE, a64base);
-				PCPU_SET(fsbase, a64base);
 				pcb->pcb_fsbase = a64base;
 				critical_exit();
 			} else {
@@ -121,7 +118,6 @@
 			if (a64base < VM_MAXUSER_ADDRESS) {
 				critical_enter();
 				wrmsr(MSR_KGSBASE, a64base);
-				PCPU_SET(gsbase, a64base);
 				pcb->pcb_gsbase = a64base;
 				critical_exit();
 			} else {

==== //depot/projects/hammer/sys/amd64/amd64/vm_machdep.c#93 (text+ko) ====

@@ -374,7 +374,6 @@
 			critical_enter();
 			td->td_pcb->pcb_gsbase = (register_t)tls_base;
 			wrmsr(MSR_KGSBASE, td->td_pcb->pcb_gsbase);
-			PCPU_SET(gsbase, td->td_pcb->pcb_gsbase);
 			critical_exit();
 		} else {
 			td->td_pcb->pcb_gsbase = (register_t)tls_base;
@@ -386,7 +385,6 @@
 		critical_enter();
 		td->td_pcb->pcb_fsbase = (register_t)tls_base;
 		wrmsr(MSR_FSBASE, td->td_pcb->pcb_fsbase);
-		PCPU_SET(fsbase, td->td_pcb->pcb_fsbase);
 		critical_exit();
 	} else {
 		td->td_pcb->pcb_fsbase = (register_t)tls_base;

==== //depot/projects/hammer/sys/amd64/ia32/ia32_signal.c#27 (text+ko) ====

@@ -718,8 +718,6 @@
 	critical_enter();
 	wrmsr(MSR_FSBASE, 0);
 	wrmsr(MSR_KGSBASE, 0);	/* User value while we're in the kernel */
-	PCPU_SET(fsbase, 0);
-	PCPU_SET(gsbase, 0);
 	pcb->pcb_fsbase = 0;
 	pcb->pcb_gsbase = 0;
 	critical_exit();

==== //depot/projects/hammer/sys/amd64/include/pcpu.h#32 (text+ko) ====

@@ -49,9 +49,7 @@
 	register_t pc_scratch_rsp;	/* User %rsp in syscall */	\
 	u_int	pc_apic_id;						\
 	u_int   pc_acpi_id;		/* ACPI CPU id */		\
-	struct user_segment_descriptor	*pc_gs32p;			\
-	register_t pc_fsbase;		/* User values of fsbase */	\
-	register_t pc_gsbase		/* User values of gsbase */
+	struct user_segment_descriptor	*pc_gs32p
 
 #ifdef _KERNEL
 #define PCPU_MD_ALIGN	__aligned(64)	/* use unique cache line per entry */

==== //depot/projects/hammer/sys/amd64/linux32/linux32_machdep.c#24 (text+ko) ====

@@ -1354,7 +1354,6 @@
 	td->td_pcb->pcb_gs32sd = *PCPU_GET(gs32p) = sd;
 	td->td_pcb->pcb_flags |= PCB_32BIT | PCB_GS32BIT;
 	wrmsr(MSR_KGSBASE, td->td_pcb->pcb_gsbase);
-	PCPU_SET(gsbase, td->td_pcb->pcb_gsbase);
 	critical_exit();
 
 	return (0);

==== //depot/projects/hammer/sys/amd64/linux32/linux32_sysvec.c#22 (text+ko) ====

@@ -820,8 +820,6 @@
 	critical_enter();
 	wrmsr(MSR_FSBASE, 0);
 	wrmsr(MSR_KGSBASE, 0);	/* User value while we're in the kernel */
-	PCPU_SET(fsbase, 0);
-	PCPU_SET(gsbase, 0);
 	pcb->pcb_fsbase = 0;
 	pcb->pcb_gsbase = 0;
 	critical_exit();



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