From nobody Wed Aug 24 19:25:13 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 4MCbf21gbDz4ZffZ; Wed, 24 Aug 2022 19:25:14 +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 4MCbf210H2z3Pqb; Wed, 24 Aug 2022 19:25:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661369114; 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=I0KFgbecF2Ch2HVOpH9CH6b8eyUY/5hvGqar8FAoPGw=; b=my5sd9wPbZt9/aHBklPJVyJf4eKgJQyh+5+5NfPcP/plcHLYRKuNF/zKrlJ+0HL0zyssba Mg4l7DUPDht4/hHrXvy1MmXKR2ZChlqXH87seemx+KKjMGsezKSh0lge6g1q36V+MANxob ZnYQieqqCS3j+VWYuLtJCXU+CWitONVH4vkJoLcsaMk5GdnamfhZjKCxItsyMQ2/HjXuCT WYf0d81GxWePK3J/zTE5fnULY44agir95QNOv+jFpF79dBBk3yQ2qLIaxLq/a2u1pzfbGh 4neeVPuvj3E6p3kOpz3iKNWrrPq1RcL4Dh/UvCNU4NjOzoRiIOAiGqnO1MIThg== 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 4MCbf203SHzLFH; Wed, 24 Aug 2022 19:25:14 +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 27OJPDZI069197; Wed, 24 Aug 2022 19:25:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27OJPDBG069196; Wed, 24 Aug 2022 19:25:13 GMT (envelope-from git) Date: Wed, 24 Aug 2022 19:25:13 GMT Message-Id: <202208241925.27OJPDBG069196@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: 54e1546e0934 - main - i386: simplify flow control in irettraps 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: 54e1546e09340682c871ad1387e42a765e117ad3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661369114; 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=I0KFgbecF2Ch2HVOpH9CH6b8eyUY/5hvGqar8FAoPGw=; b=THcPIs39B0WeEy/WXd5OKq9ShTVgoWAj/+BZQJMUiFoUAfmDVre+/JVI5ucB6kgPK5R6IY TG9an16E23kGqKKLQ8ppL8E+kMZNJgkuCK6ny1cmFTnAHksgLNHOfMrvta48oV6bR6izrs Go93TifaYUDym8/9XbXRDTkQsgSUxlATvZbn7cPpVsLTE26D/pDmjE8i+Zqd69lx56at+q iYuGPD8tHyvkD1fA/yG8F34XrS8/EsdoZRsl8YAwhrQqYSgE3EdRWxzSd5aEdPlQFLzohV 2guy5vy8exezQPWLlzY/P215Gp5NdK3r0FPR911W4nlqerRNn4DsDhLUw6OrDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661369114; a=rsa-sha256; cv=none; b=dLzbrpZ1hfJgwMIcgmxI4ufO/JUoVa0QxViS4rzHpUlQLJ+PxzWMFjlZJMQFOMWwGitjbo gVf2XjbgVd52bb1bWEct7ArhlOn+TA3iGp7YaEQo1fjWLz0lTXpAbk6nvWCUDLq2ksrNKu 3V2rp76UuUtu9KiME/SNwWG7UlxUD5KkFe7Ge123RwECNaYgGx8flhNRTAYFfnI6P0pRZ5 4aLutYVAer1MQRTI9l9WB5JnujcSk4qGii5MfTuhGm03eyvh9FrIVtxlcvNCBYT0626KFD B/UfCWCrRjqidD0YJvnzxnuUStR2mwJOyciW4/W9pr3XRNCPdcpDY/J565emuw== 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=54e1546e09340682c871ad1387e42a765e117ad3 commit 54e1546e09340682c871ad1387e42a765e117ad3 Author: Konstantin Belousov AuthorDate: 2022-08-22 05:56:45 +0000 Commit: Konstantin Belousov CommitDate: 2022-08-24 19:12:22 +0000 i386: simplify flow control in irettraps It is enough to have only one 'call calltrap' locally. Reviewed by: jhb Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D36302 --- sys/i386/i386/exception.s | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s index 8279a4602ebf..2373fa425210 100644 --- a/sys/i386/i386/exception.s +++ b/sys/i386/i386/exception.s @@ -231,26 +231,23 @@ irettraps: jne 2f /* -8 because exception did not switch ring */ movl $(2 * TF_SZ - TF_EIP - 8), %ecx - jmp 6f + jmp 5f 2: leal (doreti_popl_ds - 1b)(%ebx), %edx cmpl %edx, TF_EIP(%esp) jne 3f movl $(2 * TF_SZ - TF_DS - 8), %ecx - jmp 6f + jmp 5f 3: leal (doreti_popl_es - 1b)(%ebx), %edx cmpl %edx, TF_EIP(%esp) jne 4f movl $(2 * TF_SZ - TF_ES - 8), %ecx - jmp 6f + jmp 5f 4: leal (doreti_popl_fs - 1b)(%ebx), %edx cmpl %edx, TF_EIP(%esp) - jne 5f + jne calltrap movl $(2 * TF_SZ - TF_FS - 8), %ecx - jmp 6f - /* kernel mode, normal */ -5: jmp calltrap -6: cmpl $PMAP_TRM_MIN_ADDRESS, %esp /* trampoline stack ? */ - jb 5b /* if not, no need to change stacks */ +5: cmpl $PMAP_TRM_MIN_ADDRESS, %esp /* trampoline stack ? */ + jb calltrap /* if not, no need to change stacks */ movl (tramp_idleptd - 1b)(%ebx), %eax movl %eax, %cr3 movl PCPU(KESP0), %edx @@ -259,6 +256,7 @@ irettraps: movl %esp, %esi rep; movsb movl %edx, %esp + /* kernel mode, normal */ jmp calltrap /*