i386/79091: Small optimization for i386/support.s
Andrey Simonenko
simon at comsys.ntu-kpi.kiev.ua
Mon Mar 21 07:40:03 PST 2005
>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 at freebsd.org
From: Andrey Simonenko <simon at comsys.ntu-kpi.kiev.ua>
Reply-To: Andrey Simonenko <simon at comsys.ntu-kpi.kiev.ua>
Cc:
X-send-pr-version: 3.113
X-GNATS-Notify:
More information about the freebsd-i386
mailing list