From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 021373246F5; Tue, 11 Nov 2025 13:06:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762866393; cv=none; b=rIw/Zzli9dpzekIhskdkrOION/uadSKCRGmUxyrBbocoPKQ6TLZsJgFwB9ovAKqaZVZt+CzSrblzuFFXQcuxJvp9KCOh0JAsVWDiUa7aK8A5s+B6g+XWm5ToHEcoa0QJq64n+Wo7YYNKjlotukNAOSj3OHSv/XUz1GOsHLjnAuY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762866393; c=relaxed/simple; bh=ahDE0Hde9+gZsnP0JCOLdJBo8hGroTd4JJCH/jgFj/0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=pcyFDvhd5C3pJgGaufhpTbLBW+xIlW3dgzZmEuqgiIf5efj9EIHHpzh9qAnFz12H4YF4BWm9mJ41ePu1U0SqUyQLT4DLUY1FSR6G3tKjBo3dS+JcYx86/h5BssdVHxdSuIj4gRnyq5WwDuyecfnLjFN9lblKk2idScNaSwhwvY0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Tg0OtVLz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Tg0OtVLz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6E9AC16AAE; Tue, 11 Nov 2025 13:06:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762866392; bh=ahDE0Hde9+gZsnP0JCOLdJBo8hGroTd4JJCH/jgFj/0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Tg0OtVLz3wAXRZo7tCvWTInHjKpVK4LV67NTO+lYAZ/bR93jyG2IyFgcvsue4SRjB 0h8QMWesGpk3qXoW3f/y5g5hNGaIhpu5ZvQWDGwHfLvH2QohrLgDnSv/T7XK5D98wL z5paZ8OThivObxShM274wdwZcvtkA9PuAU6b+qI29fKv1akghKWsQ9OqLPjtgfb1tU 4dhW8r72DwTtl22M6htocWaDV7hTEh5uNlGrHZ2wikbz5TAqNJgsCaWZxjg5IGzZHl e2ra3fX+DjamK0ohLsg2Y80OH6UCT/oI2TuutGRfJ5NWGrLux815QwhhypwuSp+iZj JUT65tT6i+w6g== Message-ID: <6c7c5f86-a9d5-4b7e-aa08-968077f66ace@kernel.org> Date: Tue, 11 Nov 2025 14:06:10 +0100 Precedence: bulk X-Mailing-List: linux-s390@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 02/16] mm: introduce leaf entry type and use to simplify leaf entry logic To: Zi Yan , Lorenzo Stoakes Cc: Andrew Morton , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Alexander Gordeev , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Sven Schnelle , Peter Xu , Alexander Viro , Christian Brauner , Jan Kara , Arnd Bergmann , Baolin Wang , "Liam R . Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Muchun Song , Oscar Salvador , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Matthew Brost , Joshua Hahn , Rakie Kim , Byungchul Park , Gregory Price , Ying Huang , Alistair Popple , Axel Rasmussen , Yuanchu Xie , Wei Xu , Kemeng Shi , Kairui Song , Nhat Pham , Baoquan He , Chris Li , SeongJae Park , Matthew Wilcox , Jason Gunthorpe , Leon Romanovsky , Xu Xin , Chengming Zhou , Jann Horn , Miaohe Lin , Naoya Horiguchi , Pedro Falcato , Pasha Tatashin , Rik van Riel , Harry Yoo , Hugh Dickins , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-s390@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, damon@lists.linux.dev References: From: "David Hildenbrand (Red Hat)" Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 11.11.25 04:25, Zi Yan wrote: > On 10 Nov 2025, at 17:21, Lorenzo Stoakes wrote: > >> The kernel maintains leaf page table entries which contain either: >> >> - Nothing ('none' entries) >> - Present entries (that is stuff the hardware can navigate without fault) > > This is not true for: > > 1. pXX_protnone(), where _PAGE_PROTNONE flag also means pXX_present() is > true, but hardware would still trigger a fault. > 2. pmd_present() where _PAGE_PSE also means a present PMD (see the comment > in pmd_present()). I'll note that pte_present/pmd_present etc is always about "soft-present". For example, if the hardware does not have a hw-managed access bit, doing a pte_mkyoung() would also clear the hw-valid/hw-present bit because we have to catch any next access done by hardware. [fun fact: some hardware has an invalid bit instead of a valid/present bit :) IIRC s390x falls into that category] Similar things happen on ordinary PROT_NONE of course (independent of pte_protnone). A better description might be "there is a page/pfn mapped here, but it might not be accessible by the CPU right now". We have device-exclusive/device-private nonswap (before this series) entries that fall into the same category, unfortunately ("there is something mapped there that is not accessible by the CPU") -- Cheers David