From nobody Thu Sep 24 13:37:32 2026 Received: from mail-ed2-f35.google.com (mail-ed2-f35.google.com [74.125.228.99]) (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 D609945516F for ; Wed, 23 Sep 2026 07:49:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.228.99 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790149774; cv=none; b=ZzWCAHfwFTqv3jFTKW0tiJGB74WFgmG0dRdAJi7mLINSkN7LGSqPHK0uhxBWYrrVFD1IVyzwNexwXNVPvvwGkyvktLWlXMg4mkviTzKHJvQb0XB5//ML1uFBKjqXUYw6CWlyeypniseYLGmXMd0m9MS+/exrvgCQpKt8vqO0QA8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790149774; c=relaxed/simple; bh=oARr0eCnkCHD+mROeY0dJ5/jgnSvSWjzHoHE0F6KYCs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZyCI+pnEFo8VXTLRJS1RRtEeXjlqP9QO/KG2YmKtlqLMLB+eSXencyXgDSxTw5OnfrmimCfgcQx/5twU+9n5ohgFA4xG7XJAGbu5PKOapMOhrXFMzm/1Eu/Bt5pgAZuD5H3mua422QGdnoc/v1IY2fwQibOmGSTQYhvJ5zwVPvY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=REMqsnLK; arc=none smtp.client-ip=74.125.228.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="REMqsnLK" Received: by mail-ed2-f35.google.com with SMTP id 4fb4d7f45d1cf-6aa1da63791so896816a12.1 for ; Wed, 23 Sep 2026 00:49:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790149769; x=1790754569; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=wYqHLogoefTeHvs40y0M445o7+VTYO/XqvtDAqNdSwQ=; b=REMqsnLKSwRpliWPUH3/WXH8AW8mwfMNSDNWYwa+uj8WJN3Ph1kFqgJz8kPYBuzDlB zSajIIMRXhXx07wFlUZ+QbRm3HiS7Mb1kKfBePPFVMzEl0UuYsFVGhNKDLZpGYrd11G0 dXW6+Z0wTNCyaroVxs4sx7wNSUpcMXT53jtpPK53jI5oLvwa5+kf7FCpePL9uGorRYF6 Vga6B7xqvmBjDO+aUlgJ9OxgohaW2ylmgi4OwBnh1/HP9B0+7mphhxFmi3zqaw5IdVLE zco6QyASidNMbRJTjWcdc8tvwRcT0rAyXFRJgkDImFDCdGELtLVPGUTN0UzPeM13YMT8 3vSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790149769; x=1790754569; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=wYqHLogoefTeHvs40y0M445o7+VTYO/XqvtDAqNdSwQ=; b=luPAwyo5RAzQ4ZfW7FjGBUWpo7gR9cR4WnJu3/XbJLDOd7F/jKe08SBnb0VtPOb2l9 kiTAqsy9SOvs+6PDlxnrBzzsUkj1yjmLMnWGBnYGQ2DuMRQSUvYFCrCfzEFkbw+VjGLs pjzl+HHJEqCqlNlmZe6tpqejbi6c2X7jkeiM0UJrXRAUPiElERKJhl0ZnjLf0OQAvVL2 rYwegFG2ha0VT8srZutqnkZmmOU36PNlZfRKSBr28SCadK2mSu1MBtasQP0a5gCP3eVa 1OA/tW7jUn2MW4w8cJCq60vnDU3a792zeZisi4gIJXG/jd/GwCdGHh17LbC+uvsxWkWp chdg== X-Forwarded-Encrypted: i=1; AKwUvBw4T6yZn+gYVzg9nFaTpomHUYEyngtYKlYII/FcxuS5VpjJFRilYJw1/FNFVJ2dpuWP4CG0vci8GwovIT0=@vger.kernel.org X-Gm-Message-State: AFuF++kdXFkTTbVTQIZuDGoeM1aNogyfbqo8Q5xvwPjGiriEmy8xPf2E Etrw0sLX/F82vd4F7VTDdr00/+uYE4qCFmLgUnW9Z8fLaaWbwc9K1gVQ X-Gm-Gg: AYBFou3LYAbP9wk4iQR89YrFGqraAIIAuoM5LTdnY5b4CJqtuPbotyB1R+jErIgq68g zlHRjuAPWYjibiqVLUTQdtmNrekxu0yfVXkg7zeiHBuMkZnFH5fKCCWD7Fv5Byr//Aw2fvp9XKk 9f626TidQh06V4vM0rS3XXko/nckA+OpJzoNjrYzu1mvJoHGr5jOB7phXnsI1qaoDOgGVnwVteh LjJOk34mdl0vPMVy1MNT4gCCdMhKF4hcFfL/DSlpe7dhVr79b0pt6ukR4xQGxAuY7ZNMM+R634i 3XSagWZPG0bvoK0xQ20HNzMS+2fy1WC7T479HpHPraY8GbmGR3dd5VwxRj2AFkniVjkuS8ICpoL DO7vMdl6JNjf8og27A/VEeLodq7s9plJjK5up4TJIMXefSSa1WKcx/KqX0CL21hJBz9aELzl1vW ojLiaQTX6/CgtNj3jiigYG4k75dMax7ZelgwbgwXBWv4Ln/BqWh2kIiKUEx2LJrEovLhaaaGy49 bMl1FBPXrJlwoxdpz8PdPIiXTjKEOIOEignaOoX X-Received: by 2002:a17:907:d23:b0:c24:47b8:ae5b with SMTP id a640c23a62f3a-c2aadf60e74mr132300666b.22.1790149769310; Wed, 23 Sep 2026 00:49:29 -0700 (PDT) Received: from buildhost.darklands.se ([2001:9b1:ff:d701:51eb:176f:63d9:53f8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c2aae5c6f5asm64951366b.15.2026.09.23.00.49.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Sep 2026 00:49:28 -0700 (PDT) From: Magnus Lindholm To: richard.henderson@linaro.org, mattst88@gmail.com, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org Cc: linmag7@gmail.com, stable@vger.kernel.org Subject: [PATCH v3 1/7] alpha: run check_mmu_context() from finish_arch_post_lock_switch() Date: Wed, 23 Sep 2026 09:47:44 +0200 Message-ID: <20260923074903.862898-2-linmag7@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923074903.862898-1-linmag7@gmail.com> References: <20260923074903.862898-1-linmag7@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" check_mmu_context() clears asn_lock and acts on need_new_asn, but it runs only as the tail of switch_to(), after alpha_switch_to() returns. A newly forked task never gets there: its first context switch resumes at ret_from_fork, which goes to schedule_tail() and then to user space rather than returning to the code following alpha_switch_to(). A new kernel thread reaches schedule_tail() the same way, through ret_from_kernel_thread(). asn_lock is left set on that CPU, so the forked task runs user space with it set and interrupts enabled. A TLB shootdown IPI arriving in that window takes the deferred path, and the need_new_asn handshake meant to cover that never runs. finish_task_switch() calls finish_arch_post_lock_switch() with preemption disabled, on the CPU that ran switch_mm(), so hooking check_mmu_context() there completes the bookkeeping for both. The existing call from switch_to() then becomes redundant, since finish_task_switch() runs immediately afterwards and does the same work, so drop it. kthread_use_mm() and sched_force_init_mm() reach the same hook outside the scheduler's preemption-disabled switch tail, where the CPU may have changed since switch_mm(). check_mmu_context() acts on per-CPU state, so testing preemptible() expresses the required condition directly rather than naming particular callers. alpha selects ARCH_NO_PREEMPT, so unless something else turns on PREEMPT_COUNT the test is a compile-time 0 and the hook runs everywhere, including at the end of kthread_use_mm(); it only takes effect in PREEMPT_COUNT builds. Moving the call changes when it runs. switch_to() ran it with the rq lock held and interrupts off, while finish_arch_post_lock_switch() runs after finish_lock_switch() has dropped that lock and re-enabled interrupts, with preemption still disabled. A shootdown IPI taken in that window either finds asn_lock still set and defers, or finds it already cleared and flushes directly and by then PAL_swpctx has installed the incoming context, so the direct flush acts on the right one. need_new_asn is only ever set while asn_lock is 1. It also changes one case for the worse, which the series that follows does not fix. Before this patch nothing cleared asn_lock during a kthread_use_mm() borrow, since check_mmu_context() ran only from switch_to(), so a shootdown IPI for the borrowed mm found asn_locked() true and took the conservative flush_tlb_other() path, retiring mm->context[cpu]. With the hook in place asn_lock is cleared when kthread_use_mm() returns, so such an IPI instead issues a targeted tbi() against a context that ev5_switch_mm() prepared but never installed, and leaves the slot valid. Loading the context on a direct mm switch closes that window; where both changes are applied, that one belongs first. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Magnus Lindholm --- arch/alpha/include/asm/mmu_context.h | 8 ++++++++ arch/alpha/include/asm/switch_to.h | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/alpha/include/asm/mmu_context.h b/arch/alpha/include/asm/= mmu_context.h index eee8fe836a59..825d3b9605c9 100644 --- a/arch/alpha/include/asm/mmu_context.h +++ b/arch/alpha/include/asm/mmu_context.h @@ -181,6 +181,14 @@ do { \ #define check_mmu_context() do { } while(0) #endif =20 +/* Per-CPU state: only safe while still on the switching CPU. */ +#define finish_arch_post_lock_switch finish_arch_post_lock_switch +static inline void finish_arch_post_lock_switch(void) +{ + if (!preemptible()) + check_mmu_context(); +} + __EXTERN_INLINE void ev5_activate_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm) { diff --git a/arch/alpha/include/asm/switch_to.h b/arch/alpha/include/asm/sw= itch_to.h index 762b7f975310..35c4b2c9d992 100644 --- a/arch/alpha/include/asm/switch_to.h +++ b/arch/alpha/include/asm/switch_to.h @@ -9,7 +9,6 @@ extern struct task_struct *alpha_switch_to(unsigned long, s= truct task_struct *); #define switch_to(P,N,L) \ do { \ (L) =3D alpha_switch_to(virt_to_phys(&task_thread_info(N)->pcb), (P));= \ - check_mmu_context(); \ } while (0) =20 #endif /* __ALPHA_SWITCH_TO_H */ --=20 2.43.0 From nobody Thu Sep 24 13:37:32 2026 Received: from mail-ej2-f12.google.com (mail-ej2-f12.google.com [74.125.228.140]) (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 9D02D3DC4CC for ; Wed, 23 Sep 2026 07:49:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.228.140 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790149774; cv=none; b=KWVej1d44BYl/fLutehJhnxL3JPxhBN2bf5umsUpjaXoCwsfe5/odXLV/HuP439W8UrioJMqWS6zPOBSJ1q9g/VlPJI/2EWZURWyO+EIDMoDYdnWrPOW1i6Y/7dp7nJYPKP8bN4bEbG5cN92Z19lFZ4l3xU9RR4iRXExrBHr5Eo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790149774; c=relaxed/simple; bh=rV7RWdoFSE7TTcY6xh9/dbA9ePyW0VsBW9PqTyH7yDE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Uv/mgnLSVy6E8qs0/QH1Aq5OnA8QlzFGmxZgGSr36vb6c1tpu0Ag2GcZCKdrhaX33rH3ko28eEHMukl6Lcv6HsLCssLlRSKpvhMogjzuW60a35XMXlJcnzb60q+WNFckv3PUqg8Dlr3ELTqg6ev29ld4If6v34I2iV3GBfTVqlI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=m89S7nSn; arc=none smtp.client-ip=74.125.228.140 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="m89S7nSn" Received: by mail-ej2-f12.google.com with SMTP id a640c23a62f3a-c254f56039dso84152266b.3 for ; Wed, 23 Sep 2026 00:49:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790149771; x=1790754571; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=oRt53aoPzlRbit5NvIEMcjCikEfRg5OTPJqgB/oxcpE=; b=m89S7nSniZIdefdrBL+NNredO2+gSxWB4VQGfPq+y8sS26/K03t4Y2V4/i2+23/KZT 7C/gt35guV5bV9Y27bLq4w4vY6S5WEKSFCf35Itlw29j3AngzcYwwQpOsEW8enX/FfHY TKvGqMJW5+k/xE6fBhHBfuF38kAf/l0F5w2FsM1a5GQUta1GCJJRSV6Lmr7zKd2hBq8t ezIMgcvWhO+RE0l1k8mtZk17UlqjA4KDFRzEXe9W/GmvkipXxO9jpY3MyKEzz4E3Pale lNz79BmThrOqjslkUkHQOwUwge1tH5xF5t55wZM9xvVTq+mqrDWlwel3pM4BeSuQtbkx F2hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790149771; x=1790754571; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=oRt53aoPzlRbit5NvIEMcjCikEfRg5OTPJqgB/oxcpE=; b=hnxX4ucloUMZcJDWD0uqRrdFA0Mg4A+lGavstoOU9+5MpuPidHnyZMa8g0+QtcwYDX ecr3YMBZoP0/lfOQMgRQGORZg9AbfxIanz52DLTBPTH2U7lFHZc/W3cmsoqCfaasQgd7 +J7NKxC5sCJPP6/MdpuIS9YCyEk0UdaX3s9bbp7YEZwox51HabNx0IyaXnsFBGLmug5j 1QcVnK58vyPBIm97OEQJbh/AFdHymapwnzmndG5mQ1dQ4yAop6fbaVMgqSH3oqxKpnac 5PyatXC5L+Ha2gkJvR7plAJKgET3WpqDFVF/Mq5vxhuPT3Q3JpW+R2j3p2YmPmncIg5I HcEA== X-Forwarded-Encrypted: i=1; AKwUvBxM5S9Uk3ezu/EvMTQIJp4qnRY/o5MDzfYrx2Lpmh4eoU6dZkcaUrGMiC7hV5hNjgz0zsTYU+MAu5tCwfo=@vger.kernel.org X-Gm-Message-State: AFuF++kn/ZgCYtvlRvSuYLpMUobbUeS98/WJabV4II6Ny2SFubS6Hndq pd8L0lnqD41Qlf7w97IzzDt7zO9wSsGfVjZxY/0xkBxrhYuUTqsCD0QV X-Gm-Gg: AYBFou2TatiV7g8Z+J19POpDibPKxWFVf20WOPvJz8cMsLQCCKB4A+9IUoURdjJsJTD lgV8ieI4uKErlh8kB/gd1EbUt23fIh5iUssoJnUaVsSo1HgL84i9fqxJPEYiko3qOV+MtCQ9hM4 DDp+U8vzH/hJY46Q0U/SuXA7WmvDiaqvJN10By3E0uCwG6OUQRYYc0dai02Rhh1GHrPS6o4vI1c +8b79G2pj8B7NzXmxQ+S0PzgGJ2lQXqMopPVyFeqfcHkSC00S+iWm4yl/hQviMHuUB/wX2osOsS X/aMJettchq6I1jlYPFy062EUlpQm6JL1ylTCQIuo8u0Uwv07KLOLDYWwREyM9mkrUJnpjrVCX3 D7RIFtdyxt3Nmv7YEO+sjVhTl/zI8MnztU4ETZBRvDa45jwd12whFSK126/AbZaqwlEdeXs4Uq9 B0Q7nhu4U1+9XpKS3VVXS4GAK90rpe2hnB4e477yWkpzMyFzDXk8ndDaV8Se7qW1qOqVbYIj6Sr M7RYRkLblDBgTARiNEwcJJYtx6Ux6bdTK15RN0b X-Received: by 2002:a17:907:d8c:b0:c26:2f09:f2d8 with SMTP id a640c23a62f3a-c2aae2b1335mr126539866b.36.1790149770628; Wed, 23 Sep 2026 00:49:30 -0700 (PDT) Received: from buildhost.darklands.se ([2001:9b1:ff:d701:51eb:176f:63d9:53f8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c2aae5c6f5asm64951366b.15.2026.09.23.00.49.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Sep 2026 00:49:29 -0700 (PDT) From: Magnus Lindholm To: richard.henderson@linaro.org, mattst88@gmail.com, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org Cc: linmag7@gmail.com, stable@vger.kernel.org Subject: [PATCH v3 2/7] alpha: only use a targeted tbi() when the target mm is really current Date: Wed, 23 Sep 2026 09:47:45 +0200 Message-ID: <20260923074903.862898-3-linmag7@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923074903.862898-1-linmag7@gmail.com> References: <20260923074903.862898-1-linmag7@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ipi_flush_tlb_page() gates a targeted tbi() on current->active_mm. tbi() acts on the address space context currently loaded on the CPU, so it is only guaranteed to reach an mm's translations when a thread of that mm is running there. current->active_mm is not sufficient: under lazy TLB an idle or kernel task keeps an mm as its active_mm while a different ASN is loaded, so the invalidate is issued against the wrong context and the stale entry can survive. Nothing retires the old ASN afterwards either, mm->context[cpu] still being valid, so the resuming thread can reuse it. Test current->mm instead and otherwise fall back to flush_tlb_other(), which clears mm->context[cpu] and forces a fresh ASN at the next switch whatever is loaded now. This does not cover a task that borrowed an mm through kthread_use_mm(): both comparisons match such a task, which has current->mm set while ev5_switch_mm() has only prepared the PCB and nothing has issued the PAL_swpctx that installs it. asn_locked() does not identify that window either, for the reason given in the previous patch. Loading the context on a direct mm switch is what fixes that case, and is a separate change. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Magnus Lindholm --- arch/alpha/kernel/smp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index ed06367ece57..1ad448105201 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c @@ -669,7 +669,8 @@ ipi_flush_tlb_page(void *x) struct flush_tlb_page_struct *data =3D x; struct mm_struct * mm =3D data->mm; =20 - if (mm =3D=3D current->active_mm && !asn_locked()) + /* A targeted tbi() needs a thread of MM to be current. */ + if (mm =3D=3D current->mm && !asn_locked()) flush_tlb_current_page(mm, data->vma, data->addr); else flush_tlb_other(mm); --=20 2.43.0 From nobody Thu Sep 24 13:37:32 2026 Received: from mail-ej2-f12.google.com (mail-ej2-f12.google.com [74.125.228.140]) (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 8E08643DEC8 for ; Wed, 23 Sep 2026 07:49:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.228.140 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790149775; cv=none; b=u+oQlYt4P/C9Vnc2pYNCgksgbYJhpZEdUPzX6qPsZOOww47vDtIHdVcSLrBBCmT3+07biBiwaeB3vqC+R1aYAr76udExLvTReMaJWEMD+l5y5Poy2qWyhkvK6V80iz7FjP+eDT48nLT5L6yBRqhmg6NRC8Ijb1OSf7jD+UbECH8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790149775; c=relaxed/simple; bh=+04112kTHUQJIRhYvIFT4YS3J8Q0rIZz1/VifZBexGY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t2MO4praIA69a1MdnkCH5lb8a/LoFwTYqtDSnyeu80K2KpBMTlPGSgHS1TTE9tXkjHQFcGDB13LzyjPYkcQlGLQiVAIIEZEilGeOQQ07MRLACM0b6GtfWahZn/2MiG3MX9MyAakNag9qlllHQZ/hfucAq1VyaM+1GuW3gy8A5ss= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Y9HepF9m; arc=none smtp.client-ip=74.125.228.140 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y9HepF9m" Received: by mail-ej2-f12.google.com with SMTP id a640c23a62f3a-c29d50b7cf9so81035066b.2 for ; Wed, 23 Sep 2026 00:49:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790149772; x=1790754572; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=MsOK/pzJnBs2oTufvss/w9gLbBRsoXKUrgXrSYtYXXc=; b=Y9HepF9mxOxG9yiV88/yYmdUldYp1PlDXj/qvsRLG3veyWAHu5cEfDrL01wYQ11KXo n7OIVgsUhCkY+kDzqk7fH/DE8qtmA2krpPkfKzLi74vGoFZPfTc4VUTsmXhZU5iI6Wf9 +p62Uhoav4Q42BS4mDtPY27OvwAtw+BAVATmt984oNU6Z71Q3N+IGR89wN1qkqZXT3pA FulV2XFhPmWTRq1CWsb5c7jYxgwkGHixGAmqgGmu2fWPFyezd1+Pja+Aoi1P18yVBt39 AseBaIVSmcK+IfuJtlIyjFyPJ8ZhdCIVlw0/XSncuzmxij26WOQHilsTJmL6rYsm4Mpq 3JOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790149772; x=1790754572; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=MsOK/pzJnBs2oTufvss/w9gLbBRsoXKUrgXrSYtYXXc=; b=vCrIouxNX1vWw55I3lWy+0t50znStC/wtAddlqgiuPTqzWvRQSM5ozavzukR+K3bn7 uHjlocVvE9dyEZUdNe+Tbpu/0T2qfm8eYpRdIdobi9FAes59BGydDkDY9op42absTPtz 4Zoap5Vdlc4oYgTowGfyJIXsX/ZtLFeJ2ugiTTxlGg292hrGp3XZaUZnNQ+KZGptiaHI 00ponRQK0LFjuiF20khZmCrOrOo6tbhEO4VWj2Ynfv24SqBWfO1p2F64aWkG7XkZk1/V 9Od1YT5muxXTE13xSbjv15UKdeqQL504kwmRktfMVDllUHM/a3qm4mI+dxiKSVOa1uc5 H1Yw== X-Forwarded-Encrypted: i=1; AKwUvBxfUrOt9up8So6voBAMBDrKa5JqqdMR7sRtCbc9GcPuytPTwHtkXmDhsnZg4+lAxBK6JnNjWGANEMbRIsI=@vger.kernel.org X-Gm-Message-State: AFuF++nNetuf1Zwd8v3rmRWQyfURkSBjTQ4V+Z8G1vsHkpf249BVrZ7h 3sYTUoNU2ImlmdkmJJYx6kFOJv4veR6Y/plEXY6WeU085iASBJWDwOiH X-Gm-Gg: AYBFou0dUvq2+yEtHXbSX+0Cu8GksgCRZgyKm/Y11Fa8Kk90V0O799dFW7GC0mJoQTJ pnNz2SulvhNbq67+xwXBqyjhB7o6xJTB1pXKp/u0OjAEO84pqYgq0mQofRJqFZNKgZUGngIbaD6 wDYrPKNQ1T1tQzyBwpFHtEaxMOamsrs6jcioLSYgtABf1cATBztQxEimuh44MP5/AIJgacIt1vx kE7G/ogE3I5qTZrP+urVpU7o7yhPXnl4RjLaEqi0bmlf/QzrnFRiQ6STNetYBxk/XhuFH8yZZOu ZchxyaqRDxv5D3HNJe82/ikNMT41XS+YF3GqohfWhfW7d+xejCJqA6Dw/dOz4CNGG9TO2iCp4HE mU+ofxqASYz62zKYc5SKb7IrSDTVs7ioCFDPe2xSR1+npwaVRidP15OeznZjjaRcDZQyWcJNfNI 6c+86tgsGbGbDb8MNhl7T3Uq5SJ0740MAulpwhNoCmGOwlse19wodp8SIkplzc8Z/NJKxunrG6T Gq6WbpatiF5evOuVqhhBDl87PAJqVdxSkbs3J6h+LdX8FZfPlg= X-Received: by 2002:a17:907:94d4:b0:c26:19de:913a with SMTP id a640c23a62f3a-c2aae30e60emr130479766b.45.1790149771691; Wed, 23 Sep 2026 00:49:31 -0700 (PDT) Received: from buildhost.darklands.se ([2001:9b1:ff:d701:51eb:176f:63d9:53f8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c2aae5c6f5asm64951366b.15.2026.09.23.00.49.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Sep 2026 00:49:31 -0700 (PDT) From: Magnus Lindholm To: richard.henderson@linaro.org, mattst88@gmail.com, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org Cc: linmag7@gmail.com, stable@vger.kernel.org Subject: [PATCH v3 3/7] alpha: fix the local TLB invalidate in flush_tlb_page() Date: Wed, 23 Sep 2026 09:47:46 +0200 Message-ID: <20260923074903.862898-4-linmag7@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923074903.862898-1-linmag7@gmail.com> References: <20260923074903.862898-1-linmag7@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" flush_tlb_page() invalidates the calling CPU itself before asking the others, and gates that on current->active_mm. For a non-executable vma that means a targeted tbi(2, addr), which acts on the context currently loaded and is only guaranteed to invalidate the intended translations when the target mm's context is the loaded one. A lazy active_mm does not establish that, so as in ipi_flush_tlb_page() the target mm's stale translations can survive, and nothing forces the old ASN to be retired afterwards. Test current->mm instead. The calling CPU then has no local invalidate at all when the mm is only lazily borrowed; the next patch adds it. Which callers reach here with a foreign mm depends on the configuration. folio_mkclean(), from the writeback flusher kworker that has no mm of its own, accounted for about half the calls during writeback of a shared mapping and none at all on anonymous memory. Those counts were measured with CONFIG_COMPACTION=3Dn: with COMPACTION=3Dy, asm/pgtable.h overrides ptep_clear_flush() to call migrate_flush_tlb_page(), which rendezvouses with every CPU and handles the context itself, so folio_mkclean() does not reach this function. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Magnus Lindholm --- arch/alpha/kernel/smp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index 1ad448105201..7856d23b3384 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c @@ -684,7 +684,8 @@ flush_tlb_page(struct vm_area_struct *vma, unsigned lon= g addr) =20 preempt_disable(); =20 - if (mm =3D=3D current->active_mm) { + /* As in ipi_flush_tlb_page(): a targeted tbi() needs MM current. */ + if (mm =3D=3D current->mm) { flush_tlb_current_page(mm, vma, addr); if (atomic_read(&mm->mm_users) <=3D 1) { int cpu, this_cpu =3D smp_processor_id(); --=20 2.43.0 From nobody Thu Sep 24 13:37:32 2026 Received: from mail-ej2-f12.google.com (mail-ej2-f12.google.com [74.125.228.140]) (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 A3F1B456DF3 for ; Wed, 23 Sep 2026 07:49:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.228.140 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790149776; cv=none; b=VqefGEHKkpovzTa27UVRzaHW8WI4gqP6Wtvd5dkWZi+mv2hDhgZ2vFJacanNmA4dWpJUsWCJXWD6PMWCDJsmkYBacsVPOLM/flxyi34afsK6FpTTTvSGfBHC3deLj8v1OFHyXbDKPy04M4yaURp3cFurs5d9hjIHeKI5MUA3+kE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790149776; c=relaxed/simple; bh=Zu69g6v5S8vhGKdq/iPnSasKRWHYaHTkJh8eXNyDYUk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E+4DVz0sCS/5Hyjp2qyTOnLtMfHo/gTmx13E7WKAE7vS+MyFc90yRwgGCZNXdOskGgzMDmdCVPmhUbCLB3y5HccUd51F2opAoJnP+CF/x3BtPIU2E/3aAoEKpZZZsQp4f6falWNDIMCgk0ImQ9vsJR+L9QgO7BD8gvH3yYu9c6E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=pGMn0aaU; arc=none smtp.client-ip=74.125.228.140 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pGMn0aaU" Received: by mail-ej2-f12.google.com with SMTP id a640c23a62f3a-c254f70553dso90760266b.0 for ; Wed, 23 Sep 2026 00:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790149773; x=1790754573; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=tPkz1wN17U9MxOLoHBvnqPKic16Tys9ZaXdqgOxKkNA=; b=pGMn0aaUoGkieGGLTw0frA6npJ/zb3fkdjBrCJLKwdPwFxrViAM+6BCtIJg6JNiA7K l4u5GcnConSyfOf6OY3jQKixwy/h2YhrYZAx69vVXxhT0KA510UW9iRgbotfwfztUDa/ wE8nvryB0Q+wP7tl8QFkpjyJTC9YLyoAQ+HlZU7S6Iqr9y35lSMjMymgA4M8i56uy8wV /bFJUQNimoNe9JUa+qGQHB+CvI3T6AQdFnOXONq601Am7aDdTVYc7sSV1MS0g5cn1os9 HhJq4Q50eiGnytmGJFISETTKC2smp93pK08HX7/ti8koqQdGORnYVzaksSteepue8m4w pxtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790149773; x=1790754573; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=tPkz1wN17U9MxOLoHBvnqPKic16Tys9ZaXdqgOxKkNA=; b=Q3F2RH0w409ibhAUZmK89NtitLrq0BY1M2gqMUMIrKLU4cPsuEOKK3TCAhvj+RN/kg yNQyq6XmcMc7RMpZ2hp1O1FNY+JeN9iDdCZdGARctMIElzwH6OW/N7M/LKBhDFexInZR QL+u1COXK4fXtiy/9u71EQ1vqncxb1nNFcPCBAdEfB8Fc8XQsdFQWHrQ6OIIrxKJL/SF XrE2fi3iQrBfMZl9qv2TDoxGZnBRVhZzf/2/eBigazU9QVgXS0H0wVxKpoHbVWtaDxu2 6GOo9RdA6u+txqf6Y7cTL3zG+WqYm/hX0eOhpI/r2Ov6/bOEbQEBsltjMF6578aTWzJx 2aWA== X-Forwarded-Encrypted: i=1; AKwUvBxPxZeA0qoVJ3LHSxo6XA4dTdQYHxSyxs8DSyCsPDK27brGTpPvhbvy6dDu6wmUhpbusxMT6YDYdDMYbt4=@vger.kernel.org X-Gm-Message-State: AFuF++kAfJQpy3MtlnIVgr55elGObyB8CbQ6zeAZ06pJCwIljQ5A7abt qHbSFkLnuo2c+AMUXnL7tVGhUg3j06XIURL7yiJAad6NpN3nFVZ7r8uk X-Gm-Gg: AYBFou0uQYXQXrtArV/VLFUayL93MERX7nJFAmA9BXfsxROIcFEyoxgMKT3lsJHqGqt bdDg5nA4nC4dyFOErhDdG7Dtazf4Sez+FoRl+5TX4rSf4zL43+AqVr7kYPw2VxfjNqED893DpXo RRPVeb7qDNPhqPUTxTUxMpWJ9DuHJWlcS8aSGR66CDn1Oldj1ilH6h+M3Kjcc23gJvSGll+a1iZ Q2xt/x5BBMaEWtumSVcNS5kwdd/V+tPM9jathtEL6XifJ1hgrvn63eklrTxo5A6Zq7TD69vK+Xf 5mDGZigHYkFRvkH4od5lgzVgmGqAyBgQbF8DP5InZUkDB3GwgLXUFLr6NN2YsO2UIGqe07B395M 5zl8SMkYrm6aoSNh+IhluYbakhWvHxNYdIJPYG7YZr/YMtR3Wf3QQwPP4oNrF9W3tt285ZflpIE zxIKQiq23lHc9U/Aqjq7BPnySeTICdpfxlIltZUoOZJ7HW5p4M8MKIijN0vwE0xGQaOowi6d0ax NAp2GeKagh0Fs8uWoLjfj8b3vaE3Tvaowd3tOWY X-Received: by 2002:a17:906:6a0d:b0:c26:1648:a06f with SMTP id a640c23a62f3a-c2aadfe6800mr123445866b.42.1790149772657; Wed, 23 Sep 2026 00:49:32 -0700 (PDT) Received: from buildhost.darklands.se ([2001:9b1:ff:d701:51eb:176f:63d9:53f8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c2aae5c6f5asm64951366b.15.2026.09.23.00.49.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Sep 2026 00:49:32 -0700 (PDT) From: Magnus Lindholm To: richard.henderson@linaro.org, mattst88@gmail.com, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org Cc: linmag7@gmail.com, stable@vger.kernel.org Subject: [PATCH v3 4/7] alpha: invalidate the local context in flush_tlb_page() Date: Wed, 23 Sep 2026 09:47:47 +0200 Message-ID: <20260923074903.862898-5-linmag7@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923074903.862898-1-linmag7@gmail.com> References: <20260923074903.862898-1-linmag7@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When the target mm is not current, flush_tlb_page() does nothing locally, and smp_call_function() reaches only the other CPUs. This CPU may still hold translations for the mm and can later reuse the old ASN together with them. Add the missing else branch. flush_tlb_other() clears mm->context[cpu] so a fresh ASN is taken at the next switch. With the previous patch this also covers a lazily borrowed mm, which no longer takes the targeted path. The uniprocessor implementations of flush_tlb_mm() and flush_icache_user_page() in asm/tlbflush.h and asm/cacheflush.h already contain exactly this branch. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Magnus Lindholm --- arch/alpha/kernel/smp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index 7856d23b3384..a5a42ae4a7d8 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c @@ -698,6 +698,9 @@ flush_tlb_page(struct vm_area_struct *vma, unsigned lon= g addr) preempt_enable(); return; } + } else { + /* smp_call_function() does not call back into this CPU. */ + flush_tlb_other(mm); } =20 data.vma =3D vma; --=20 2.43.0 From nobody Thu Sep 24 13:37:32 2026 Received: from mail-ej2-f39.google.com (mail-ej2-f39.google.com [74.125.228.167]) (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 A5FDA448CF6 for ; Wed, 23 Sep 2026 07:49:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.228.167 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790149783; cv=none; b=EbyQqu9Lx5I35Df5qF3pNX4Mzc13KhHe4IOSZJTpzTyugsByJpntRzV5KTQ6RxPfMRxaTPU5RhuJt6vgz11epxNDrv2TSSNUqVihWXpwkbYjjMdho6PS5L3urQNxQjyr9T7JyJKLvWiw3rFJsAekwPMhPteFOZQh8Mz18LOYFog= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790149783; c=relaxed/simple; bh=58zmak3D4O3ScLko3YFxQk7A53rZ4PB381sHrZn1Xn4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NE3VxcHeCMV+yigo5XDulTV1+SITxlpdh1tIlA+nCAe4p5j6Jfs0n6Yvs44YZFzB4COjl4lRyFbV51nXM/Pk1m8n1z34jbiXwrU1ZDzPYZZkf5Cj0aqSHVV2hbAYwZCxSF4ZF21zdy+c5JNSFGQh/gIX5jUf8ELHSlP5ZnTVZtg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mxkgHuRk; arc=none smtp.client-ip=74.125.228.167 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mxkgHuRk" Received: by mail-ej2-f39.google.com with SMTP id a640c23a62f3a-c2940ef15c1so70777266b.1 for ; Wed, 23 Sep 2026 00:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790149774; x=1790754574; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=bEde7YfaloBRyUhSbmNY1j2NkDWIsjwrgzwyBWTrgFY=; b=mxkgHuRk7jvAftQdmDglaLGhTWlGFECYLREkdvk4gSj6Nh92XCzFTtRaoPgaLM8E3+ dFxhHuJ0CzRT+3yN775E3y6gj2xSjAf/1RQuTZlnXRGbX3fz3PsiN7rab+hJ2XT3fNA9 +1GSIcpxAR5JJSF8glxtKq2hd+9nEN+kFY8Dy1VG4LjvkOvaLvrJHVg6HsCTWBwzKOBr UWdf8jy85wPKBjJNlkuhUiR01g91JblMz1j1AUz+oabO6O1mqcNuwFA5u/lj1AOh2aw0 hN7fJD7GYAclIhcu9l4JnFniYjR/qV/ws/3J/pH3J+BuRIveMz73KPScGZrYn8OR+8q6 ff7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790149774; x=1790754574; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=bEde7YfaloBRyUhSbmNY1j2NkDWIsjwrgzwyBWTrgFY=; b=UjwFAGlDbRI0wMHtb/9x2UhqvAyQl+No/VP1XwTzyf5qLsgKHMyi3+IyZF1ZulcFzB CR8HMzYRv6r/eydxMTUbwNhVXDLmerRcvIjAhuonbiYwvtueyHja6rxZZm5loGZAAWmt 2x9GoY5F5dIUtNmQh8iQVYAUDHaRhjPr0s84rqs2g75Q/Sy0rjgfrFNHxki6kkXxnTiQ TnH2FmLU+7unwYfxZC0u3HzTpARMsZLyYWfIt2aUHVbldHzLX+DeaF3RizWHqFwT7Tq+ wXgEyeSziKddw7YlF205kGgWZ/FPw8IOZO/ZEx5poiHDa5pC1VfPLxhI7k0uAO+IeslL KRsg== X-Forwarded-Encrypted: i=1; AKwUvBxeIKwvsFNSo+fA+eTyefW+ceVfW9IhqUqEtPasueoYLFfL30v8Yb43xEUC4/DwtEFXj6V4A+k8Hs65ITE=@vger.kernel.org X-Gm-Message-State: AFuF++lVKmWbYxxICG5xq0w3YeJUvEX/DIpKL6A2HUniQMbpcG+xzhFk h/+137lmUUw9StLUmDNnRBWufQj1LghntCGptZvTK+8/Vg0WG9/eyKsEMyxqaGV8 X-Gm-Gg: AYBFou1mKDlHeK3jaRG/NfTH/BVskdzdw7RInS2rLE1numCvpQ5Oa+A4BzQTgMlpwSY 8a8P6fpArzg/cO7xWIxplvVzz2QLmAqT3033tMCU/UJlYFwCfx5QdRms8Pk/liols+ZJiP1Tdlk zHTD6TU2Dy7o+oNSRkuPHC3dDvsXDsag9ZNspEtp2Q8xMfrb59IyALcnxo3rrmctKkkpzYaNqip RlRg7xIqeZGufjkw6APv0bN1bsbooVoB9dCJazIECh/nOpI1F5JyESI5jZUzb0BbA8B7TAdVn93 0zDHFLUVaDT6EAOCTNKfBN1xq1lcwyZTzS2LqGDW9ZbLclqDmh3x8hd1ytv4jTsMhsK1derX6od KmJH1rMnrbHf1pcBf/L7HPhhudA6qCxNVz4WiRHY1Kp8Azb/arjKC6e/lP0P8oLPYF9yl5p4LkS lueCiS3lHH6BxQTckw0tXHloY0hwevJIH28ISKI23FuYRZueCj0y+IslqLJm495JgIYVPzsK3ZN ejmfjyHtiA6HOdEiTZ55qQuSVzgYeMmdwAJFzj0 X-Received: by 2002:a17:907:6089:b0:c29:44b0:1428 with SMTP id a640c23a62f3a-c2aae3738e3mr134989366b.42.1790149773766; Wed, 23 Sep 2026 00:49:33 -0700 (PDT) Received: from buildhost.darklands.se ([2001:9b1:ff:d701:51eb:176f:63d9:53f8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c2aae5c6f5asm64951366b.15.2026.09.23.00.49.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Sep 2026 00:49:33 -0700 (PDT) From: Magnus Lindholm To: richard.henderson@linaro.org, mattst88@gmail.com, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org Cc: linmag7@gmail.com, stable@vger.kernel.org Subject: [PATCH v3 5/7] alpha: fix the local TLB invalidate in the UP flush_tlb_page() Date: Wed, 23 Sep 2026 09:47:48 +0200 Message-ID: <20260923074903.862898-6-linmag7@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923074903.862898-1-linmag7@gmail.com> References: <20260923074903.862898-1-linmag7@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The uniprocessor flush_tlb_page() in asm/tlbflush.h has the same wrong test as the SMP one: a targeted tbi() is only guaranteed to invalidate the intended translations when the target mm's context is loaded, but the gate is current->active_mm, which a lazily borrowed mm also satisfies. Test current->mm instead. The else branch it falls to already exists here, so unlike the SMP side this is the whole fix. arch/alpha/kernel/smp.c is not built with CONFIG_SMP=3Dn, so this is how the same defect reaches a uniprocessor, where the flusher kworker necessarily shares the only CPU with the writer. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Magnus Lindholm --- arch/alpha/include/asm/tlbflush.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/alpha/include/asm/tlbflush.h b/arch/alpha/include/asm/tlb= flush.h index 0c8529997f54..9ae1902faf8e 100644 --- a/arch/alpha/include/asm/tlbflush.h +++ b/arch/alpha/include/asm/tlbflush.h @@ -87,7 +87,8 @@ flush_tlb_page(struct vm_area_struct *vma, unsigned long = addr) { struct mm_struct *mm =3D vma->vm_mm; =20 - if (mm =3D=3D current->active_mm) + /* A targeted tbi() needs a thread of MM to be current. */ + if (mm =3D=3D current->mm) flush_tlb_current_page(mm, vma, addr); else flush_tlb_other(mm); --=20 2.43.0 From nobody Thu Sep 24 13:37:32 2026 Received: from mail-ej2-f12.google.com (mail-ej2-f12.google.com [74.125.228.140]) (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 36405459AE1 for ; Wed, 23 Sep 2026 07:49:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.228.140 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790149780; cv=none; b=sjlASan3WXtXXN518E11g/nnWgjb76ERJceAdrsQrPv7QIc98FRDiiUVJpjquxVF0bqSlly+UzsJvzXV8tpsEvqVfoDhHqbXlguQLI30tR1lj2FJ2qWiycm8vscTnYBOY5aa6p+agsxaa2E6Zwns1i9DXVJKflkEKZaKDZmmTg4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790149780; c=relaxed/simple; bh=EMwactETkXe8vSMhHk5uaUdqn2lrxvQM56NTZ34bIRI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KaUtGYz/zqkiPMy1WPJYCJKKy8ielyZA4XfZwwDBIN7fitbGYdrSXMBKgd+CkVUpmqJN7Vn2iQRRjls5NouizBuK2zSgn3TCy1+kEczZDcKlPO6cnoex99x0ckuRRyRxWZS7uEJOvhYZbVgylrB8mIgky6JBRVRIqq6/JsLg3wM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=syp5ykIp; arc=none smtp.client-ip=74.125.228.140 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="syp5ykIp" Received: by mail-ej2-f12.google.com with SMTP id a640c23a62f3a-c29703cb470so87358666b.0 for ; Wed, 23 Sep 2026 00:49:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790149775; x=1790754575; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=I7gkSrqkOM7ln6wSKzbmSt+3Xyd+xuwsuurc3B4YbEg=; b=syp5ykIp1P5RwEZfZuEJrfw/7R6aSkybJWheEOX7MzkZ6b5EH/xSKgkhQMVrBtyLbL R9oECc9+HP/K6J8nqdXdxuAtuxe02+a7D3xtdb5Z6La5ik5PGY9L3dto1LwrQJn2bRYN QFGYjoVlkCuz/DeR6QbrtWSh5fj+UAtjtcoJ+UAZNkH35e2gmQogoJU/3tGNk0gmIhlh 17Z85XlLcH219CQJpxjXeNAvGJl+vrHW5KT/bsiMmqUN5aPdHOBvtwtBzskhqnSh/gPq 1VF5yMhXH6D+ZZdOKKBgeJq+kRxXGBh+XR9QF5nXgqm5s55UgTQxUWtYqstqHsYP1UHy oC4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790149775; x=1790754575; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=I7gkSrqkOM7ln6wSKzbmSt+3Xyd+xuwsuurc3B4YbEg=; b=gE7Jmjopn4BowIR+RAbm0JvtyqPLAbo1o6zGkvATlX2CI6tyb1B6t5qB7uN9BY1DvW JJSRJ/Bg1dRFGuHBWknuJj/n86JFZULBU+GX153z0J4CT+IR7hym3kr/7lB1mf2QVvOH 6wFy9jcjQl9/PMKRp6pUVKnYaqBmj/DrbaEG5Fn7X8Qh1+Sv2iC6CcGqypgVxZcJyFBX UdrWHWaCKqlVYZr1eh4XGlcbXvxPWwbReWw8qN0LJwaxdQFxwFhIPLon2V2oOYrnPzA/ Bu6aVKEZapkUNZdoL7BqJtHSwI7YZVaByh0eYskGY4WuJaIv0siEg5nJ3NgWGcP4VJiN jrWw== X-Forwarded-Encrypted: i=1; AKwUvBwNcasNaMWdivUsNJsJOuQv70xAPkpUm+NvE9PV1LR/DJHkyGU2TVQO44B2D2IeCBBGqW3vOsC9r1jiE24=@vger.kernel.org X-Gm-Message-State: AFuF++k0IDoxESkXbWRcBjod3cAn2T7je/dgKOTkKn8hWXIuJKPlC+XN PcrZeaFDY1gaVwqYhzPjiQ8ZFmhaQw5ICmCT2sdOpZKn02vjIC4O2lWi X-Gm-Gg: AYBFou3yBvwmjWiecF2/d942e19+zXoG80FnXIoWFkqbsRsQJX2QwqRD7Fac4Xv0j2E rxwhx35xoJHVQrza0fK1sBnxlZp/0WHfg41QU5VSRPmmI26hnim0dLxTWDd/09Uii0bVRsGdmPn jbQ6K+i13qJTL/30JUbYODjXoMNKjzUnKEWDgx+Gm5817qTec2Y+ikRuX0KvN7GxZQ+ghLjgZaS 2iQypkzz00I6fgGuvtf+MNng8hPeRieI2GQZWks6Pt0spats3Hqtu/bT0qXD89+pC9YXvmiw7e7 D73m9fvGHNM5FzMYQcKzMEFK8/bges2ohaOI300k7/KZSaRa3S01IYRUpYkukTf6IQnT+0j+Niy 5azsVdRt7HRwPpAkKJVLIontS0SOVvKw44n1OGnLVKVmz2APD7cqWOb/Uh93z4rrBLRGNnbqcN9 tOFwNaN9Y1verCd23lD1cJIpwStRlZrNUjNcZ9A/GUiPX/nY415cEJ563TKFMmwYIDwr9XnKrXU rCgJy3t1MOtnWI9SUb8riUoX5DpuTATaHwsye5nws6Pr+CSrHs2KkeWjRM8mg== X-Received: by 2002:a17:906:dc8a:b0:c25:2688:8212 with SMTP id a640c23a62f3a-c2aad863bd8mr138436266b.0.1790149775100; Wed, 23 Sep 2026 00:49:35 -0700 (PDT) Received: from buildhost.darklands.se ([2001:9b1:ff:d701:51eb:176f:63d9:53f8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c2aae5c6f5asm64951366b.15.2026.09.23.00.49.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Sep 2026 00:49:34 -0700 (PDT) From: Magnus Lindholm To: richard.henderson@linaro.org, mattst88@gmail.com, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org Cc: linmag7@gmail.com, stable@vger.kernel.org Subject: [PATCH v3 6/7] alpha: invalidate the local context in flush_tlb_mm() Date: Wed, 23 Sep 2026 09:47:49 +0200 Message-ID: <20260923074903.862898-7-linmag7@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923074903.862898-1-linmag7@gmail.com> References: <20260923074903.862898-1-linmag7@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" flush_tlb_mm() has the same caller-CPU omission that was fixed in flush_tlb_page(): when the target mm is not the calling CPU's active_mm nothing happens locally, and smp_call_function() handles only the other CPUs, so this CPU may later reuse the old ASN together with the translations it still holds. The active_mm test itself is left alone here. That path calls flush_tlb_current(), which loads a fresh context through __load_new_mm_context() rather than issuing a targeted tbi() against whatever ASN happens to be loaded, so it does not depend on which context is current. The uniprocessor implementation in asm/tlbflush.h already has the missing branch. Counted over a fork-heavy run, flush_tlb_mm() was entered with the mm not this CPU's active_mm 2934 times, and 632 times while otherwise idle. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Magnus Lindholm --- arch/alpha/kernel/smp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index a5a42ae4a7d8..988e397b0b8a 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c @@ -649,6 +649,9 @@ flush_tlb_mm(struct mm_struct *mm) preempt_enable(); return; } + } else { + /* smp_call_function() does not call back into this CPU. */ + flush_tlb_other(mm); } =20 smp_call_function(ipi_flush_tlb_mm, mm, 1); --=20 2.43.0 From nobody Thu Sep 24 13:37:32 2026 Received: from mail-ej2-f12.google.com (mail-ej2-f12.google.com [74.125.228.140]) (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 D244D45D5C4 for ; Wed, 23 Sep 2026 07:49:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.228.140 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790149782; cv=none; b=dGghOl4MTVK0gzGJs++SH3xeid9OG/Il115NdXKYJI8A/2T8DkMy0ZYIuJp8LKmqxFhH5wqD9S0vAWsxoLembwDEbyVWfSnbwFRSri7m29qkLBuwJzcW6m6INFNG9YsOJ31RcnSWHvqAeAfbiZbXr9STgozuJO/31NngJ5LUJUw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790149782; c=relaxed/simple; bh=x1EO1t+RhKNeTSsJq6ZLnxGbgzYj7ObuT+4PdV8PdPs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=d/LBbi6fcRTZRZa1jW925g0rVxo+UF7i5V4NF+OvtrS88FRE1G83RklMrUyljRMw5U08zbvHs/XLnN5nrkggtHXVCS/PgZZft05bgCWKKSsEKgMMY7uPskcGstD4fhaiPnBdKf/rY4Zove1J53U55ndy/loZ2kR6OZYbbTSYRP0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=E1Ao9z2v; arc=none smtp.client-ip=74.125.228.140 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="E1Ao9z2v" Received: by mail-ej2-f12.google.com with SMTP id a640c23a62f3a-c254fa663bfso92933366b.1 for ; Wed, 23 Sep 2026 00:49:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1790149776; x=1790754576; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Jgp+ZrcyR2hZuyp2AvG7ZUXVguQdflnbvJs857sicKc=; b=E1Ao9z2vHp1r7M2uqh+YkOjFPoiVDGg18ym4TRyYXszviGJuWGRj/PFG56sP5OpEmA RjDE2Hha1XGocy69q414mvVmsl+j3E3+fiImx/UjYwDC2KNGn5TyC6w1X8TwstfoeG8T 2YdAV7IdBK2Mzr4D28bnksiMqXLl1gGey8AGpaKBdwqD4FKXQBVQNIEjnlv+geAOmWl8 zqGp/cZcx1EChlOMGEYISVJ3J2StBqZ1V0gPfhFeAhSAOvSQxbTHE7qY6ONOwHOuNWBX Nh0ZNNF/Jf/W+J8hE9UE0ywqJtSdpkfUz70AxryVc/cVHOZAsB2r00PwoGfXqS/VrrYp wtUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790149776; x=1790754576; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Jgp+ZrcyR2hZuyp2AvG7ZUXVguQdflnbvJs857sicKc=; b=2397G8xdm4ZlZKgZvxcKm+UeNs2AnoJ9uVHMkXiJNRG8ElYOcxQAzU07o3JAN9+lBn TRnLFYyqZoWDCSy/cXmSje7yf8N6QNWCOj9KE2vJ1jpmHMPql9MDi3y68opP7aebOTS6 Jz5EMaOeWhd8/Ef+dVlH5lDeHPmUzLbEwn2Uso1P3exHdgiuZMafF2faKB84w+t9aPAW Wuy26F+2ddKQ6ma91LPi8tOewuDvC0JOs2d5IyukPCJXvQ5zIXimDqsHlGhCI++DFanr eMZyFdYsMzjBNMu7RfpUc3W5YOBpl/pmJv6NLMS9CyrXioDiXLoUXofb2n6sm0StA4sj JFkQ== X-Forwarded-Encrypted: i=1; AKwUvBwF1u7dfQLWgE1r7lG9q7jxfD858OpChjNzX01JntJoOupKm5yDkfrBq8k555evSz/NenKYSe88ntCAkyE=@vger.kernel.org X-Gm-Message-State: AFuF++nOrZAzClM064gEpG0cmEZ6hMzbHpTd6gydG9L+ykPQXbKyRbq2 s6lxKJeMysLmj6AAO2m9X2h0EdULK50exCB0DI9k+lBInQSvjon2aC5He1K8lO79 X-Gm-Gg: AYBFou3d5edYGDtG9/hc13PqhgVsJFfL0NY94+ltqocdwsYEHrBHDsTJBCHxAhrcBUj byiC+kWD68NKyjZzDpIkWk8V1ZlDk+SCAr1r+asfIcD61zByWxPq8ybrLDP+3QGgCIHvWibwszP uxqaXYKtLso4t+Udmxbq1cS3okpI5pOpFjVeuOqemI5YNvAH3mp/6OZU59TZHTkqMjPnJpdMBEr glLrhg1etFx4+A3UoYtlo/Fd+V1Cve/cspfUVG16ISODMv/Tyqa4YJ68BNwjQf/3xPBAZQx2oNc vuxTEBvwex4oONHeg8nWHJhVEBRa9Qn+mVg6t1PywocwXEqbME/35KoWss9BnilawDbHjhpv72k n7VG093tbqqjkGy3Q21O2owwg+VwWpKcG1XfKIYe1A5O7msygUF5OiSFwiU2/nRW3ZOaq+HIWk2 W+iFxkUr2a6cNKz5cwFhl4NYASHp8hMU819VrYOvXw8XNU+JogSm8FAVR5vtKAT5uP7FCVI6O1t 0RM7N3DZa0cetf/uE/RzNwxrYIj0nzBvA2NwnM3 X-Received: by 2002:a17:907:3e8c:b0:c29:f5d5:5a96 with SMTP id a640c23a62f3a-c2aae1d27damr126462866b.32.1790149776099; Wed, 23 Sep 2026 00:49:36 -0700 (PDT) Received: from buildhost.darklands.se ([2001:9b1:ff:d701:51eb:176f:63d9:53f8]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c2aae5c6f5asm64951366b.15.2026.09.23.00.49.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Sep 2026 00:49:35 -0700 (PDT) From: Magnus Lindholm To: richard.henderson@linaro.org, mattst88@gmail.com, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org Cc: linmag7@gmail.com, stable@vger.kernel.org Subject: [PATCH v3 7/7] alpha: invalidate the local context in flush_icache_user_page() Date: Wed, 23 Sep 2026 09:47:50 +0200 Message-ID: <20260923074903.862898-8-linmag7@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260923074903.862898-1-linmag7@gmail.com> References: <20260923074903.862898-1-linmag7@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" flush_icache_user_page() has the same caller-CPU omission that the previous patch fixed in flush_tlb_mm(): when the target mm is not the calling CPU's active_mm nothing happens locally, and smp_call_function() handles only the other CPUs, so this CPU may later reuse the old ASN together with the translations it still holds. This matters here in particular because the function exists for operating on another process's mappings: the comment above it describes setting breakpoints through ptrace, and access_remote_vm() reaches it through copy_to_user_page(). The calling CPU is therefore often running something other than the target mm. As in flush_tlb_mm(), the uniprocessor implementation in asm/cacheflush.h already has the missing case. No imb() is needed, here or in ipi_flush_icache_page(). Alpha's user-space I-cache flush works by allocating a new ASN rather than by invalidating the I-cache: the entries stay, but they are tagged with the old ASN and can no longer match. An imb() is only required when the ASN space wraps and numbers are reused, and __get_new_mm_context() already does one in that case. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Magnus Lindholm --- arch/alpha/kernel/smp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index 988e397b0b8a..e21bc3920bec 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c @@ -758,6 +758,9 @@ flush_icache_user_page(struct vm_area_struct *vma, stru= ct page *page, preempt_enable(); return; } + } else { + /* smp_call_function() does not call back into this CPU. */ + flush_tlb_other(mm); } =20 smp_call_function(ipi_flush_icache_page, mm, 1); --=20 2.43.0