From owner-svn-src-stable-10@freebsd.org Wed Nov 11 01:32:36 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85A42A2A498; Wed, 11 Nov 2015 01:32:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5897D1AFE; Wed, 11 Nov 2015 01:32:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAB1WZ8m001533; Wed, 11 Nov 2015 01:32:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAB1WZVK001531; Wed, 11 Nov 2015 01:32:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201511110132.tAB1WZVK001531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 11 Nov 2015 01:32:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r290668 - in stable: 10/sys/i386/i386 10/sys/i386/include 9/sys/i386/i386 9/sys/i386/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2015 01:32:36 -0000 Author: jhb Date: Wed Nov 11 01:32:35 2015 New Revision: 290668 URL: https://svnweb.freebsd.org/changeset/base/290668 Log: MFC 284324,290164: Workaround debuggers that try to read the full 32-bit words holding selectors in trapframes. 284324: Ensure that the upper 16 bits of segment registers manually saved in trapframes are cleared by explicitly pushing a zero and then moving the segment register into the low 16 bits. Certain Intel processors treat a push of a segment register as a move of the segment register into the low 16 bits leaving the upper 16 bits of the word in the stack unchanged. 290164: Use movw instead of movl (or plain mov) when moving segment registers into memory. This is a nop on clang's assembler, but some assemblers complain if the size suffix is incorrect. Modified: stable/10/sys/i386/i386/exception.s stable/10/sys/i386/include/asmacros.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/i386/i386/exception.s stable/9/sys/i386/include/asmacros.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/i386/i386/exception.s ============================================================================== --- stable/10/sys/i386/i386/exception.s Wed Nov 11 00:45:41 2015 (r290667) +++ stable/10/sys/i386/i386/exception.s Wed Nov 11 01:32:35 2015 (r290668) @@ -158,9 +158,12 @@ IDTVEC(xmm) .type alltraps,@function alltraps: pushal - pushl %ds - pushl %es - pushl %fs + pushl $0 + movw %ds,(%esp) + pushl $0 + movw %es,(%esp) + pushl $0 + movw %fs,(%esp) alltraps_with_regs_pushed: SET_KERNEL_SREGS cld @@ -234,9 +237,12 @@ IDTVEC(lcall_syscall) pushl $7 /* sizeof "lcall 7,0" */ subl $4,%esp /* skip over tf_trapno */ pushal - pushl %ds - pushl %es - pushl %fs + pushl $0 + movw %ds,(%esp) + pushl $0 + movw %es,(%esp) + pushl $0 + movw %fs,(%esp) SET_KERNEL_SREGS cld FAKE_MCOUNT(TF_EIP(%esp)) @@ -260,9 +266,12 @@ IDTVEC(int0x80_syscall) pushl $2 /* sizeof "int 0x80" */ subl $4,%esp /* skip over tf_trapno */ pushal - pushl %ds - pushl %es - pushl %fs + pushl $0 + movw %ds,(%esp) + pushl $0 + movw %es,(%esp) + pushl $0 + movw %fs,(%esp) SET_KERNEL_SREGS cld FAKE_MCOUNT(TF_EIP(%esp)) @@ -417,13 +426,16 @@ doreti_iret: doreti_iret_fault: subl $8,%esp pushal - pushl %ds + pushl $0 + movw %ds,(%esp) .globl doreti_popl_ds_fault doreti_popl_ds_fault: - pushl %es + pushl $0 + movw %es,(%esp) .globl doreti_popl_es_fault doreti_popl_es_fault: - pushl %fs + pushl $0 + movw %fs,(%esp) .globl doreti_popl_fs_fault doreti_popl_fs_fault: sti Modified: stable/10/sys/i386/include/asmacros.h ============================================================================== --- stable/10/sys/i386/include/asmacros.h Wed Nov 11 00:45:41 2015 (r290667) +++ stable/10/sys/i386/include/asmacros.h Wed Nov 11 01:32:35 2015 (r290668) @@ -146,9 +146,12 @@ pushl $0 ; /* dummy error code */ \ pushl $0 ; /* dummy trap type */ \ pushal ; /* 8 ints */ \ - pushl %ds ; /* save data and extra segments ... */ \ - pushl %es ; \ - pushl %fs + pushl $0 ; /* save data and extra segments ... */ \ + movw %ds,(%esp) ; \ + pushl $0 ; \ + movw %es,(%esp) ; \ + pushl $0 ; \ + movw %fs,(%esp) #define POP_FRAME \ popl %fs ; \