From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C44F1EE03B for ; Tue, 7 Jan 2025 09:41:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736242912; cv=none; b=VUQL65KXp6hQEjExJmIkUj/x0baP4rwMKgK6hyP9hPQJYRVfMXyWyOYrC6DR8bI6MWK2q5q5wY5M27/MajZJuNmG1Rh6HLg9b3/Mjk9tyr1gP2QWEqIjHPdtE7wulTrd02nxpFJpUAzPcBgL6m8HThqevJDLqgq7NOY/RW21o/s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736242912; c=relaxed/simple; bh=KDgkb3qEqDXmlaWrsGe694tO6cPSccOzupKO6PHNBa4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=t52fGNP+3zaxQHVICgR76wn9jDrVZs8xgRjEt/K+X+XLG25y8wKXnahE7G3thTeNJ0TpRPNJrskGIKF2S5DuOYYTSo+qp/+XZo1odbW+umRXjwUwKGsLdeUkugr+qcton5najnb/+yeZFEE4BSDaTjgMRTWrUcKJtlyRWPKpV8g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Flu5kLwI; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Flu5kLwI" Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-aa66c1345caso528427566b.3 for ; Tue, 07 Jan 2025 01:41:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736242908; x=1736847708; darn=vger.kernel.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=0jhFjCJGceq+XYGHJk3Ezf5jn0OXzICEZi9KxOGra7k=; b=Flu5kLwIxvnegkTGvG/w89J5FagobkEnIEVuRufeY/XQjVYn1rm80Dbs2usDlrBxIK pYOKjDIDq8hxrsW9+VzqeZxvOENB8Y9ziSDS/6lwAxZ3pEGz/Kb6XZC5zZ84cNBA6RZC mhPLU9pM5qb653pLVJctz5vU9ACph3jSMINExa7/uN22Z3lWk4oSPbDnZc3aU6sggn39 e1fpgcMp/twbGeZhndnINPnY3W2r/mLEO85YIq3CS8lP2KFxMSASczSSbeYeR7LbcI9N OQkRRjM758jSCnQjM563YgoXZ8DCAl5GQEgrtI812sjncoV4sAaFeNmCOw7dv514jTHC eFsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736242908; x=1736847708; 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=0jhFjCJGceq+XYGHJk3Ezf5jn0OXzICEZi9KxOGra7k=; b=ZZvsdTsM6WnsHe0Ro0PT8eOfbDWIO6RRRc7ZjWNliRcJEnZ2lGFCvCZTTpPArNN2eA d3EACcgmhyV1Nk3bDR20gSvrqTBJj1Gu/rJFWzh8wV8B3BPqQwslJU0/8am3UipvhQFp USoTCxgT3f+HRexJWulp4jtOeY6jFE2xPdH9WT3cB2fKRg7E4GFbNNKXylzgLEtZPYPR +W6ycXYphSSR5PRIY0PDou8Nh/PIobE7L54F8IlQdwwjV4x1x9HOKecOLlfUWpKwWYcA HsQy2K4VI1bgVcgroXx7j1mU5nRzRrucwatv68ZD43339ybARm0TAggNaUaaU+Q0tYlI uL8g== X-Forwarded-Encrypted: i=1; AJvYcCXvz5Cufiqch27MOrdSxANGjCQ5jRb0PlR06UFseqg603+VeigMSfsaj4lH4fivKHIQ5NYGvDlBcfsLrwg=@vger.kernel.org X-Gm-Message-State: AOJu0YzEINaiXyvu6ZVgRhymZocen9HA9tlN22d8vGt0bC8/W3f0cUS7 LzCJDOuOjN+uEPVZjURXf59k3nAbbTfpSbCxez572mFpcWOukKMCPg+/xyi6SUY+wi9gdOmHUdS JKdE= X-Gm-Gg: ASbGnctvLn31L110NasojlVRu73EajdGBmOk+Gw6DS4B6sqo4LdiDARKdwvvryRaT9B NEb8qg0ORkWF0EfHdMaKTi9bXrsbHPFBE7Ib1ECNaHqWC3hAxj+Sv6WhAdSmrIgFsNzWSU+nqtJ 6VqqMuChY2f3inj0PJK46/W5q9W8Th209KF7/LoE/xnZZtXft12ZCEp6hcEhGyjL2ZlyrS+N+b+ PHZBWXGXI81NfF0xuw6ZJ8DvnhujKg8rlMsuH7icmfxqPqFsT5DD/XUbcg8ezNdcsM= X-Google-Smtp-Source: AGHT+IHEH6FJmLL0RIoAIXjSeV1vLr7n0yRDVVeIb2gZ9Zszi7jKVQgNpS1AgWJqppfe+0vNlaJ+NA== X-Received: by 2002:a17:907:a708:b0:aae:8495:e064 with SMTP id a640c23a62f3a-aae8495e124mr5041199166b.40.1736242907918; Tue, 07 Jan 2025 01:41:47 -0800 (PST) Received: from [192.168.1.140] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0f012229sm2356901166b.133.2025.01.07.01.41.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2025 01:41:47 -0800 (PST) From: Linus Walleij Date: Tue, 07 Jan 2025 10:41:32 +0100 Subject: [PATCH RFC v3 16/30] ARM: entry: Drop argument to asm_irqentry macros Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20250107-arm-generic-entry-v3-16-4e5f3c15db2d@linaro.org> References: <20250107-arm-generic-entry-v3-0-4e5f3c15db2d@linaro.org> In-Reply-To: <20250107-arm-generic-entry-v3-0-4e5f3c15db2d@linaro.org> To: Dmitry Vyukov , Oleg Nesterov , Russell King , Kees Cook , Andy Lutomirski , Will Drewry , Frederic Weisbecker , "Paul E. McKenney" , Jinjie Ruan , Arnd Bergmann , Ard Biesheuvel , Al Viro Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Linus Walleij X-Mailer: b4 0.14.2 asm_irqentry_enter_from_user_mode and asm_irqentry_exit_to_user_mode have a "save" argument that will save and restore registers before the call to the C function. Now all invocations set this argument to 0 so drop the surplus code. Signed-off-by: Linus Walleij --- arch/arm/kernel/entry-armv.S | 8 ++++---- arch/arm/kernel/entry-common.S | 2 +- arch/arm/kernel/entry-header.S | 18 ++---------------- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index 6edf362ab1e1035dafebf6fb7c55db71462c1eae..460aa92c3c1f50de905550acf363c58f509bfe0a 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -422,7 +422,7 @@ ENDPROC(__fiq_abt) .align 5 __dabt_usr: usr_entry uaccess=0 - asm_irqentry_enter_from_user_mode save = 0 + asm_irqentry_enter_from_user_mode kuser_cmpxchg_check mov r2, sp dabt_helper @@ -433,7 +433,7 @@ ENDPROC(__dabt_usr) .align 5 __irq_usr: usr_entry - asm_irqentry_enter_from_user_mode save = 0 + asm_irqentry_enter_from_user_mode kuser_cmpxchg_check irq_handler from_user=1 get_thread_info tsk @@ -447,7 +447,7 @@ ENDPROC(__irq_usr) .align 5 __und_usr: usr_entry uaccess=0 - asm_irqentry_enter_from_user_mode save = 0 + asm_irqentry_enter_from_user_mode @ IRQs must be enabled before attempting to read the instruction from @ user space since that could cause a page/translation fault if the @@ -472,7 +472,7 @@ ENDPROC(__und_usr) .align 5 __pabt_usr: usr_entry - asm_irqentry_enter_from_user_mode save = 0 + asm_irqentry_enter_from_user_mode mov r2, sp @ regs pabt_helper UNWIND(.fnend ) diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 14b2495cae3c2f95b0dfecd849b4e16ec143dbe9..df564388905ee019cd5553f8b37e678da59e3222 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -109,7 +109,7 @@ ENTRY(ret_to_user_from_irq) movs r1, r1, lsl #16 bne slow_work_pending no_work_pending: - asm_irqentry_exit_to_user_mode save = 0 + asm_irqentry_exit_to_user_mode #ifdef CONFIG_GCC_PLUGIN_STACKLEAK bl stackleak_erase_on_task_stack diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S index fb5bb019199b2871e29e306a29bea8fdf47dd7f3..50c0b55adc7421e7be123c9d00f94b1ebb93ff9e 100644 --- a/arch/arm/kernel/entry-header.S +++ b/arch/arm/kernel/entry-header.S @@ -365,28 +365,14 @@ ALT_UP_B(.L1_\@) * Context tracking and other mode transitions. Used to instrument transitions * between user and kernel mode. */ - .macro asm_irqentry_enter_from_user_mode, save = 1 - .if \save - stmdb sp!, {r0-r3, ip, lr} + .macro asm_irqentry_enter_from_user_mode mov r0, sp @ regs bl irqentry_enter_from_user_mode - ldmia sp!, {r0-r3, ip, lr} - .else - mov r0, sp @ regs - bl irqentry_enter_from_user_mode - .endif .endm - .macro asm_irqentry_exit_to_user_mode, save = 1 - .if \save - stmdb sp!, {r0-r3, ip, lr} + .macro asm_irqentry_exit_to_user_mode mov r0, sp @ regs bl irqentry_exit_to_user_mode - ldmia sp!, {r0-r3, ip, lr} - .else - mov r0, sp @ regs - bl irqentry_exit_to_user_mode - .endif .endm /* -- 2.47.1