From nobody Fri Sep 02 13:02:31 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 4MJykM0VYDz4c1Q3; Fri, 2 Sep 2022 13:02:35 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MJykM04kpz47Kr; Fri, 2 Sep 2022 13:02:35 +0000 (UTC) (envelope-from tijl@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662123755; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=06JlsxR0ot88gYP7jWVfux0AHCJoeLeUoU32iZA9qdo=; b=Zsrk+Sro120v0kz3f1WX7hFJpviqW62Fw3wUsh2Ong/qJnCh79eRYytrE7bER91SSJTPc2 ti22pAa0qmRB6lNS/nqJadBmbeXD3qbQDt1lhAEnAv5Zmm2c82IEymzrzsfoZMnrHUuFdj fWcWAH6utXbPZCOy9HWBJ8Jkeqt7Rmr0/EqJpebEXJnIgV9u9ahd3u3vi9UazXAPds9xnU oxptBUNWBvQ0fPfJd895NxHP4/pj1OjReCQsTeF6MHMqg5Py/mRlom+GJRiFPRbnUgmATj 6EwTZ6MtfO7jBM/a/5Ug9R3PaIgQlBH1hG4odCxB4jgab2sRkcHe3+3t78geJQ== Received: from localhost (unknown [IPv6:2a02:a03f:894b:4700:606c:ab78:58f5:a71a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: tijl) by smtp.freebsd.org (Postfix) with ESMTPSA id 4MJykL2CZvzdm9; Fri, 2 Sep 2022 13:02:34 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Date: Fri, 2 Sep 2022 15:02:31 +0200 From: =?UTF-8?B?VMSzbA==?= Coosemans To: Konstantin Belousov Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: e8b2980e4a12 - main - i386 doreti: stop saving/restoring %ecx around calls into C Message-ID: <20220902150231.3ad4f16d@FreeBSD.org> In-Reply-To: <202208241925.27OJPCm0069172@gitrepo.freebsd.org> References: <202208241925.27OJPCm0069172@gitrepo.freebsd.org> 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=US-ASCII Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662123755; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=06JlsxR0ot88gYP7jWVfux0AHCJoeLeUoU32iZA9qdo=; b=hgDcELTHDwWpJ2PFVmCUdV//iZV1nIdvMUE7jeFQEQKzMQG4BMT65tYZt3tEcnbYxsZs7v hfZTRhkU++BiNBUetwaAVdZePZDHHiBHzeebdT3/mKPeOmG+KV9AiZRxjaKa26abhBNWB/ uZL//HEIEmmRbaWp3jorDXTPf0xzfvhQf3Q6ybvPIJw7eu5b7iOqNdsED9KjDv1n1a1ewF cEDtBNjpfXSj0Bmza9A7M/0mb+TSgd/J9//b7mhUIkwwKdI1a4GbnJW5Cs4oKyc86Z17p4 PltTxSnoFYpMdWg7BdOBDg2AXMu0WvpbUxAbymv5YfO9EZyYYLGsqPusrbUqWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662123755; a=rsa-sha256; cv=none; b=XKu30FB+CyMMgwk7q/yA5Yr1QxDY8FMoDCppw3VTWxNmRHX3Gk50ndUKf4gKomATKvGBxv bBLZ/aVLqeHFk3DessvYQ3cuQSOb9u/bjnfam5m8pb4/jcLREPGglkmDB5Ft+MMca02BzS +ml+Q9X4luKBKgTGnOzHGgbNooLOsWiaDwqMSVNEXzhgtn3s3QsPRjqoXLKg9MZzxwd9/H 6erbIq7iUdRWvzu+bUBu8R57r4EBM+qxnAANxpyGn+R9gn6vV27VcNOU1OX6Cg1m8eMEYS LqIISsumbLc/aSQy6kFzm1hlI+mYM6VU9ClvcJRwTOVjv6L+HwtCx8SOoPZ74A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Wed, 24 Aug 2022 19:25:12 GMT Konstantin Belousov wrote: > 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 Shouldn't this be "subl %ecx, %edx"?