Date: Sat, 30 Aug 2008 14:03:00 -0700 From: "Artem Belevich" <fbsdlist@src.cx> To: "Kostik Belousov" <kostikbel@gmail.com> Cc: Bernd Walter <ticso@cicely7.cicely.de>, freebsd-current@freebsd.org Subject: Re: __tls_get_addr problem with recent current Message-ID: <ed91d4a80808301403t5b776d10ubd184bc1ff01215@mail.gmail.com> In-Reply-To: <20080830195844.GI2038@deviant.kiev.zoral.com.ua> References: <ed91d4a80808300946s49ff076dw64b57f8e9058f2d@mail.gmail.com> <20080830183804.GG2038@deviant.kiev.zoral.com.ua> <ed91d4a80808301250j1a4802d4o412c6b5e30979079@mail.gmail.com> <20080830195844.GI2038@deviant.kiev.zoral.com.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
With the new patch kernel has crashed as soon as I ran i386 app,
though the crash happened within in-kernel thread g_up:
Fatal trap 12: page fault while in kernel mode
cpuid = 2; apic id = 02
fault virtual address = 0x20
fault code = supervisor read data, page not present
instruction pointer = 0x8:0xffffffff804a821f
stack pointer = 0x10:0xffffffffac280b60
frame pointer = 0x10:0x0
code segment = base 0x0, limit 0xfffff, type 0x1b
= DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags = resume, IOPL = 0
current process = 3 (g_up)
trap number = 12
panic: page fault
cpuid = 2
Uptime: 37s
Physical memory: 8169 MB
Dumping 380 MB: 365 349 333 317 301 285 269 253 237 221 205 189 173
157 141 125 109 93 77 61 45 29 13
--Artem
On 8/30/08, Kostik Belousov <kostikbel@gmail.com> wrote:
> Hmm, after I sent the patch, I started thought that, in fact, we shall
> reread the fsbase when switching from 32bit process, not when switching
> to such process. Could you, please, retest with the following change
> (against stock sources, not over the previous patch) ?
>
>
> diff --git a/sys/amd64/amd64/cpu_switch.S b/sys/amd64/amd64/cpu_switch.S
>
> index f34b0cc..29ce2e1 100644
>
> --- a/sys/amd64/amd64/cpu_switch.S
> +++ b/sys/amd64/amd64/cpu_switch.S
>
> @@ -249,6 +249,10 @@ store_seg:
> 1: movl %ds,PCB_DS(%r8)
> movl %es,PCB_ES(%r8)
> movl %fs,PCB_FS(%r8)
> + movl $MSR_FSBASE,%ecx
>
> + rdmsr
> + shlq $32,%rdx
> + leaq (%rax,%rdx),%r9
>
> jmp done_store_seg
>
> 2: movq PCB_GS32P(%r8),%rax
>
> movq (%rax),%rax
>
>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ed91d4a80808301403t5b776d10ubd184bc1ff01215>
