From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A85BEC47073 for ; Thu, 4 Jan 2024 13:27:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0A5516B0391; Thu, 4 Jan 2024 08:27:03 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 055506B0393; Thu, 4 Jan 2024 08:27:03 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E86966B0394; Thu, 4 Jan 2024 08:27:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D97B36B0391 for ; Thu, 4 Jan 2024 08:27:02 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id AAB5B408E2 for ; Thu, 4 Jan 2024 13:27:02 +0000 (UTC) X-FDA: 81641704284.15.3610270 Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) by imf01.hostedemail.com (Postfix) with ESMTP id AB16240017 for ; Thu, 4 Jan 2024 13:27:00 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=broadcom.com header.s=google header.b="GfZExSC/"; spf=pass (imf01.hostedemail.com: domain of nadav.amit@broadcom.com designates 209.85.208.46 as permitted sender) smtp.mailfrom=nadav.amit@broadcom.com; dmarc=pass (policy=quarantine) header.from=broadcom.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704374820; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7NLOEEKOHl1K8SwVg4x8l8DROTucqom/M/VF0VUr2O4=; b=ZuLanB8MDCgIgdFT2ov1i5cwn+o61iFwclrzAJna3LRtG3GobmglEf8HCiMVM1cuLtpket wgCNDwCYkpvzzuuoEet7h/4Z3hBacHYtes/q5R4rPvFWcPlIZsJFWW8QI6xUtp8AWY2E68 oJmMrO2a+8XjOEWy0gMDF8btX/G/dUM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704374820; a=rsa-sha256; cv=none; b=bHZ/amhlDvokt/dzBrUd1evRg4kpMmnCaPtPsUzex3/8AIgwxAgS71OUn3g8ywwazIsDHv UhW481WhJiguScyabKPpFzU35rTe4btiR2YsHKOg1R5E2RBb+/otWZuj7w5HFRutCW29if EQmQgVmL3yxR2LAyg79gs34TB5MR1tY= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=broadcom.com header.s=google header.b="GfZExSC/"; spf=pass (imf01.hostedemail.com: domain of nadav.amit@broadcom.com designates 209.85.208.46 as permitted sender) smtp.mailfrom=nadav.amit@broadcom.com; dmarc=pass (policy=quarantine) header.from=broadcom.com Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5563944b3dfso611008a12.3 for ; Thu, 04 Jan 2024 05:27:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1704374819; x=1704979619; darn=kvack.org; h=content-transfer-encoding:to:references:message-id:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7NLOEEKOHl1K8SwVg4x8l8DROTucqom/M/VF0VUr2O4=; b=GfZExSC/wFZp+Qzd2ZOD17Ze8dSDmaRLmJsPs5YXicg0WfRUIuNKRgOf6z88fqPrGb vgTgYto25mVlgbxjjmZH1oAkH2TB/6atN4tMVK76OsS9k+6ZPqVfIE8LvPr8R4/244+U rP9vX9EUl1lPMt9YwkRGCEEOKtEgt4MdzLNMM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704374819; x=1704979619; h=content-transfer-encoding:to:references:message-id:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7NLOEEKOHl1K8SwVg4x8l8DROTucqom/M/VF0VUr2O4=; b=pzPs2g98+PCM/D3PlWuMY8NvMeNe45If4O/6YN2OuWEqnM8kn/TYXc+SK9+a+FNysU VnUHhwvW0CnESV4oDZKVuYTc20bxj69wzmcv638bB/BC0k544q3VwVaqood/AOxG76Hg nGggksoFay+FEFvDCRykkOWehgnh1A9VrYdm+sqCklAVTWJG7XhLStHvJhEGvqBgDk63 n2E4vmkNB0EaW99vdM4099VKIwN0YGvWTjwy9eh5lhISjnZfE8akrsBaZTZ26Yc5VtnR 7Pe7PBAGF9n1p6zmTncUADWIhRc7ECdjDjk+E3cYsHsTBOeXSG6jT/y7EwqczGhLAIDF z8Hg== X-Gm-Message-State: AOJu0YypYoQnagIwYgrbwqYeoI93ht3xMWFY75XfPgqwWBICSDfrYGls xGGfGIzI2IHtyi8K+m42N17xV4o2/rp1NzPemOxBj5NilJj1gndV3CJboAXA4qnlJ0xZA+MO2VS Zyk0APKeo X-Google-Smtp-Source: AGHT+IHd/WpwPLyNONTm9ogjAA99SQMYsTaEZ3qlb+1RX3wQIK/T9BGDoHBAKS8TMe2iuAmaxN1MUA== X-Received: by 2002:a50:c35d:0:b0:557:183b:9028 with SMTP id q29-20020a50c35d000000b00557183b9028mr8478edb.65.1704374819165; Thu, 04 Jan 2024 05:26:59 -0800 (PST) Received: from smtpclient.apple ([132.69.236.92]) by smtp.gmail.com with ESMTPSA id ef7-20020a05640228c700b00556cf2545desm2249504edb.16.2024.01.04.05.26.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jan 2024 05:26:58 -0800 (PST) Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) Subject: Re: [PATCH 1/2] mm/tlb: fix fullmm semantics From: Nadav Amit In-Reply-To: Date: Thu, 4 Jan 2024 15:26:43 +0200 Cc: Will Deacon , Aneesh Kumar K V , Andrew Morton , Nick Piggin , Peter Zijlstra , Catalin Marinas , Paul Walmsley , Palmer Dabbelt , Albert Ou , Arnd Bergmann , linux-arch@vger.kernel.org, linux-mm , linux-arm-kernel@lists.infradead.org, Linux Kernel Mailing List , linux-riscv@lists.infradead.org, Nadav Amit , Andrea Arcangeli , Andy Lutomirski , Dave Hansen , Thomas Gleixner , Yu Zhao , the arch/x86 maintainers Message-Id: <0468E994-273E-4A8B-A521-150723DA9774@broadcom.com> References: <20231228084642.1765-1-jszhang@kernel.org> <20231228084642.1765-2-jszhang@kernel.org> <204B6410-2EFA-462B-9DF7-64CC5F1D3AD2@broadcom.com> To: Jisheng Zhang X-Mailer: Apple Mail (2.3774.300.61.1.2) Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Stat-Signature: goapcgz6cqfqszikzufeydnkt56hq91h X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: AB16240017 X-Rspam-User: X-HE-Tag: 1704374820-433112 X-HE-Meta: U2FsdGVkX1+AA1Np3XmpRfJFqdLdlgL+3xuUqh5mNb9XvtFs7nqxzST46UGcRHTgpYUMW9XMK/fYAcifObb4X3Cb3J76jhl/8AiF+ii1U0TOe/B4NtLm31Wryof26ud3fFSHd4BhZWm9wYCnpOX5Wr8K98oaX0tUEsZB5cGund0JWrj7aapk+gwRqZqkwz7JHaZcLP/zFXLF54MHGmBwgiCbUqW+iMXorY/YGohP1fct1SHcK2AGzGaD3iCeKFKQJa4EgkxiaDWchWslkiRe28b1t+/mp07C1BamoedbgdBilake2IWw7DGwbMPuO71amPGOoRCLuG3NSjDGisk1wKc91pgLBTHH3APVSV62CRJ3B0kWp4gHRa/YIEtiiod4sTmohfmeMP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, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: > On Jan 2, 2024, at 4:41=E2=80=AFAM, Jisheng Zhang wr= ote: >=20 > On Sat, Dec 30, 2023 at 11:54:02AM +0200, Nadav Amit wrote: >=20 >>=20 >> My knowledge of arm64 is a bit limited, but the code does not seem >> to match the comment, so if it is correct (which I strongly doubt), >> the comment should be updated. >=20 > will do if the above change is accepted by arm64 Jisheng, I expected somebody with arm64 knowledge to point it out, and maybe I am wrong, but I really don=E2=80=99t understand something about the correctness, if you can please explain. In the following code: --- a/arch/arm64/include/asm/tlb.h +++ b/arch/arm64/include/asm/tlb.h @@ -62,7 +62,10 @@ static inline void tlb_flush(struct mmu_gather *tlb) * invalidating the walk-cache, since the ASID allocator won't * reallocate our ASID without invalidating the entire TLB. */ - if (tlb->fullmm) { + if (tlb->fullmm) + return; You skip flush if fullmm is on. But if page-tables are freed, you may want to flush immediately and not wait for ASID to be freed to avoid speculative page walks; these walks at least on x86 caused a mess. No? --=20 This electronic communication and the information and any files transmitted= =20 with it, or attached to it, are confidential and are intended solely for=20 the use of the individual or entity to whom it is addressed and may contain= =20 information that is confidential, legally privileged, protected by privacy= =20 laws, or otherwise restricted from disclosure to anyone else. If you are=20 not the intended recipient or the person responsible for delivering the=20 e-mail to the intended recipient, you are hereby notified that any use,=20 copying, distributing, dissemination, forwarding, printing, or copying of= =20 this e-mail is strictly prohibited. If you received this e-mail in error,= =20 please return the e-mail to the sender, delete it from your computer, and= =20 destroy any printed copy of it.