From nobody Wed Sep 14 15:57:44 2022 X-Original-To: dev-commits-src-main@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 4MSQ2x1YZcz4cRWp; Wed, 14 Sep 2022 15:57:45 +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 4MSQ2x0q2Fz3Glm; Wed, 14 Sep 2022 15:57:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663171065; 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=54r+8YkFfYtjPZWBp1YJ8rjV9+cQSFs0Ojmip0tDIOo=; b=LXve8YTIXJ7U4VEwXM7vGbQhOc5TJvR1RtfYx1cvLDnY2jdnvTTM+yX9gfz1VCZ4eI9u1P 51JLbbOjlPtE97EGvxRBns/wjiAp6QE3a2lfA/xPrr+X402ujDcB3SGpW35bJlfhtkiTCA SO+5rsJzIFpOfKNrH5od+bGEi0IgFiGqClpr/2R+BcEaeCPws7hhzrthkjJb4dkcGWbIJK IDNbvgUqs8BICmaRpibTJnUeJ0Kf+wSXETBFA8WAEJnD41XntQS56ROV+XfnKcJSf9lq6x fYX7AFsa8mYtybGnrxha3UOibykeY6MwrN7Dc8qf5YhW1IPCB0CI1N/SICwEsw== 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 4MSQ2w6rpSzjtQ; Wed, 14 Sep 2022 15:57:44 +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 28EFvi3r010679; Wed, 14 Sep 2022 15:57:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28EFviPT010677; Wed, 14 Sep 2022 15:57:44 GMT (envelope-from git) Date: Wed, 14 Sep 2022 15:57:44 GMT Message-Id: <202209141557.28EFviPT010677@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: cbbf5227955d - main - i386: lower register's pressure on copyout_fast List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: cbbf5227955d871d74556d4e83656a003aa9e334 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663171065; 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=54r+8YkFfYtjPZWBp1YJ8rjV9+cQSFs0Ojmip0tDIOo=; b=Ay9KwxON72D+zG8wAZeQkfEg90yAScpsu879Ov8xLGzPd4ZaVUky7VkNlTdJday0o6SLaS VnpoLPvrSsXK5KcWurhCvvYxC+/Byu6PM42j5lR5mn3eobTMVICwAwlc3ATNKOzocPbuXT ZYy/N6ZyBZ5sWsOKaEKoDRdWYQBdYp53pR03kBaHgTmyRahO3Iu/kw4C0Y2c/plHZ12VbH S3dWDSOpR2RBZ7TP0c20Oop0aWu+6rNhSxy5QyAGJ0QLZNYKBmZ7iZ1paeCTGk7V1P2So5 wRaiA6neTPGsq0FpWBUkD98LZmiUuNY1yXes1eb3tBfxxXyeJP2fzfzZZXvoow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663171065; a=rsa-sha256; cv=none; b=uQRCg2gz7SnKnGuVXkHDJRaZC9LqEQdnsVihBWTqOPwHic3/Ov7eeFJIkvhXezYvZCkNvz vBDgBUH3hdFh/J/wNTmghATIfY1aCZSEot6Y+vgd7154oktfOilnBfCm0mJz2GW2bBPhSp YYTPgBWwc11H3RFfAeZ209RFPwwGMhjKTouDABOdHi+Egy0VGpfSdFnR1WSKrRt9LeHfKz mt9GdbYzcL5f/TT55KN7nvyMKXmbh6m0NQFjRXLDijlmd/AfqYguYRq6yfW5oGMvcdy1D2 gD/PMdgf5f9NURg+SPYMxzYLg6t6mRG0UOXt6tSbVGNBSY7E2s+HGjKHfvPG6Q== 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=cbbf5227955d871d74556d4e83656a003aa9e334 commit cbbf5227955d871d74556d4e83656a003aa9e334 Author: Konstantin Belousov AuthorDate: 2022-09-09 20:38:57 +0000 Commit: Konstantin Belousov CommitDate: 2022-09-14 15:46:32 +0000 i386: lower register's pressure on copyout_fast Do not require that %ebx contains idlePTD AKA %kcr3. This also simplifies KBI contract between copyout_fast and page handler. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/i386/i386/exception.s | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s index e83d95e6afe1..a2a6f5311a87 100644 --- a/sys/i386/i386/exception.s +++ b/sys/i386/i386/exception.s @@ -130,15 +130,15 @@ IDTVEC(prot) jmp irettraps IDTVEC(page) testl $PSL_VM, TF_EFLAGS-TF_ERR(%esp) - jnz 5f + jnz 6f testb $SEL_RPL_MASK, TF_CS-TF_ERR(%esp) - jnz 5f + jnz 6f cmpl $PMAP_TRM_MIN_ADDRESS, TF_EIP-TF_ERR(%esp) - jb 5f + jb 6f pushl %eax movl TF_EIP-TF_ERR+4(%esp), %eax addl $1f, %eax - call 6f + call 7f 1: cmpl $pf_x1, %eax je 2f cmpl $pf_x2, %eax @@ -156,19 +156,25 @@ IDTVEC(page) cmpl $pf_x8, %eax je 2f cmpl $pf_y1, %eax - je 3f + je 4f cmpl $pf_y2, %eax - je 3f - jmp 4f -2: movl %ebx, %cr3 -3: popl %eax + je 4f + jmp 5f +2: movl $tramp_idleptd, %eax + subl $3f, %eax + call 8f +3: movl (%eax), %eax + movl %eax, %cr3 +4: popl %eax movl %edx, TF_EIP-TF_ERR(%esp) addl $4, %esp iret -4: popl %eax -5: pushl $T_PAGEFLT +5: popl %eax +6: pushl $T_PAGEFLT jmp alltraps -6: subl (%esp), %eax +7: subl (%esp), %eax + retl +8: addl (%esp), %eax retl IDTVEC(rsvd_pti) IDTVEC(rsvd)