Message ID | 20241010-arm-generic-entry-v1-21-b94f451d087b@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 700DDCF11E9 for <linux-arm-kernel@archiver.kernel.org>; Thu, 10 Oct 2024 13:16:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=P2OP9NgXP8OYjhdkePmH5sP15xkO/BVCD1VA0/cLgTg=; b=lxHUmBCRIpgvWscSDTLGxNANtL bDdecOHgdbq/9/afoe/4qIxw0ncHEGFNhf+KuiqMYM8erCd/npupxdljOTKvbvAsRipC3NWfNJKuZ 5UMScf83HV1r4kZ4gePPSvCQLlqSKIA30aYD+lG+MeMuQcNReSdgL47wTe8dmkEB557uFLwNRAJyz NfnW3aAb2yO+7wSouGh7BxpT6FtjKkhZPFXGvm7L3hf7g1lZ5WQ27ECTqhDRPQqQGL7+Wn78mfS7i RyDvZ7Yu9xRIQUdmeUBpGy+PwjRzpgDx0IY1WrR/aE2GIGZmn0g3oCGO2lrZf6oXkL+b1JSzeGjsP YhDEfyEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syt1X-0000000Csj1-0ds7; Thu, 10 Oct 2024 13:16:11 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syrQy-0000000CYNG-15Jt for linux-arm-kernel@lists.infradead.org; Thu, 10 Oct 2024 11:34:23 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a9968114422so118918266b.2 for <linux-arm-kernel@lists.infradead.org>; Thu, 10 Oct 2024 04:34:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728560058; x=1729164858; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=P2OP9NgXP8OYjhdkePmH5sP15xkO/BVCD1VA0/cLgTg=; b=WuG4+7kwrrhdSKXUlhSyKUXJxAi/hDxt6efwYOZpTfompvxtyBLvfDdfQxfjXFT/8h 8uMrdEEzYmAjQKWMeB5dYfxvYqrQmv6iBf4aVNurdHN7xlyjhOPyFgEnojNiF3WP0Z0k guqDlQ10x9wrqfUf7UwrI+I5ZVV9ApKrEPGM6u4ayQVE0ar+gISUftJqBFHzIgOecZXl +D5Fgt5mUyPhg2VusWpRnpsnz/XA/a8OuT9Df0Z8CqerxSlQx5crz2EP4+lBpdOAHwQB J4HcnpMRDwKLP/rTpHZypljjoPp22zsi2nKg1m/goO+Rm6Xpm0k66hfNeVzr/wbttLjU Lghw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728560058; x=1729164858; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P2OP9NgXP8OYjhdkePmH5sP15xkO/BVCD1VA0/cLgTg=; b=Apto7/8SrHBzJCUn56akDbcTvWOX3qkwzjstMWbUq1dFU4o+zRC3+Y3zpsW1C+a75S MkJIa4hWALGaTS/F/v+dFpXL7Emdn6TzFKwOeRnUIEkrBWlX2en+eWQ9e86KD4K6T94d Q66ebVZxlgvs0jJ6IrAvh3ohyGX9RHAYpGjvf7MaXl0f2W0M2gkeehsuP5r3tbFAE9TI mXyFHHOTRWqQdL9afo24LDmLvPKjs8SA7IV5jy9Pp5hzfJdDEf1jz4xxKvlcQosVnP/V JNqJ+dwlS/jNaEHy4OuPWQs22E7mgzWHnOyyi/zC4Rnec1gPbyb9n29rqqusBS7UwAnB IDzA== X-Gm-Message-State: AOJu0YyOHb62CG2oOWQ6HRzN1GR6AZohEsC9Uxq6Dq38W6WrhPGDn/YG T66/9Y+6/oInM6Z0rzPydIhX4ZlaNjCtVRKZ0N/gPWcWJqKrEpwqsrVN/4FgoPM= X-Google-Smtp-Source: AGHT+IHjkGGKiDc97wWL2KlgD9Onfb1ojmEjNcRbkL8DUMdOhIwDFVL57b9sjrWd7TF2zYrCFdqZEA== X-Received: by 2002:a17:907:7ba9:b0:a99:442e:34ac with SMTP id a640c23a62f3a-a999e8c9f03mr327117266b.40.1728560058140; Thu, 10 Oct 2024 04:34:18 -0700 (PDT) Received: from lino.lan ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99a7f25406sm77619066b.69.2024.10.10.04.34.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 04:34:16 -0700 (PDT) From: Linus Walleij <linus.walleij@linaro.org> Date: Thu, 10 Oct 2024 13:33:59 +0200 Subject: [PATCH RFC 21/28] ARM: entry: Do not double-call exit functions MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20241010-arm-generic-entry-v1-21-b94f451d087b@linaro.org> References: <20241010-arm-generic-entry-v1-0-b94f451d087b@linaro.org> In-Reply-To: <20241010-arm-generic-entry-v1-0-b94f451d087b@linaro.org> To: Oleg Nesterov <oleg@redhat.com>, Russell King <linux@armlinux.org.uk>, Kees Cook <kees@kernel.org>, Andy Lutomirski <luto@amacapital.net>, Will Drewry <wad@chromium.org>, Frederic Weisbecker <frederic@kernel.org>, "Paul E. McKenney" <paulmck@kernel.org>, Jinjie Ruan <ruanjinjie@huawei.com>, Arnd Bergmann <arnd@arndb.de>, Ard Biesheuvel <ardb@kernel.org>, Al Viro <viro@zeniv.linux.org.uk> Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Linus Walleij <linus.walleij@linaro.org> X-Mailer: b4 0.14.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241010_043420_340494_6B4C7659 X-CRM114-Status: GOOD ( 17.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
ARM: Switch to generic entry
|
expand
|
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index ece921571714..33bc9e7c5b32 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -49,7 +49,7 @@ ret_fast_syscall: tst r1, #_TIF_SYSCALL_WORK beq 1f - b ret_to_user + b 2f 1: mov r0, sp @ 'regs' bl do_work_pending
This is a semantic change to ret_fast_syscall: if there is no work pending the function used to jump to ret_to_user, instead we proceed to return from the syscall. If we jump to ret_to_user, IRQs are enabled and we call syscall_exit_to_user_mode a second time; at this point a this just means a second call to rseq_syscall(), but it seems wrong and we want syscall_exit_to_user_mode to be called exactly once. Apparently the ARM kernel has under some circumstances called rseq_syscall() twice on the exit to userspace without side effects. ret_to_user also checks for pending work a second time under ret_to_user_from_irq, but this isn't even needed any more on the fast return path: this was needed because the syscall invocation enabled interrupts when doing syscall tracing, and all tracing invocation has been moved over to C in earlier patches. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> --- arch/arm/kernel/entry-common.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)