From nobody Wed Feb 11 03:03:47 2026 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 3DF5120F98A for ; Thu, 23 Jan 2025 13:28:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737638912; cv=none; b=BBFEks0Vpiyh93ESGi7tMGYvtxVwfJ3njOAFRhRj2ER4+vItxoFLHBNRz1F1071Xcpzq/uIPV37PYWqmV16nfTCujjqmK2fBGA3o57LsxClrAYPu56qr7s+ECdYQHxXft/7P4nmTI+fXG/Cz5zjyZvrcGcF/myBFu3+vQC4dXcA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737638912; c=relaxed/simple; bh=FefxEocj4IoJjXKARUpJHCYOj+T2Zg9VgaSRz05BYQU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mYdvpaHgI6vIi0mSri35W3V6Nyq99x7Dm5Zs8O38qwnqkuPxWlczlPh1Af9yeKCkgAcGbVIW4i2fWjlR0hPyi27l/mXWyDY09dMQ+VmTM9NkwNCQs5l54ld2SWqp18KFA+sUIgbXh7K1CMgAZkEZm4B69n0/KQz0dzB0e3sYLt0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=PebiQot1; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="PebiQot1" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-21680814d42so14534575ad.2 for ; Thu, 23 Jan 2025 05:28:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1737638908; x=1738243708; 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; bh=nDJpscd5iDH1/vb94JK69W34zwsdKCnkCWvmFoEl4dc=; b=PebiQot1rb6XbHbzslfJsKpQcKPxtVRWfvW44wiTQeZcn+FPb2jW/MNDRjdLx6k8br 3442zb+LePJbf/eefreQDFW5bpNEpafOYF7xTQDkFXzsr+9Bbcpie1mckFpTKNXbUxAr Icdp3NKqYa9Vu8Wy47GHD4CXfEBFbujZ9DFs8y3+Ee7kHhTyn5o/FFBAmrU4zOwkWyZc UZMf6AHZ7e+UDvM9vymXCA7cWG/T++ephvUmyUCJnhiL5wmVftKMsdQMTigMvTqGAuvF KJdGHNU6mSbcLgett1i/pz5tgCxaiRDhYCZ2Zoc3DkRyqRYo7Vzi3ggEu7/h0YFGZxgr qcLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737638908; x=1738243708; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nDJpscd5iDH1/vb94JK69W34zwsdKCnkCWvmFoEl4dc=; b=EGqZOC3T2cv47E9ob/7pSk1LA1a2d+y423yszBJ5Bxaae7WWGd+gcg3CIMSeHflU2H qAH0E4mLsuF22ghx7+mw1z6qNVyQTX570HEBBOigaPk9Gqc3ELweUYiN0E2qpgvOYNQo 6At1f6C5IQ3NW3EgM1e9053AS9Q41HzD2j1hbQbLmuAVyS8IhP0vHkm5nL7jpMkNlqgO vBae1vVW2fr52EV84LepEy0SmpOtLIgyI81sNWOnlNNBcGhiO+iKZ/LU6T+y6yv9nGsT VffptU8muBKsZkPjrc57JEVSwVdb1mC2P/zIwuWC08sK8DkkZ5jakE7RYtA2+0uyNPmc DHOA== X-Forwarded-Encrypted: i=1; AJvYcCWKfSP7OK43672kw7AbrE3NC0c8dM72cNYkEbaeadFuu3vorzMClkM9tQliSWA3GCQx/YWls0/9kPUqifk=@vger.kernel.org X-Gm-Message-State: AOJu0Yz3YcbzuiCUgezt2Hy1WdYkrk2we9/R+rI7FQzA9cG83vczUy9T bVTwXv6b7m/8FVn0mqKVl5WaYEKo5IQ6kmRl2bZRuNFjntcnVaAM404zIH/5mTw= X-Gm-Gg: ASbGncvqFaF3qFpbxbaKVqv1cKjfjcO5kLxO/c1A7/HSCNclMluH0CUxS7btH0OQYmH cXUaYss97T4+qOfjLdjy2MEhdr4OCvFGlgWCa0KLLLR+PSJlxYeEF5Syv3ejeP0zT+4kgEUcrKQ pKpOagyOc8ifKxooj+MF70FdwAAMgJDoAyKo9QV+aFcE+ZoSHskKPMGEXOukXSCDtGlycNxBKjD QECicbUjWKene1I7m/C6GeLUXUMpGG2LbOrRpNzBSFA3AuYDeYxK9WdszcbymMKZMJPf443A0fG 3A+FYCYsUehhPtdsZkAw7IETHV3wITqK6rMA9HDs7BA7 X-Google-Smtp-Source: AGHT+IGvH4jPt9gEk2i8wJlEQCGHtq7Z8F/nhrt9cHdxqXKECEeUfNk2qVC/Ig+lLuwaqRjslO9WHQ== X-Received: by 2002:a17:902:da8d:b0:216:386e:dd8 with SMTP id d9443c01a7336-21c3540cd05mr367659545ad.17.1737638908563; Thu, 23 Jan 2025 05:28:28 -0800 (PST) Received: from C02DW0BEMD6R.bytedance.net ([63.216.146.178]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3ac3e2sm111583655ad.139.2025.01.23.05.28.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2025 05:28:28 -0800 (PST) From: Qi Zheng To: peterz@infradead.org, kevin.brodsky@arm.com, riel@surriel.com, vishal.moola@gmail.com, david@redhat.com, jannh@google.com, hughd@google.com, willy@infradead.org, yuzhao@google.com, muchun.song@linux.dev, akpm@linux-foundation.org, will@kernel.org, aneesh.kumar@kernel.org, npiggin@gmail.com, arnd@arndb.de, dave.hansen@linux.intel.com, rppt@kernel.org, alexghiti@rivosinc.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-um@lists.infradead.org, x86@kernel.org, linux-riscv@lists.infradead.org, Qi Zheng Subject: [PATCH 1/5] mm: pgtable: make generic tlb_remove_table() use struct ptdesc Date: Thu, 23 Jan 2025 21:26:14 +0800 Message-Id: X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: References: 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" Now only arm will call tlb_remove_ptdesc()/tlb_remove_table() when CONFIG_MMU_GATHER_TABLE_FREE is disabled. In this case, the type of the table parameter is actually struct ptdesc * instead of struct page *. Since struct ptdesc still overlaps with struct page and has not been separated from it, forcing the table parameter to struct page * will not cause any problems at this time. But this is definitely incorrect and needs to be fixed. So just like the generic __tlb_remove_table(), let generic tlb_remove_table() use struct ptdesc by default when CONFIG_MMU_GATHER_TABLE_FREE is disabled. Signed-off-by: Qi Zheng --- include/asm-generic/tlb.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h index e402aef79c93e..10cdbe0e7adfe 100644 --- a/include/asm-generic/tlb.h +++ b/include/asm-generic/tlb.h @@ -228,10 +228,10 @@ static inline void tlb_remove_page(struct mmu_gather = *tlb, struct page *page); */ static inline void tlb_remove_table(struct mmu_gather *tlb, void *table) { - struct page *page =3D (struct page *)table; + struct ptdesc *ptdesc =3D (struct ptdesc *)table; =20 - pagetable_dtor(page_ptdesc(page)); - tlb_remove_page(tlb, page); + pagetable_dtor(ptdesc); + tlb_remove_page(tlb, ptdesc_page(ptdesc)); } #endif /* CONFIG_MMU_GATHER_TABLE_FREE */ =20 --=20 2.20.1