From owner-p4-projects@FreeBSD.ORG Mon Sep 8 20:28:23 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 877D41065687; Mon, 8 Sep 2008 20:28:23 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AA461065676 for ; Mon, 8 Sep 2008 20:28:23 +0000 (UTC) (envelope-from peter-gmail@wemm.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 3C9BE8FC1A for ; Mon, 8 Sep 2008 20:28:23 +0000 (UTC) (envelope-from peter-gmail@wemm.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m88KSNCe003517 for ; Mon, 8 Sep 2008 20:28:23 GMT (envelope-from peter-gmail@wemm.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m88KSN0O003509 for perforce@freebsd.org; Mon, 8 Sep 2008 20:28:23 GMT (envelope-from peter-gmail@wemm.org) Date: Mon, 8 Sep 2008 20:28:23 GMT Message-Id: <200809082028.m88KSN0O003509@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter-gmail@wemm.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 149440 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Sep 2008 20:28:23 -0000 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();