Date: Sun, 11 May 2003 15:50:21 -0700 (PDT) From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 30971 for review Message-ID: <200305112250.h4BMoLKM021362@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=30971 Change 30971 by peter@peter_daintree on 2003/05/11 15:50:00 IFC @30970 Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/elf_machdep.c#7 integrate .. //depot/projects/hammer/sys/amd64/amd64/exception.S#5 integrate .. //depot/projects/hammer/sys/amd64/amd64/genassym.c#7 integrate .. //depot/projects/hammer/sys/amd64/amd64/machdep.c#20 integrate .. //depot/projects/hammer/sys/amd64/amd64/pmap.c#7 integrate .. //depot/projects/hammer/sys/amd64/amd64/support.S#5 integrate .. //depot/projects/hammer/sys/amd64/amd64/trap.c#10 integrate .. //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#16 integrate .. //depot/projects/hammer/sys/i386/linux/linux_sysvec.c#8 integrate .. //depot/projects/hammer/usr.sbin/diskinfo/diskinfo.8#2 integrate Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/elf_machdep.c#7 (text+ko) ==== @@ -22,7 +22,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/elf_machdep.c,v 1.14 2003/05/01 01:05:21 peter Exp $ + * $FreeBSD: src/sys/amd64/amd64/elf_machdep.c,v 1.15 2003/05/11 22:40:24 peter Exp $ */ #include <sys/param.h> ==== //depot/projects/hammer/sys/amd64/amd64/exception.S#5 (text+ko) ==== @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.106 2003/05/08 00:05:00 peter Exp $ + * $FreeBSD: src/sys/amd64/amd64/exception.S,v 1.107 2003/05/11 22:38:54 peter Exp $ */ #include <machine/asmacros.h> @@ -199,7 +199,7 @@ * XXX The PCPU stuff is stubbed out right now... */ IDTVEC(fast_syscall) - /* swapgs */ + /* XXX swapgs */ movq %rsp,PCPU(SCRATCH_RSP) movq common_tss+COMMON_TSS_RSP0,%rsp /* Now emulate a trapframe. Ugh. */ @@ -255,7 +255,7 @@ movq TF_RIP(%rsp),%rcx /* original %rip */ movq TF_RSP(%rsp),%r9 /* user stack pointer */ movq %r9,%rsp /* original %rsp */ - /* swapgs */ + /* XXX swapgs */ sysretq 3: /* Requested full context restore, use doreti for that */ andq $~PCB_FULLCTX,PCB_FLAGS(%rax) ==== //depot/projects/hammer/sys/amd64/amd64/genassym.c#7 (text+ko) ==== @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)genassym.c 5.11 (Berkeley) 5/10/91 - * $FreeBSD: src/sys/amd64/amd64/genassym.c,v 1.141 2003/05/01 01:05:21 peter Exp $ + * $FreeBSD: src/sys/amd64/amd64/genassym.c,v 1.142 2003/05/11 22:39:40 peter Exp $ */ #include "opt_compat.h" ==== //depot/projects/hammer/sys/amd64/amd64/machdep.c#20 (text+ko) ==== @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.569 2003/05/10 00:49:56 peter Exp $ + * $FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.570 2003/05/11 22:40:24 peter Exp $ */ #include "opt_atalk.h" ==== //depot/projects/hammer/sys/amd64/amd64/pmap.c#7 (text+ko) ==== @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.406 2003/05/01 01:05:21 peter Exp $ + * $FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.407 2003/05/11 22:40:24 peter Exp $ */ /*- * Copyright (c) 2003 Networks Associates Technology, Inc. ==== //depot/projects/hammer/sys/amd64/amd64/support.S#5 (text+ko) ==== @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.98 2003/05/10 00:49:56 peter Exp $ + * $FreeBSD: src/sys/amd64/amd64/support.S,v 1.99 2003/05/11 22:38:54 peter Exp $ */ #include <machine/asmacros.h> ==== //depot/projects/hammer/sys/amd64/amd64/trap.c#10 (text+ko) ==== @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $FreeBSD: src/sys/amd64/amd64/trap.c,v 1.253 2003/05/08 08:25:51 peter Exp $ + * $FreeBSD: src/sys/amd64/amd64/trap.c,v 1.254 2003/05/11 22:40:25 peter Exp $ */ /* @@ -567,7 +567,8 @@ struct trapframe *frame; vm_offset_t eva; { - int code, type, ss, esp; + int code, type, ss; + long esp; struct soft_segment_descriptor softseg; code = frame->tf_err; @@ -594,7 +595,7 @@ ss = GSEL(GDATA_SEL, SEL_KPL); esp = (long)&frame->tf_rsp; } - printf("stack pointer = 0x%x:0x%x\n", ss, esp); + printf("stack pointer = 0x%x:0x%lx\n", ss, esp); printf("frame pointer = 0x%x:0x%lx\n", ss, frame->tf_rbp); printf("code segment = base 0x%lx, limit 0x%lx, type 0x%x\n", softseg.ssd_base, softseg.ssd_limit, softseg.ssd_type); ==== //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#16 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/boot/i386/libi386/elf64_freebsd.c,v 1.12 2003/05/01 03:56:29 peter Exp $ + * $FreeBSD: src/sys/boot/i386/libi386/elf64_freebsd.c,v 1.13 2003/05/11 22:42:29 peter Exp $ */ #define __ELF_WORD_SIZE 64 ==== //depot/projects/hammer/sys/i386/linux/linux_sysvec.c#8 (text+ko) ==== @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/i386/linux/linux_sysvec.c,v 1.121 2003/04/17 22:18:07 jhb Exp $ + * $FreeBSD: src/sys/i386/linux/linux_sysvec.c,v 1.122 2003/05/11 21:51:11 mdodd Exp $ */ /* XXX we use functions that might not exist. */ @@ -111,6 +111,8 @@ caddr_t *params); static void linux_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code); +static void exec_linux_setregs(struct thread *td, u_long entry, + u_long stack, u_long ps_strings); /* * Linux syscalls return negative errno's, we do positive and map them @@ -805,6 +807,23 @@ return(error); } +/* + * exec_setregs may initialize some registers differently than Linux + * does, thus potentially confusing Linux binaries. If necessary, we + * override the exec_setregs default(s) here. + */ +static void +exec_linux_setregs(struct thread *td, u_long entry, + u_long stack, u_long ps_strings) +{ + struct pcb *pcb = td->td_pcb; + + exec_setregs(td, entry, stack, ps_strings); + + /* Linux sets %gs to 0, we default to _udatasel */ + pcb->pcb_gs = 0; load_gs(0); +} + struct sysentvec linux_sysvec = { LINUX_SYS_MAXSYSCALL, linux_sysent, @@ -830,7 +849,7 @@ PS_STRINGS, VM_PROT_ALL, exec_copyout_strings, - exec_setregs + exec_linux_setregs }; struct sysentvec elf_linux_sysvec = { @@ -858,7 +877,7 @@ PS_STRINGS, VM_PROT_ALL, exec_copyout_strings, - exec_setregs + exec_linux_setregs }; static Elf32_Brandinfo linux_brand = { ==== //depot/projects/hammer/usr.sbin/diskinfo/diskinfo.8#2 (text+ko) ==== @@ -26,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD: src/usr.sbin/diskinfo/diskinfo.8,v 1.1 2003/04/09 10:52:10 phk Exp $ +.\" $FreeBSD: src/usr.sbin/diskinfo/diskinfo.8,v 1.2 2003/05/11 22:22:10 gordon Exp $ .\" .Dd April 9, 2003 .Dt DISKINFO 8 @@ -60,8 +60,8 @@ .Sh AUTHORS .An Poul-Henning Kamp .Sh BUGS -There are in order of increasing severity lies, -damn lines, statistics and computer benchmarks. +There are in order of increasing severity: lies, +damn lies, statistics, and computer benchmarks. .Sh HISTORY .The .Nm
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305112250.h4BMoLKM021362>