From nobody Wed Sep 14 15:57:41 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MSQ2s5q3Wz4cRY7; Wed, 14 Sep 2022 15:57:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MSQ2s5KBfz3G5t; Wed, 14 Sep 2022 15:57:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663171061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2suKMQrYvlObk/z0BsBzSZ1FhLZopXgA4lkhvfYDFcA=; b=i3vHYXvManUmsyyQNc+13Ujsywhp3lEt/QchP30RYvf8GWa83Si0cXFUwvCrHskwKzY4Hh 7FtFp+711VSSPDzBqjFeU7i3ZI4oEL5r3TaPLxSxEOpIdhgytPvw4ptYifXf8CI6CD0sKD cTnV06kKvCn+5O+m5nb9RTDddVgVmhEfdyFSusqoIScdhg96Jf/UixQLHNh7/0qPPUIpKQ yhe0cQBlUlLIOF41RmVFfiUq4FHSQjfI5tI4AQvKHycHJUCuRx87Gw7Tz906QVL4J0LEcY 3kuCPdblAQs0wlntBoVoINVt/9aZen9FMYMsEzPOa7JD4ymJJFKCYPGwzOzHxA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MSQ2s4PNwzjs8; Wed, 14 Sep 2022 15:57:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28EFvfkg010602; Wed, 14 Sep 2022 15:57:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28EFvfkT010601; Wed, 14 Sep 2022 15:57:41 GMT (envelope-from git) Date: Wed, 14 Sep 2022 15:57:41 GMT Message-Id: <202209141557.28EFvfkT010601@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 531335037403 - main - i386 copyout_fast: do not use trampstk for temporal data, reduce ucr3 region List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 53133503740398fbfc770dfdf4d7e123075a241f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663171061; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2suKMQrYvlObk/z0BsBzSZ1FhLZopXgA4lkhvfYDFcA=; b=X1R2CNUMCoSKp5e2JoFR3cCOj0zL9YVVSgMwZvFVqLereAtvJburVS0japMf8DCQGP0vng XKTKMTDVHpT26J297ulzVKI78TSewWn9Ztyvglk5kMl784vy9/4oN6BcL5nFQV7Zn5Htvk tKINXmopuIjwQc4nYUhlH/WGloDANSgTTLOG5pnvLseBGvGE1h/2FEfrrBJ8zXBthZP3jF /iOhewrxsZ6bDcz9c2SRdXd8KPl4I2t8tXSXmLcZo43MyV8Ej2Mh5bQkEWXg6hM7N+p1Bq B1RX1Fw2Nz/zTZEVn7T2d3dUPlgxPDy1rMZqYHLv9fcCwmXlQTqE8xgJ2EwUzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663171061; a=rsa-sha256; cv=none; b=W2heUxqXs9DGdtCMf1wLx5Yl3m96DLI7sknlu0uTFDpP9q1J42w9NFGY+yiwoSdR5x2q3b kHlxcXJFzdacT/BeeqgvEcSXWOH0tKBvSwlO5NXiBEbJ8xMISSwHqeH7JcLgQx1frEnka1 qHQtvCziIPHUb1wm/Nh2aUcgxt1gKHlADkuEP3F7uKBP9zgA9L21JyymMlVL4CFFQJ94ap c4an9SufMkZZsoGq8lHvX+pUCHtuKswfgIGhi7SvbgZyd1ZWlToXLRZQLsqweXLoVislg+ YGEzl3tjJ+stczEgQub6CQEsCdwa0o00s2vfrDEryDG5Pcm51vCJwd1pzMw3jw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=53133503740398fbfc770dfdf4d7e123075a241f commit 53133503740398fbfc770dfdf4d7e123075a241f Author: Konstantin Belousov AuthorDate: 2022-09-05 07:06:15 +0000 Commit: Konstantin Belousov CommitDate: 2022-09-14 15:46:31 +0000 i386 copyout_fast: do not use trampstk for temporal data, reduce ucr3 region This simplifies code a lot. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/i386/i386/copyout_fast.s | 101 +++++++++++-------------------------------- 1 file changed, 26 insertions(+), 75 deletions(-) diff --git a/sys/i386/i386/copyout_fast.s b/sys/i386/i386/copyout_fast.s index d1d17f775872..70647fe7613d 100644 --- a/sys/i386/i386/copyout_fast.s +++ b/sys/i386/i386/copyout_fast.s @@ -46,53 +46,27 @@ ENTRY(copyout_fast) pushl %edi pushl %ebx - movl $copyout_fault,%edx - movl 20(%ebp),%ebx /* KCR3 */ - - movl PCPU(CURPCB),%eax - movl PCB_CR3(%eax),%edi - + movl 20(%ebp),%ebx /* KCR3 */ + movl PCPU(CURPCB),%edx + movl PCB_CR3(%edx),%edx /* UCR3 */ + /* bcopy(%esi = kaddr, %edi = PCPU(copyout_buf), %ecx = len) */ + movl 16(%ebp),%ecx + movl 8(%ebp),%esi cli - movl PCPU(TRAMPSTK),%esi - movl PCPU(COPYOUT_BUF),%eax - subl $4,%esi - movl %eax,(%esi) - movl 12(%ebp),%eax /* udaddr */ - subl $4,%esi - movl %eax,(%esi) - movl 16(%ebp),%eax /* len */ - subl $4,%esi - movl %eax,(%esi) - - subl $4, %esi - movl %edi, (%esi) + movl PCPU(COPYOUT_BUF),%edi + rep; movsb - movl 8(%ebp),%eax /* kaddr */ - subl $4,%esi - movl %eax,(%esi) - movl PCPU(COPYOUT_BUF),%eax - subl $4,%esi - movl %eax,(%esi) - movl 16(%ebp),%eax /* len */ - subl $4,%esi - movl %eax,(%esi) + movl 16(%ebp),%ecx /* len */ + movl PCPU(COPYOUT_BUF),%esi /* kaddr */ + movl 12(%ebp),%edi /* uaddr */ movl %esp,%eax - movl %esi,%esp - - /* bcopy(%esi = kaddr, %edi = PCPU(copyout_buf), %ecx = len) */ - popl %ecx - popl %edi - popl %esi - rep; movsb + movl PCPU(TRAMPSTK),%esp - popl %edi - movl %edi,%cr3 + movl %edx,%cr3 + movl $copyout_fault,%edx /* bcopy(%esi = PCPU(copyout_buf), %edi = udaddr, %ecx = len) */ - popl %ecx - popl %edi - popl %esi pf_x1: rep; movsb movl %ebx,%cr3 @@ -114,53 +88,30 @@ ENTRY(copyin_fast) pushl %edi pushl %ebx - movl $copyout_fault,%edx - movl 20(%ebp),%ebx /* KCR3 */ - + movl 20(%ebp),%ebx /* KCR3 */ movl PCPU(CURPCB),%eax - movl PCB_CR3(%eax),%edi - + movl PCB_CR3(%eax),%edx /* UCR3 */ + movl 16(%ebp),%ecx /* len */ + movl 8(%ebp),%esi /* udaddr */ cli - movl PCPU(TRAMPSTK),%esi - movl PCPU(COPYOUT_BUF),%eax - subl $4,%esi - movl %eax,(%esi) - movl 12(%ebp),%eax /* kaddr */ - subl $4,%esi - movl %eax,(%esi) - movl 16(%ebp),%eax /* len */ - subl $4,%esi - movl %eax,(%esi) - - movl 8(%ebp),%eax /* udaddr */ - subl $4,%esi - movl %eax,(%esi) - movl PCPU(COPYOUT_BUF),%eax - subl $4,%esi - movl %eax,(%esi) - movl 16(%ebp),%eax /* len */ - subl $4,%esi - movl %eax,(%esi) + movl PCPU(COPYOUT_BUF),%edi /* kaddr */ movl %esp,%eax - movl %esi,%esp - movl %edi,%cr3 - + movl PCPU(TRAMPSTK),%esp + movl %edx,%cr3 + movl $copyout_fault,%edx /* bcopy(%esi = udaddr, %edi = PCPU(copyout_buf), %ecx = len) */ - popl %ecx - popl %edi - popl %esi pf_x2: rep; movsb movl %ebx,%cr3 + movl %eax,%esp /* bcopy(%esi = PCPU(copyout_buf), %edi = kaddr, %ecx = len) */ - popl %ecx - popl %edi - popl %esi + movl 16(%ebp),%ecx + movl 12(%ebp),%edi + movl PCPU(COPYOUT_BUF),%esi rep; movsb - movl %eax,%esp sti xorl %eax,%eax