From nobody Fri Sep 02 14:48:22 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 4MK14V553Kz4Zmwv; Fri, 2 Sep 2022 14:48:26 +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 4MK14V4Q3Gz3R9v; Fri, 2 Sep 2022 14:48:26 +0000 (UTC) (envelope-from tijl@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662130106; 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=qHUqz9DWbEi2Gl8wmefPvzcv/5HIHwEilrfOXOVC4G8=; b=hzqoyRkwa4DouwdbrSk/2e1M150Xg2XGWhhhW0Q2f5vphxwCHp6y7OfhjE0AT/ML7yEpbf t/wIsWKiZA0CdP87pW9w/qNZ1ZUw2/Mj6jTYMDLZaPMpFVeCQMS4Amsx/oMXgKCHkdBC2j TNmrDV2IBSWOK1meYO+j5NazKpXM79jL45/ZcJotzk+04tXPOTZiGFME8MGQIAafikMZmv 8JhSX75/Dl6OZTYtfPcskpBg5sssqgCFPlig/xigpf4/zI401oxtfUNS8ft1KzyAyMVOto v2LnXZaw0DuIap7O/QC+SITC8qUzV/VGu/u1QORURc+1wPCjAZIYQRfKc1KeMQ== 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 4MK14T67pPzdxv; Fri, 2 Sep 2022 14:48:25 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Date: Fri, 2 Sep 2022 16:48:22 +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: <20220902164822.205e5089@FreeBSD.org> In-Reply-To: References: <202208241925.27OJPCm0069172@gitrepo.freebsd.org> <20220902150231.3ad4f16d@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=UTF-8 Content-Transfer-Encoding: quoted-printable ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662130106; 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=qHUqz9DWbEi2Gl8wmefPvzcv/5HIHwEilrfOXOVC4G8=; b=dyWrPYg0X6qPrJMcA+jDvim/9NVahuVpGUH+yOvRbJExINwosJcDBEIeelnnPcTr45rqta WYFJpxCAiJFw2C1KlNEz9jcxEZ3ypGiXQCNcGek7+lx3+GLH55H0TziaWqL5sVXhtFqT/M N9u4zqNrREYpL/uscsP8+l1BKF2NMcse2RCjmsrh6fG7oa9/LjQq+xylPforZTQzEWYv4N rkokyyP9+uFEPKoYRrcY4la764eM9ZYaMVoE1s2qTWoHD3sP1ixSHrrCtyMFThSVbyPa1h usnuqf6ut/gHawaNfhyf6585cOWjPztiRSE0RTRzInKkqsHhju4frNwfSAFRrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662130106; a=rsa-sha256; cv=none; b=uPjmc6VWUnqmpnbzFCVL/FvaaTUfwa+2tUTbVNkouFZn671axxY6LP3/0k9dQUCjYobMX4 DdfsvPpsDJ0Si7ZROsVw6/nYuNDy9IT0A547hs8aW9YKkF8YSp1eLLbQsAtmHEgGhhBG2I AIxgF95Zfm4ifq40rWta1+vKtgOqRH5qhLjOKlNZ1VHHNaf+aEB6V1j9cJ8bsJvI7Ch1eC CSuPYXCGwtr7cxqSOQ45FpoYaLwYwWTp/Eplouk1F2HuNeO2TM2Dlg5JkE8nqXJu4oIRWK 43LVy6tDcSuSR/XWH5MDSgo6B6Y+4xre/r8LLpiosXNGJxU4KKXfmwlygZLn+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On Fri, 2 Sep 2022 17:05:27 +0300 Konstantin Belousov wrote: > On Fri, Sep 02, 2022 at 03:02:31PM +0200, T=C4=B3l Coosemans wrote: >> On Wed, 24 Aug 2022 19:25:12 GMT Konstantin Belousov >> wrote: >>> The branch main has been updated by kib: >>>=20 >>> URL: https://cgit.FreeBSD.org/src/commit/?id=3De8b2980e4a126407e15d33ee= 8d987385c8321261 >>>=20 >>> commit e8b2980e4a126407e15d33ee8d987385c8321261 >>> Author: Konstantin Belousov >>> AuthorDate: 2022-08-18 04:07:29 +0000 >>> Commit: Konstantin Belousov >>> CommitDate: 2022-08-24 19:12:05 +0000 >>>=20 >>> i386 doreti: stop saving/restoring %ecx around calls into C >>> =20 >>> There is no reason to do this. Instead just calculate it later. >>> =20 >>> 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(-) >>>=20 >>> 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 =20 >>=20 >> Shouldn't this be "subl %ecx, %edx"? =20 >=20 > You are right, please fix. Fixed in cfdc649e455b.