From nobody Wed Aug 31 01:32:12 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 4MHRVh2Stfz4bqCJ; Wed, 31 Aug 2022 01:32:12 +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 4MHRVh1sQcz3CSR; Wed, 31 Aug 2022 01:32:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661909532; 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=+22ZmvuQxN0fZZY2iSkitRI4FZaqtttgmXKvoCtYpbA=; b=b27gKgalBvXXOaqxxJChe21M+ntVtwFAvsFFOQAKJjJIq/xEU7jOp0QDd06J1vpgbPvJB2 3o6Aogu4qSc7kf4Xx6WaWMBzglEKbkd0OqBWYvIdbjuosRBk0/5mnz1Z3dyPX++tV3dGML opG/TN5k1mgNGrYgBKKZruTUJccIcFZWWgjPXQ2aQwXLbNVRkoO2D08BntzEfor7pwPXUX 2P8rkn65kJjLyhgIy5jaYH6yp07SJJhrfVtQ7gneC2SvgrzMXwOtX2LamnuTA5CRTw2NuO gl716ZeSnPdvhum7DLJO22nJr63jlM0ojgN53eUDGD/ifmLqF041SLc6p0489w== 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 4MHRVh0ywMzy47; Wed, 31 Aug 2022 01:32: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 27V1WCFw033133; Wed, 31 Aug 2022 01:32:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27V1WCjx033132; Wed, 31 Aug 2022 01:32:12 GMT (envelope-from git) Date: Wed, 31 Aug 2022 01:32:12 GMT Message-Id: <202208310132.27V1WCjx033132@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 3416c2f3c5cf - stable/13 - irettraps: i386 does not push %ss/%esp when exception does not switch rings 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 3416c2f3c5cff141c60effbd272757feb21fc81b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661909532; 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=+22ZmvuQxN0fZZY2iSkitRI4FZaqtttgmXKvoCtYpbA=; b=AMBekQJXmRp3w7wJRKpgq0QaDLX4b77JD/bak0IjA1l/++XSqP46h1o9yKamCadlABA1SZ crEApq4YtImVpEBb0WbhoAaeH4udTaji4VKpLmsY9DCIwGqVS0w7la4F1aJ/m4Dz9FSl6/ Aq6m2kmgaPmwg7dnOaPcNwqhcY9FsZoyJ//6VtlsG/B8sihgcG44YkyttgBTQSnkk8aUXx 34ufjUBkNsh1sXXoFUI5uEzQfhIs3qfDMA7WxzPu/ouFujGGJU2UppiArRFkz58XZUEobT f6r6w5j67HSd85NFevmYeY745Ao/5ipCdmUtpooWonC/kQpEPG7GilKrJAHTag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661909532; a=rsa-sha256; cv=none; b=b4I2/SznBElq4prRkntbGG2LUU0/ktxHOnkzQ3Fa3H7RYYaVwfV8+qGwQteSQwjHs17iGr L6yqNCTDNWLBrw5RXccSBRGkx4BZHbKVeAhwVR5FpcvD9iMUgRLSd2eFGgILDjLEpBL9nv BomgpwmcFisM4YzruFdgOg2uLVIor2rNl8ci8ZQ80fipq8pjPGH9+uoGKM1fhlbvbYx9pi eFBY5WWokPfpmfA3rMaZspK+c97jhP68HWbQAUXs3HD7njU50SZ9w9nB8Kc59yyewWO3hU wcAB1C6rcKXY5kyG5mffLttCkEJjj/voTB5gv0tSOwg4b7EgfBROPx3AT9F+zA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=3416c2f3c5cff141c60effbd272757feb21fc81b commit 3416c2f3c5cff141c60effbd272757feb21fc81b Author: Konstantin Belousov AuthorDate: 2022-08-22 01:20:28 +0000 Commit: Konstantin Belousov CommitDate: 2022-08-31 01:20:27 +0000 irettraps: i386 does not push %ss/%esp when exception does not switch rings (cherry picked from commit a03e4799e76bdfe432f560d96448895ba6ee6133) --- sys/i386/i386/exception.s | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s index ac687aa502fb..7dad1cc5978b 100644 --- a/sys/i386/i386/exception.s +++ b/sys/i386/i386/exception.s @@ -234,22 +234,23 @@ irettraps: leal (doreti_iret - 1b)(%ebx), %edx cmpl %edx, TF_EIP(%esp) jne 2f - movl $(2 * TF_SZ - TF_EIP), %ecx + /* -8 because exception did not switch ring */ + movl $(2 * TF_SZ - TF_EIP - 8), %ecx jmp 6f 2: leal (doreti_popl_ds - 1b)(%ebx), %edx cmpl %edx, TF_EIP(%esp) jne 3f - movl $(2 * TF_SZ - TF_DS), %ecx + movl $(2 * TF_SZ - TF_DS - 8), %ecx jmp 6f 3: leal (doreti_popl_es - 1b)(%ebx), %edx cmpl %edx, TF_EIP(%esp) jne 4f - movl $(2 * TF_SZ - TF_ES), %ecx + movl $(2 * TF_SZ - TF_ES - 8), %ecx jmp 6f 4: leal (doreti_popl_fs - 1b)(%ebx), %edx cmpl %edx, TF_EIP(%esp) jne 5f - movl $(2 * TF_SZ - TF_FS), %ecx + movl $(2 * TF_SZ - TF_FS - 8), %ecx jmp 6f /* kernel mode, normal */ 5: FAKE_MCOUNT(TF_EIP(%esp))