From patchwork Thu Feb 22 19:09:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yosry Ahmed X-Patchwork-Id: 205003 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp153312dyb; Thu, 22 Feb 2024 11:11:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXCTxB4HvaYgHXWAo9SgEdYi8y3srkKVn06jk6WXHsdZ033Q38u+d9/N2Zk62eLRir56xVyIiYQy3gFRngVjrGpsyhMfA== X-Google-Smtp-Source: AGHT+IH7ykXdnD0wdPrcgaYA6vwnkMmDWsAGb54C0RkLeCtzvwMPlkjFgJPtrPmp23KEuI+nTozV X-Received: by 2002:a05:620a:468c:b0:787:9304:84 with SMTP id bq12-20020a05620a468c00b0078793040084mr5052108qkb.21.1708629098995; Thu, 22 Feb 2024 11:11:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708629098; cv=pass; d=google.com; s=arc-20160816; b=DMO3trRZJYKmdDjaHgzyb0IONaAqSB3XUGWxw2sNplM0C4O0QpsD4rcmL/mNntgC1s HV5mV9K7BHggewq34CjvvJekGLMY1oKBSYECbmkrnEMXAeTr/cgtMaOJnKg8j0Q7nV51 MLhSi2Bv61e5OHrhe/qkXeLHIYfmimQbHKMgK60rx+0F43sVoL+fiA7164OHXfqylAAi aF67yvrYUxtyV2IQbzTucAC5/uEbYMP6wXPpVWPuRkVHkXZyf/jDcU0ncqvKuPVvEBfZ waKRAXY7qHwFxFeE8AcWRW2LR3r6BMX2RlZLnACNiIxrbHFvPrBuE99LfYXgoiTygtMM kbow== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=nIzMjlB25RgjrxXtl1pB1geOeDMH3Njm73h3nfH079U=; fh=GRVBj1XRQ3e1aELnFU/J5ePJNAP8phS+jdaNwcHT4zY=; b=aav4OAsgUJkmHNlhH0N+mmVO/CeyIgtaYhVqwfph3zwjxozTNVy0a+4a/VIt8LF8uI ptfrtb6PyCQfxcKbnWpKMQrG2vmCfZ1uyBHHWkMGEREwU9b+Wsk/PLeerOrR4j4JYbIN KwSBne6l7q3rjRM7E5AqE7hxDHmMeKcCaujbwmM2feJpSsC4vFxHrnsrcaTIC4L3j9br GrGcGw6jZ0IdynsE9Bz1/nOg6Jn7upLFA5P1kss/zmPWhnb/c9uxHlTdc34iMpvmg/Cs xCrrOxOPnwUlwQwDzWrYVRVOJaOABn+ZvI7D1jncfYOq9cT7qGKAQK/qwgf+53iJggKm brcg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=YnvXnOuw; arc=pass (i=1 spf=pass spfdomain=flex--yosryahmed.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-77223-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77223-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f5-20020a05620a20c500b0078786192e61si3912468qka.501.2024.02.22.11.11.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 11:11:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77223-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=YnvXnOuw; arc=pass (i=1 spf=pass spfdomain=flex--yosryahmed.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-77223-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77223-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E25681C26348 for ; Thu, 22 Feb 2024 19:10:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C44636E5F5; Thu, 22 Feb 2024 19:09:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="YnvXnOuw" Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (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 BE13D14B815 for ; Thu, 22 Feb 2024 19:09:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708628956; cv=none; b=ULwnxjfGAxT9ckcDKNwRmA/IoHphzewyBCA0D3H086iY5akxzXpms2AMy3QyNUoO7I9dsRNBWpZ1ZIXpNXHc0kWbJLwGKv4r2+LR8hbjpobQWI8yjDFK3/yw1IyIQt6OQTNPVCwwl1mqgLu2sOjdHwh4KYevVf0eBokz7Ac0pbs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708628956; c=relaxed/simple; bh=qMCWVXQCkH7/OsVC8XV8wlWhGBfIObVlwCTkLB6YOOE=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=PaQ7sLHgeLqz90xkEfIU1e9MQgTbrRF2lX4xDQTRrKIxsN8J2xLA29fIwLg31cjI56VSGq6oEgKakNAMXP1/MX+EJdO9AxkKywOcIgjb1IElvGaJPkFbEAVIc7WkihizRGgYfBgb5OGVK2MUJaWx5vp5aZI1VSfdBwi/0lCH0r8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--yosryahmed.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=YnvXnOuw; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--yosryahmed.bounces.google.com Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dc6ade10cb8so303776276.0 for ; Thu, 22 Feb 2024 11:09:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708628953; x=1709233753; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=nIzMjlB25RgjrxXtl1pB1geOeDMH3Njm73h3nfH079U=; b=YnvXnOuws707cMoTDh+7wSc7NDDp47PM2vWtPE6A9K9+oWNJ0YlBbcnUqBpKE6ej7U t+mGJeecc2iCJYT0Kh83xvl77zm8khaKraP0jntNSCpt1TkPORv70uwthyGwbUlwgwGJ yAyW5rvcPnqikmjJh4AF2vNN/8jkPDNVk7Yp+DoSeY2eumbSmPi6QcclG6yM/NEv7h33 w6+SLa4BbP66USwmlEWcbOqS8AL7zlZsQhJyUMB2xqenwFOcDe/LnI8+bLLVGoXnazJr r7WAeUrHIHF8L5BvEonoVQk1LuKG1RcXMlf7VDTmOXUVr0FP5GJ874jRagaXJMURzwou Ux9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708628953; x=1709233753; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=nIzMjlB25RgjrxXtl1pB1geOeDMH3Njm73h3nfH079U=; b=F5YjSowNb/8srVc8BIcXoT5pvN/a9VdTzA4uOLPqe+mveZz34eNsNXI90AQ0+xAGxv GpI1Ojien4rerC/3bd3y0VFEJl84hCwSrFYfQ0RB3DBt1cS2LUg4BKLixF2VN1WT9Rz+ 7dTYw2mjmhhkJY3Dmn4XK3xU3ZZrkbBf9DA4LezQoVt1b9VCLsAV/ZVs8woGLiSp9pvo 9h01t8otcrxfB67YGpoNtBR+emXchCGPzshwA97Nbi0+ybYzfrt7PXvxSNCfZfn7mBzN M3KpZmlIo60f/OkrvKpGHmQlDhj3x4DWmq5YalRZQdZNR8iphtLsab1nBTEIpiA7s4f+ 5Kxg== X-Forwarded-Encrypted: i=1; AJvYcCXhGMc+AreF0q3/6VgvBzrf3rm6sxEaKc80YzA0k+UIi2y3leCYlc25eNAWqS1UnJ6lyeAviUomfoODHt3hva1P8u1MD5tl9veiKgJ+ X-Gm-Message-State: AOJu0YyRnXFAOx5u2bvg/o5kzDdqX/CNCQcU+qOzwqAl38gHqWIoDFvY inHnD6y6rQr6NrJUcJqqGC9XyFc+FGTaAe+Y8ttgontKYdQUM8bnVfOmrhUuFFve93zKc7y3UED oGx/fX4uPk/l4Ppa76Q== X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:29b4]) (user=yosryahmed job=sendgmr) by 2002:a25:7496:0:b0:dcc:5463:49a8 with SMTP id p144-20020a257496000000b00dcc546349a8mr657549ybc.6.1708628953740; Thu, 22 Feb 2024 11:09:13 -0800 (PST) Date: Thu, 22 Feb 2024 19:09:10 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.44.0.rc1.240.g4c46232300-goog Message-ID: <20240222190911.1903054-1-yosryahmed@google.com> Subject: [PATCH mm-stable 1/2] x86/mm: further clarify switch_mm_irqs_off() documentation From: Yosry Ahmed To: Andrew Morton Cc: Dave Hansen , Ingo Molnar , Thomas Gleixner , Borislav Petkov , Dave Hansen , Andy Lutomirski , Peter Zijlstra , x86@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yosry Ahmed X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791627466078175700 X-GMAIL-MSGID: 1791627466078175700 Commit accf6b23d1e5a ("x86/mm: clarify "prev" usage in switch_mm_irqs_off()") attempted to clarify x86's usage of the arguments passed by generic code, specifically the "prev" argument the is unused by x86. However, it could have done a better job with the comment above switch_mm_irqs_off(). Rewrite this comment according to Dave Hansen's suggestion. Fixes: accf6b23d1e5 ("x86/mm: clarify "prev" usage in switch_mm_irqs_off()") Suggested-by: Dave Hansen Signed-off-by: Yosry Ahmed Acked-by: Dave Hansen Acked-by: Dave Hansen --- arch/x86/mm/tlb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index bf9605caf24f7..b67545baf6973 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -493,10 +493,10 @@ static inline void cr4_update_pce_mm(struct mm_struct *mm) { } #endif /* - * The "prev" argument passed by the caller does not always match CR3. For - * example, the scheduler passes in active_mm when switching from lazy TLB mode - * to normal mode, but switch_mm_irqs_off() can be called from x86 code without - * updating active_mm. Use cpu_tlbstate.loaded_mm instead. + * This optimizes when not actually switching mm's. Some architectures use the + * 'unused' argument for this optimization, but x86 must use + * 'cpu_tlbstate.loaded_mm' instead because it does not always keep + * 'current->active_mm' up to date. */ void switch_mm_irqs_off(struct mm_struct *unused, struct mm_struct *next, struct task_struct *tsk) From patchwork Thu Feb 22 19:09:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yosry Ahmed X-Patchwork-Id: 205007 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp159812dyb; Thu, 22 Feb 2024 11:23:53 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXRmIDwJkZEjWAYfOjRTD9c6zYk5Kc3/Dmhw0d1vIu6Djy5TXLznoL27dZUSMtYNnnZGUvuUwY+zK918nAgbqVXn00icw== X-Google-Smtp-Source: AGHT+IH4Xi9EMVDJCvcH9TiZsG1oso/EcJ/D1cAoQt+aEM47boukThhiH75ifOxiz69YzqDOc2mC X-Received: by 2002:a92:c688:0:b0:365:696:2817 with SMTP id o8-20020a92c688000000b0036506962817mr20033778ilg.3.1708629833246; Thu, 22 Feb 2024 11:23:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708629833; cv=pass; d=google.com; s=arc-20160816; b=pbkF7A0GUI1lxpk/1dXZJ9p2qdwvLj46C+7X7R9YKNYpMTvXa9XIDEZnocmGagSk4A AdefC3NTeTh2s+SPE2RZzcnjiyJ4MIFUffMGZdHiXYjy0V35jLo3h1Yh4dsfHVIcn7UH wy9+/kDbu/0V8YTW8fwoaMuu5e/otFvn22i39MdzfhxCd15mo3EQdRTCrCdqf7LZuJJ3 ZDa05pTOG3EnMjY/IbTU7LmyH6/8iCxac1nqMeSpzmZXXpVtkcEAK2vtwSWrrFl17fw7 3AatlMtr/u/1uFv/NR95gwAbxeId5YuNFv76IxUpzlN21t0kk9X2j34bQWQ+WuzshnY6 GNqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:references:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to:date :dkim-signature; bh=KUYsRE8+tSPKyWViBth/a0r1Ckkz1G0ugYjkWT2KW0I=; fh=rsLmcDHJS0VQ9tQ37sxJaDxU+cmiK7KQCu+ciPjP7vg=; b=xEo0PWqyM6M38PunZiP+Tg3nzy4f9zJXGfIyN3+dP7F46jwljIHFDUrDnmVe5mbkZX jHHvzoI88U2W00HlLnqZ8A3gTQUPG14AkmZnDNBa1kavzMlCG/0ZSVxTFn6yzlcWo4zZ ZDB6dRhMv+emoOavudQRHuAWbEI9gynSNPtwmSTKSyW4yXhf1taK9yOhJEO9nJxk2ZHU kywzdR3xSoimpyoK/L9R2z+8j2AwQlrxmSV/GwxKDJZscjxzqRgryJmFjo4bkmy1c+As 2bndzEDGwCi6Wj3UUiKYmo2qF5rCkED4DfbVukk7fFJaqHY+Arq4dZSr0N8a870NYrR9 45Bw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="S9e9J/eQ"; arc=pass (i=1 spf=pass spfdomain=flex--yosryahmed.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-77224-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77224-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w30-20020a63af1e000000b005d8e1dc1df8si10795490pge.705.2024.02.22.11.23.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 11:23:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77224-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="S9e9J/eQ"; arc=pass (i=1 spf=pass spfdomain=flex--yosryahmed.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-77224-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77224-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B4E9129042D for ; Thu, 22 Feb 2024 19:10:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C1C76E613; Thu, 22 Feb 2024 19:09:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="S9e9J/eQ" Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (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 7E48D548E4 for ; Thu, 22 Feb 2024 19:09:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708628958; cv=none; b=Xm2bxfAbGLJTbZFjxVuEbAQk0uV+upP2AJbXBkpEkgCV/3bt12MWsnF/B2ho7G/6+hg4M2NUa12Mdkx+IEa1BmqPvfw902ULwGJ88MP0/7ynvstnYDkqd4tAjs3Y+lnqrqbzN+ixZEMhEjsqGklf9CCNGAz7sqkWylHr3dg8I3o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708628958; c=relaxed/simple; bh=WbHoUINdvI+/EfoRmUSXGRsEKi+kuIuXKJxB7X2GgEo=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=EB6eVRXIy5ZJOA/pYsePQsRfvgAJfMZXdQqJMVD3mofa8Agm2Kh/PNU35MSTVIf3dEuLljCk7wpWUfRsezhO9Io/8QnBTTEeRPJPrUwkg2j8nhtByUBc76Xbe0t+4I5Y7VIdy7ZfFpLaquPyaTn0IPnd7CWGhxgNu6E3IsCq4+g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--yosryahmed.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=S9e9J/eQ; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--yosryahmed.bounces.google.com Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dcbfe1a42a4so32864276.2 for ; Thu, 22 Feb 2024 11:09:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1708628955; x=1709233755; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=KUYsRE8+tSPKyWViBth/a0r1Ckkz1G0ugYjkWT2KW0I=; b=S9e9J/eQcigEc8zHdVHcndZCj2dXG8BLaBrgtI089iuuba1qzciO+DxUWOnwWjGP4H CPnQHsETzRUF1Y5nyrCZsSBF19w+iXOBJ9Rfhy7ZYmqjPDIJt68OhE2v3Y+2Ze7enBST GjrCL8zanmljR5YFgeBaHiTfiYhOQbBlQVCR4fjFgpch9CbokHtFMk0xh8dk5XN2UM63 A0HxYTnj4H5lyIF/G0ZV4r5KkGPv6efvuCm4QeElg5wIl64fj3VK7uUh06TuBHFVurCe EOS6G6e/RJbHWDEg1Ltzr3WdC3jpG8inu4LPhkLPwv7qtcIU0Iy45f0x9K/yiswnLuXZ rufw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708628955; x=1709233755; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KUYsRE8+tSPKyWViBth/a0r1Ckkz1G0ugYjkWT2KW0I=; b=JHo0Ju57skc7B0kVQhCOD9VvZcfLSV1qS9SC3kKA3rEnXDtf5srV7rxVg6mKcN3hds lXIjIKlW5/PPPueOPsGO1ZJdoRBmg6tDfoCs0ueKs3VmAZ9qVI6RA2IooyowD+Bj9tST wKFHx10trYoavO+5/zXgRd+cs0ZLbiPhJPxGCl1VYntlGrcXmp5Z0RJPS9U4bMDgKyt3 1hXEJ0DwCYbGIEGeaAioDQpLuwk033h+W+UTFQTU4L84+yIFbCj9Tfmi4mJsRVrPHb8p DT67WpYrYDSpDvd88iyYmHsUJJv7/n9U31HFH+no03MY1u92jO7ke77QDfFzrbzKvW3z 5W/w== X-Forwarded-Encrypted: i=1; AJvYcCXHqL01D33o3gYACh0puTSwLwPtBqxBRe2R62zTuzz7Sw1TDy2eOG011ogq3XiBBFQn91kwPwDcfJGYlwY/viWDBkgsAViq9I+wWjx6 X-Gm-Message-State: AOJu0Ywa7c9nl59wS77I/dhAYEC9r17XLlRWVr1KnNuXXN94Umv8A1Tj GIityoy2zDQKAf0CoiK6X4xZlSsk0C5EnddMRtyWIKYD5SCsdP2IjH0EIrHBh1Jzqa6JIBH/AP0 gPlvQvn1v5lOvZUf0EQ== X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:29b4]) (user=yosryahmed job=sendgmr) by 2002:a25:abd0:0:b0:dc6:cafd:dce5 with SMTP id v74-20020a25abd0000000b00dc6cafddce5mr6172ybi.12.1708628955435; Thu, 22 Feb 2024 11:09:15 -0800 (PST) Date: Thu, 22 Feb 2024 19:09:11 +0000 In-Reply-To: <20240222190911.1903054-1-yosryahmed@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240222190911.1903054-1-yosryahmed@google.com> X-Mailer: git-send-email 2.44.0.rc1.240.g4c46232300-goog Message-ID: <20240222190911.1903054-2-yosryahmed@google.com> Subject: [PATCH mm-stable 2/2] x86/mm: always pass NULL as the first argument of switch_mm_irqs_off() From: Yosry Ahmed To: Andrew Morton Cc: Dave Hansen , Ingo Molnar , Thomas Gleixner , Borislav Petkov , Dave Hansen , Andy Lutomirski , Peter Zijlstra , x86@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yosry Ahmed X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791627596173202862 X-GMAIL-MSGID: 1791628236321689956 The first argument of switch_mm_irqs_off() is unused by the x86 implementation. Make sure that x86 code never passes a non-NULL value to make this clear. Update the only non violating caller, switch_mm(). Suggested-by: Dave Hansen Signed-off-by: Yosry Ahmed --- arch/x86/mm/tlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index b67545baf6973..51f9f56941058 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -327,7 +327,7 @@ void switch_mm(struct mm_struct *prev, struct mm_struct *next, unsigned long flags; local_irq_save(flags); - switch_mm_irqs_off(prev, next, tsk); + switch_mm_irqs_off(NULL, next, tsk); local_irq_restore(flags); }