From nobody Wed Aug 24 19:25:12 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 4MCbf12Rvpz4ZfdH; Wed, 24 Aug 2022 19:25:13 +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 4MCbf071nnz3Pkx; Wed, 24 Aug 2022 19:25:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661369113; 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=JvY6sNbxsq/Q7QcQjAqgcZUhEpPOio+BiOIgMh6M6rY=; b=VFMUnxcI7t7xV0MLMAQEyKWyzreLq09rJlKGPyt3J1MI/84JwLwVJDoLZi9bZcnGPVMvI4 Ay7k7ZwxF2hRAaYOUh/Ow8k74U+wUDPg16DlYOnfKMz6V/kIkF1IOuYuOnuphazfcltSoa QgXbjNokY4bGKycP98/4tf5r0fwTCzxHhJfH7Cr23MtfLgBjeWbM8hKR4JOJ+7zjun+CEc /7/8iqbrkOCYKDih44yKTsYNbzxsyK/mX/zu1v+IRt44Lqo3R76kQ7XN33zKjUIZo5fJVM ygSDu8atkupXNBXGvELtZZ3bwSyRsxL4amN3OJxtqE6SvpPyPfx+YYRj+vblZQ== 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 4MCbf067kpzKpf; Wed, 24 Aug 2022 19:25:12 +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 27OJPCSr069173; Wed, 24 Aug 2022 19:25:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27OJPCm0069172; Wed, 24 Aug 2022 19:25:12 GMT (envelope-from git) Date: Wed, 24 Aug 2022 19:25:12 GMT Message-Id: <202208241925.27OJPCm0069172@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: e8b2980e4a12 - main - i386 doreti: stop saving/restoring %ecx around calls into C 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: e8b2980e4a126407e15d33ee8d987385c8321261 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661369113; 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=JvY6sNbxsq/Q7QcQjAqgcZUhEpPOio+BiOIgMh6M6rY=; b=uC4+XZ10DE9EzEYSL5pwjBYSGb7m2iEfdyl7FRk/ByZY2RoBiIQWGJYqRWAa3p5OX72xJr 50W4uzgxw8zlgwtY7vdgsPov8CXlRygFMu/21nbHL98a/EgK8GJdQIE7jRQm2+VSyeNMHD RzBqfFXXzEeljmIMZc85kvdFyixQufU9vwoCI4svsUjteWbfcntingR8x42US6OKGfhvon oIrP6S+5hJHilqIQ3JJ10J/yUib8VZtkj/ZH9zq47MxCU4Vha6A8wZ4TvFPGVWjlzUAanl /2PnCx6RdUqawEXsg5wEHK8IjDPIPWNhpkmZaD4gRuGNuDuqNjQ4OqKi3pO5oA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661369113; a=rsa-sha256; cv=none; b=WMHduzy+ulTP19J6yDKBMal0kToK3L0awtcKN7lnxaBcSNBZqQim9SN9JQNYUI3p2wml+x 5lM2ghBpnJdocP7BfWRDs8EtePTDJ+eQPQXBEVqEFpE6tFNZWfyEbBU43hcHt04dFcPzDu 6Xq4RAEqgJXaM33rDcJmKYiqMpPGFqsW4rbCjPjusyy8dWTsZVS/R86CHwsii+2SzDmVqX EC+1GUgythN8fWblD7myxNW2WbG5bKhB1PUa8nqws10OsD7+wH5pzsyZjvxt8uj/ON0cCJ LC9dcGETpdXoKv5dGtPNO7l3zIWTcdVkT/Qxk9UWKbH393Qsc0hLtV6juywR5g== 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=e8b2980e4a126407e15d33ee8d987385c8321261 commit e8b2980e4a126407e15d33ee8d987385c8321261 Author: Konstantin Belousov AuthorDate: 2022-08-18 04:07:29 +0000 Commit: Konstantin Belousov CommitDate: 2022-08-24 19:12:05 +0000 i386 doreti: stop saving/restoring %ecx around calls into C There is no reason to do this. Instead just calculate it later. 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 | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s index 5eef9c1d512c..8279a4602ebf 100644 --- a/sys/i386/i386/exception.s +++ b/sys/i386/i386/exception.s @@ -518,22 +518,21 @@ doreti_exit: je doreti_iret_nmi cmpl $T_TRCTRAP, TF_TRAPNO(%esp) je doreti_iret_nmi - movl $TF_SZ, %ecx testl $PSL_VM,TF_EFLAGS(%esp) - jz 1f /* PCB_VM86CALL is not set */ - addl $VM86_STACK_SPACE, %ecx - jmp 2f -1: testl $SEL_RPL_MASK, TF_CS(%esp) + jnz 1f /* PCB_VM86CALL is not set */ + testl $SEL_RPL_MASK, TF_CS(%esp) jz doreti_popl_fs -2: movl $handle_ibrs_exit,%eax - pushl %ecx /* preserve enough call-used regs */ +1: movl $handle_ibrs_exit,%eax call *%eax movl mds_handler,%eax call *%eax - popl %ecx movl %esp, %esi movl PCPU(TRAMPSTK), %edx - subl %ecx, %edx + movl $TF_SZ, %ecx + testl $PSL_VM,TF_EFLAGS(%esp) + jz 2f /* PCB_VM86CALL is not set */ + addl $VM86_STACK_SPACE, %ecx +2: subl $TF_SZ, %edx movl %edx, %edi rep; movsb movl %edx, %esp