GS logging and performance fixes. Nopatch mode.

Index: dlls/ntdll/signal_x86_64.c
--- dlls/ntdll/signal_x86_64.c.orig
+++ dlls/ntdll/signal_x86_64.c
@@ -496,7 +496,12 @@ __ASM_GLOBAL_FUNC( KiUserCallbackDispatcher,
                    "movl 0x28(%rsp),%edx\n\t"  /* len */
                    "movl 0x2c(%rsp),%r8d\n\t"  /* id */
 #ifdef __WINE_PE_BUILD
+#ifdef __WINE_OPENBSD_GS_REPLACE
+                   "movq %fs:" __WINE_OPENBSD_TEB_TLS_OFFSET_STR ",%rax\n\t" /* teb load on OpenBSD */
+                   "movq 0x60(%rax),%rax\n\t"   /* peb on OpenBSD */
+#else
                    "movq %gs:0x60,%rax\n\t"     /* peb */
+#endif
                    "movq 0x58(%rax),%rax\n\t"   /* peb->KernelCallbackTable */
                    "call *(%rax,%r8,8)\n\t"     /* KernelCallbackTable[id] */
                    ".seh_handler " __ASM_NAME("user_callback_handler") ", @except\n\t"
@@ -906,7 +911,12 @@ __ASM_GLOBAL_FUNC( RtlRaiseException,
                    "movq %rax,0xf8(%rdx)\n\t"   /* context->Rip */
                    "movq %rax,0x10(%rcx)\n\t"   /* rec->ExceptionAddress */
                    "movl $1,%r8d\n\t"
-                   "movq %gs:0x60,%rax\n\t"     /* Peb */
+#ifdef __WINE_OPENBSD_GS_REPLACE
+                   "movq %fs:" __WINE_OPENBSD_TEB_TLS_OFFSET_STR ",%rax\n\t" /* teb load on OpenBSD */
+                   "movq 0x60(%rax),%rax\n\t"   /* peb on OpenBSD */
+#else
+                   "movq %gs:0x60,%rax\n\t"     /* peb */
+#endif
                    "cmpb $0,0x02(%rax)\n\t"     /* BeingDebugged */
                    "jne 1f\n\t"
                    "call " __ASM_NAME("dispatch_exception") "\n"
@@ -1150,7 +1160,12 @@ __ASM_GLOBAL_FUNC( DbgUiRemoteBreakin,
                    ".seh_stackalloc 0x28\n\t"
                    ".seh_endprologue\n\t"
                    ".seh_handler DbgUiRemoteBreakin_handler, @except\n\t"
-                   "mov %gs:0x60,%rax\n\t"
+#ifdef __WINE_OPENBSD_GS_REPLACE
+                   "movq %fs:" __WINE_OPENBSD_TEB_TLS_OFFSET_STR ",%rax\n\t" /* teb load on OpenBSD */
+                   "movq 0x60(%rax),%rax\n\t"   /* peb on OpenBSD */
+#else
+                   "movq %gs:0x60,%rax\n\t"     /* peb */
+#endif
                    "cmpb $0,2(%rax)\n\t"
                    "je 1f\n\t"
                    "call " __ASM_NAME("DbgBreakPoint") "\n"
