From owner-freebsd-i386@FreeBSD.ORG Mon Mar 21 15:40:03 2005 Return-Path: Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 63E4116A4CE for ; Mon, 21 Mar 2005 15:40:03 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 12B1D43D2D for ; Mon, 21 Mar 2005 15:40:03 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j2LFe2Tw084520 for ; Mon, 21 Mar 2005 15:40:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j2LFe2eb084519; Mon, 21 Mar 2005 15:40:02 GMT (envelope-from gnats) Resent-Date: Mon, 21 Mar 2005 15:40:02 GMT Resent-Message-Id: <200503211540.j2LFe2eb084519@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-i386@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Andrey Simonenko Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E819616A4CE for ; Mon, 21 Mar 2005 15:34:51 +0000 (GMT) Received: from comsys.ntu-kpi.kiev.ua (comsys.ntu-kpi.kiev.ua [195.245.194.142]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA55343D41 for ; Mon, 21 Mar 2005 15:34:37 +0000 (GMT) (envelope-from simon@comsys.ntu-kpi.kiev.ua) Received: from pm514-9.comsys.ntu-kpi.kiev.ua (pm514-9.comsys.ntu-kpi.kiev.ua [10.18.54.109]) (authenticated bits=0)j2LFc6Bf033462 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 21 Mar 2005 17:38:07 +0200 (EET) Received: by pm514-9.comsys.ntu-kpi.kiev.ua (Postfix, from userid 1000) id 1AF2AB4; Mon, 21 Mar 2005 17:34:19 +0200 (EET) Message-Id: <20050321153418.GA461@pm514-9.comsys.ntu-kpi.kiev.ua> Date: Mon, 21 Mar 2005 17:34:18 +0200 From: Andrey Simonenko To: FreeBSD-gnats-submit@FreeBSD.org Subject: i386/79091: Small optimization for i386/support.s X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2005 15:40:03 -0000 >Number: 79091 >Category: i386 >Synopsis: Small optimization for i386/support.s >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-i386 >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Mar 21 15:40:02 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Andrey Simonenko >Release: FreeBSD 5.3-RELEASE-p5 i386 >Organization: >Environment: >Description: suword(), suword16(), subyte() and copyinstr() from i386/support.s restore "trashed" register %ecx, but this register is not really trashed in case of non I386_CPU in su*() functions and in copyinstr(). The same situation with the same functions in amd64/support.S. And the same situation with 4.x, 5.x and HEAD. >How-To-Repeat: >Fix: --- support.s.orig Sat Nov 13 11:29:48 2004 +++ support.s Fri Mar 18 14:00:56 2005 @@ -1327,7 +1327,9 @@ movl 8(%esp),%eax movl %eax,(%edx) xorl %eax,%eax - movl PCPU(CURPCB),%ecx +#ifdef I386_CPU + movl PCPU(CURPCB),%ecx /* restore trashed register */ +#endif movl %eax,PCB_ONFAULT(%ecx) ret @@ -1370,7 +1372,9 @@ movw 8(%esp),%ax movw %ax,(%edx) xorl %eax,%eax +#ifdef I386_CPU movl PCPU(CURPCB),%ecx /* restore trashed register */ +#endif movl %eax,PCB_ONFAULT(%ecx) ret @@ -1412,7 +1416,9 @@ movb 8(%esp),%al movb %al,(%edx) xorl %eax,%eax +#ifdef I386_CPU movl PCPU(CURPCB),%ecx /* restore trashed register */ +#endif movl %eax,PCB_ONFAULT(%ecx) ret @@ -1475,7 +1481,6 @@ cpystrflt_x: /* set *lencopied and return %eax */ - movl PCPU(CURPCB),%ecx movl $0,PCB_ONFAULT(%ecx) movl 20(%esp),%ecx subl %edx,%ecx >Release-Note: >Audit-Trail: >Unformatted: To: FreeBSD-gnats-submit@freebsd.org From: Andrey Simonenko Reply-To: Andrey Simonenko Cc: X-send-pr-version: 3.113 X-GNATS-Notify: