Re: [PATCH 5/9] dt-bindings: dma: Convert fsl,elo*-dma bindings to YAML

2025-02-04 Thread J . Neuschäfer
On Fri, Jan 31, 2025 at 04:16:07PM -0600, Rob Herring wrote: > On Fri, Jan 31, 2025 at 8:03 AM J. Neuschäfer wrote: > > > > On Sun, Jan 26, 2025 at 10:47:35PM -0600, Rob Herring wrote: > > > On Sun, Jan 26, 2025 at 07:59:00PM +0100, J. Neuschäfer wrote: > > > > The devicetree bindings for Freescal

[PATCH V2] mm/ptdump: Drop GENERIC_PTDUMP

2025-02-04 Thread Anshuman Khandual
GENERIC_PTDUMP does not guard any code but instead just used for platform's subscription into core ptdump defined under PTDUMP_CORE, which is selected. Instead use PTDUMP_CORE for platform subscription and drop GENERIC_PTDUMP. Cc: Catalin Marinas Cc: Will Deacon Cc: Jonathan Corbet Cc: Marc Zyn

Re: kexec failing with KVM on Power8 baremetal host

2025-02-04 Thread Madhavan Srinivasan
On 2/5/25 12:35 AM, Stefan Berger wrote: > I bisected Linux between 6.13.0 and 6.12.0 due to failing kexec on a Power8 > baremetal host on 6.13.0: > Can you please attach your config, also i cant recreate this host. Maddy > 8fec58f503b296af87ffca3898965e3054f2b616 is the first bad commit >

Re: [PATCH v3 5/9] powerpc: Use preempt_model_str().

2025-02-04 Thread Christophe Leroy
Le 04/02/2025 à 09:22, Sebastian Andrzej Siewior a écrit : Use preempt_model_str() instead of manually conducting the preemption model. Use pr_emerg() instead of printk() to pass a loglevel. Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: Naveen N

Re: [PATCH v2 1/3] powerpc/time: Export boot_tb and log initial timebase at boot

2025-02-04 Thread Christophe Leroy
Le 04/02/2025 à 07:39, Kajol Jain a écrit : From: Aboorva Devarajan - Export `boot_tb` for external use, this is useful in perf vpa-dtl interface, where `boot_tb` can be used to convert raw timebase values to it's relative boot timestamp. A modification of boot_tb can be catastrophic

[PATCH] powerpc/perf: Fix ref-counting on the PMU 'vpa_pmu'

2025-02-04 Thread Vaibhav Jain
Commit 176cda0619b6 ("powerpc/perf: Add perf interface to expose vpa counters") introduced 'vpa_pmu' to expose Book3s-HV nested APIv2 provided L1<->L2 context switch latency counters to L1 user-space via perf-events. However the newly introduced PMU named 'vpa_pmu' doesn't assign ownership of the P

[PATCH] powerpc: mpic: Use str_enabled_disabled() helper function

2025-02-04 Thread Thorsten Blum
Remove hard-coded strings by using the str_enabled_disabled() helper function. Use pr_debug() instead of printk(KERN_DEBUG) to silence a checkpatch warning. Signed-off-by: Thorsten Blum --- arch/powerpc/sysdev/mpic.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arc

[PATCH v3 5/9] powerpc: Use preempt_model_str().

2025-02-04 Thread Sebastian Andrzej Siewior
Use preempt_model_str() instead of manually conducting the preemption model. Use pr_emerg() instead of printk() to pass a loglevel. Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: Naveen N Rao Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Sebastian

[PATCH v3 01/18] x86/vdso: Fix latent bug in vclock_pages calculation

2025-02-04 Thread Thomas Weißschuh
The vclock pages are *after* the non-vclock pages. Currently there are both two vclock and two non-vclock pages so the existing logic works by accident. As soon as the number of pages changes it will break however. This will be the case with the introduction of the generic vDSO data storage. Use a

[PATCH v3 10/18] LoongArch: vDSO: Switch to generic storage implementation

2025-02-04 Thread Thomas Weißschuh
The generic storage implementation provides the same features as the custom one. However it can be shared between architectures, making maintenance easier. Co-developed-by: Nam Cao Signed-off-by: Nam Cao Signed-off-by: Thomas Weißschuh --- arch/loongarch/Kconfig | 2 +

[PATCH v3 02/18] parisc: Remove unused symbol vdso_data

2025-02-04 Thread Thomas Weißschuh
The symbol vdso_data is and has been unused. Remove it. Signed-off-by: Thomas Weißschuh --- arch/parisc/include/asm/vdso.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/parisc/include/asm/vdso.h b/arch/parisc/include/asm/vdso.h index 2a2dc11b5545fc642a7ae4596dc174111433e948..5f581c1

[PATCH v3 00/18] vDSO: Introduce generic data storage

2025-02-04 Thread Thomas Weißschuh
Currently each architecture defines the setup of the vDSO data page on its own, mostly through copy-and-paste from some other architecture. Extend the existing generic vDSO implementation to also provide generic data storage. This removes duplicated code and paves the way for further changes to the

[PATCH v3 04/18] vdso: Rename included Makefile

2025-02-04 Thread Thomas Weißschuh
As the Makefile is included into other Makefiles it can not be used to define objects to be built from the current source directory. However the generic datastore will introduce such a local source file. Rename the included Makefile so it is clear how it is to be used and to make room for a regular

[PATCH v3 11/18] arm: vdso: Switch to generic storage implementation

2025-02-04 Thread Thomas Weißschuh
The generic storage implementation provides the same features as the custom one. However it can be shared between architectures, making maintenance easier. Co-developed-by: Nam Cao Signed-off-by: Nam Cao Signed-off-by: Thomas Weißschuh --- arch/arm/include/asm/vdso.h | 2 ++ arch

[PATCH v3 03/18] vdso: Introduce vdso/align.h

2025-02-04 Thread Thomas Weißschuh
The vDSO implementation can only include headers from the vdso/ namespace. To enable the usage of the ALIGN() macro from the vDSO, move linux/align.h to vdso/align.h wholly. As the only dependency linux/const.h is only a wrapper around vdso/const.h anyways adapt that dependency. Also provide a com

[PATCH v3 06/18] vdso: Add generic random data storage

2025-02-04 Thread Thomas Weißschuh
Extend the generic vDSO data storage with a page for the random state data. The random state data is stored in a dedicated page, as the existing storage page is only meant for time-related, time-namespace-aware data. This simplifies to access logic to not need to handle time namespaces anymore and

[PATCH v3 08/18] arm64: vdso: Switch to generic storage implementation

2025-02-04 Thread Thomas Weißschuh
The generic storage implementation provides the same features as the custom one. However it can be shared between architectures, making maintenance easier. This switch also moves the random state data out of the time data page. The currently used hardcoded __VDSO_RND_DATA_OFFSET does not take into

[PATCH v3 07/18] vdso: Add generic architecture-specific data storage

2025-02-04 Thread Thomas Weißschuh
Some architectures need to architecture-specific data to the vDSO. Enable the generic vDSO storage mechanism to both store and map this data. Some architectures require more than a single page, like LoongArch, so prepare for that usecase, too. Signed-off-by: Thomas Weißschuh --- arch/Kconfig

[PATCH v3 05/18] vdso: Add generic time data storage

2025-02-04 Thread Thomas Weißschuh
Historically each architecture defined their own way to store the vDSO data page. Add a generic mechanism to provide storage for that page. Furthermore this generic storage will be extended to also provide uniform storage for *non*-time-related data, like the random state or architecture-specific

[PATCH v3 15/18] x86/vdso: Switch to generic storage implementation

2025-02-04 Thread Thomas Weißschuh
The generic storage implementation provides the same features as the custom one. However it can be shared between architectures, making maintenance easier. This switch also moves the random state data out of the time data page. The currently used hardcoded __VDSO_RND_DATA_OFFSET does not take into

[PATCH v3 09/18] riscv: vdso: Switch to generic storage implementation

2025-02-04 Thread Thomas Weißschuh
The generic storage implementation provides the same features as the custom one. However it can be shared between architectures, making maintenance easier. Co-developed-by: Nam Cao Signed-off-by: Nam Cao Signed-off-by: Thomas Weißschuh --- arch/riscv/Kconfig |

[PATCH v3 12/18] s390/vdso: Switch to generic storage implementation

2025-02-04 Thread Thomas Weißschuh
The generic storage implementation provides the same features as the custom one. However it can be shared between architectures, making maintenance easier. Co-developed-by: Nam Cao Signed-off-by: Nam Cao Signed-off-by: Thomas Weißschuh Acked-by: Heiko Carstens --- arch/s390/Kconfig

[PATCH v3 16/18] x86/vdso/vdso2c: Remove page handling

2025-02-04 Thread Thomas Weißschuh
The values are not used anymore. Also the sanity checks performed by vdso2c can never trigger as they only validate invariants already enforced by the linker script. Signed-off-by: Thomas Weißschuh --- arch/x86/entry/vdso/vdso-layout.lds.S | 4 arch/x86/entry/vdso/vdso2c.c | 21 --

[PATCH v3 18/18] vdso: Remove remnants of architecture-specific time storage

2025-02-04 Thread Thomas Weißschuh
All users of the random vDSO are using the generic storage implementation. Remove the now unnecessary compatibility accessor functions and symbols. Co-developed-by: Nam Cao Signed-off-by: Nam Cao Signed-off-by: Thomas Weißschuh --- include/asm-generic/vdso/vsyscall.h | 20 +++ incl

[PATCH v3 14/18] powerpc/vdso: Switch to generic storage implementation

2025-02-04 Thread Thomas Weißschuh
The generic storage implementation provides the same features as the custom one. However it can be shared between architectures, making maintenance easier. Co-developed-by: Nam Cao Signed-off-by: Nam Cao Signed-off-by: Thomas Weißschuh --- arch/powerpc/Kconfig | 2 +

[PATCH v3 13/18] MIPS: vdso: Switch to generic storage implementation

2025-02-04 Thread Thomas Weißschuh
The generic storage implementation provides the same features as the custom one. However it can be shared between architectures, making maintenance easier. Co-developed-by: Nam Cao Signed-off-by: Nam Cao Signed-off-by: Thomas Weißschuh --- arch/mips/Kconfig | 1 + arch

[PATCH v3 17/18] vdso: Remove remnants of architecture-specific random state storage

2025-02-04 Thread Thomas Weißschuh
All users of the random vDSO are using the generic storage implementation. Remove the now unnecessary compatibility accessor functions and symbols. Co-developed-by: Nam Cao Signed-off-by: Nam Cao Signed-off-by: Thomas Weißschuh --- include/asm-generic/vdso/vsyscall.h | 5 - include/vdso/da

Re: [PATCH 2/2] powerpc/fadump: fix additional param memory reservation for HASH MMU

2025-02-04 Thread Avnish Chouhan
On 2025-02-04 11:57, Hari Bathini wrote: On 04/02/25 10:58 am, Avnish Chouhan wrote: On 2025-01-31 20:44, Hari Bathini wrote: On 23/01/25 7:54 pm, Avnish Chouhan wrote: On 2025-01-23 15:26, Hari Bathini wrote: On 20/01/25 11:05 pm, Sourabh Jain wrote: Commit 683eab94da75bc ("powerpc/fadump: s

Re: [PATCH 5/9] dt-bindings: dma: Convert fsl,elo*-dma bindings to YAML

2025-02-04 Thread J . Neuschäfer
On Wed, Jan 29, 2025 at 05:52:31PM -0500, Frank Li wrote: > On Sun, Jan 26, 2025 at 07:59:00PM +0100, J. Neuschäfer wrote: > > The devicetree bindings for Freescale DMA engines have so far existed as > > a text file. This patch converts them to YAML, and specifies all the > > compatible strings cur

[PATCH v7 00/20] fs/dax: Fix ZONE_DEVICE page reference counts

2025-02-04 Thread Alistair Popple
Main updates since v6: - Clean ups and fixes based on feedback from David and Dan. - Rebased from next-20241216 to v6.14-rc1. No conflicts. - Dropped the PTE bit removals and clean-ups - will post this as a separate series to be merged after this one as Dan wanted it split up more and t

[PATCH v7 01/20] fuse: Fix dax truncate/punch_hole fault path

2025-02-04 Thread Alistair Popple
FS DAX requires file systems to call into the DAX layout prior to unlinking inodes to ensure there is no ongoing DMA or other remote access to the direct mapped page. The fuse file system implements fuse_dax_break_layouts() to do this which includes a comment indicating that passing dmap_end == 0 l

[PATCH v7 12/20] mm/memory: Enhance insert_page_into_pte_locked() to create writable mappings

2025-02-04 Thread Alistair Popple
In preparation for using insert_page() for DAX, enhance insert_page_into_pte_locked() to handle establishing writable mappings. Recall that DAX returns VM_FAULT_NOPAGE after installing a PTE which bypasses the typical set_pte_range() in finish_fault. Signed-off-by: Alistair Popple Suggested-by:

[PATCH v7 20/20] device/dax: Properly refcount device dax pages when mapping

2025-02-04 Thread Alistair Popple
Device DAX pages are currently not reference counted when mapped, instead relying on the devmap PTE bit to ensure mapping code will not get/put references. This requires special handling in various page table walkers, particularly GUP, to manage references on the underlying pgmap to ensure the page

[PATCH v7 04/20] fs/dax: Refactor wait for dax idle page

2025-02-04 Thread Alistair Popple
A FS DAX page is considered idle when its refcount drops to one. This is currently open-coded in all file systems supporting FS DAX. Move the idle detection to a common function to make future changes easier. Signed-off-by: Alistair Popple Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Re

[PATCH v7 05/20] fs/dax: Create a common implementation to break DAX layouts

2025-02-04 Thread Alistair Popple
Prior to freeing a block file systems supporting FS DAX must check that the associated pages are both unmapped from user-space and not undergoing DMA or other access from eg. get_user_pages(). This is achieved by unmapping the file range and scanning the FS DAX page-cache to see if any pages within

[PATCH v7 08/20] fs/dax: Remove PAGE_MAPPING_DAX_SHARED mapping flag

2025-02-04 Thread Alistair Popple
The page ->mapping pointer can have magic values like PAGE_MAPPING_DAX_SHARED and PAGE_MAPPING_ANON for page owner specific usage. Currently PAGE_MAPPING_DAX_SHARED and PAGE_MAPPING_ANON alias to the same value. This isn't a problem because FS DAX pages are never seen by the anonymous mapping code

[PATCH v7 06/20] fs/dax: Always remove DAX page-cache entries when breaking layouts

2025-02-04 Thread Alistair Popple
Prior to any truncation operations file systems call dax_break_mapping() to ensure pages in the range are not under going DMA. Later DAX page-cache entries will be removed by truncate_folio_batch_exceptionals() in the generic page-cache code. However this makes it possible for folios to be removed

[PATCH v7 07/20] fs/dax: Ensure all pages are idle prior to filesystem unmount

2025-02-04 Thread Alistair Popple
File systems call dax_break_mapping() prior to reallocating file system blocks to ensure the page is not undergoing any DMA or other accesses. Generally this is needed when a file is truncated to ensure that if a block is reallocated nothing is writing to it. However filesystems currently don't cal

[PATCH v7 03/20] fs/dax: Don't skip locked entries when scanning entries

2025-02-04 Thread Alistair Popple
Several functions internal to FS DAX use the following pattern when trying to obtain an unlocked entry: xas_for_each(&xas, entry, end_idx) { if (dax_is_locked(entry)) entry = get_unlocked_entry(&xas, 0); This is problematic because get_unlocked_entry() will get the next pr

[PATCH v7 09/20] mm/gup: Remove redundant check for PCI P2PDMA page

2025-02-04 Thread Alistair Popple
PCI P2PDMA pages are not mapped with pXX_devmap PTEs therefore the check in __gup_device_huge() is redundant. Remove it Signed-off-by: Alistair Popple Reviewed-by: Jason Gunthorpe Reviewed-by: Dan Wiliams Acked-by: David Hildenbrand --- mm/gup.c | 5 - 1 file changed, 5 deletions(-) diff

[PATCH v7 02/20] fs/dax: Return unmapped busy pages from dax_layout_busy_page_range()

2025-02-04 Thread Alistair Popple
dax_layout_busy_page_range() is used by file systems to scan the DAX page-cache to unmap mapping pages from user-space and to determine if any pages in the given range are busy, either due to ongoing DMA or other get_user_pages() usage. Currently it checks to see the file mapping is mapped into us

[PATCH v7 11/20] mm: Allow compound zone device pages

2025-02-04 Thread Alistair Popple
Zone device pages are used to represent various type of device memory managed by device drivers. Currently compound zone device pages are not supported. This is because MEMORY_DEVICE_FS_DAX pages are the only user of higher order zone device pages and have their own page reference counting. A futu

[PATCH v7 13/20] mm/memory: Add vmf_insert_page_mkwrite()

2025-02-04 Thread Alistair Popple
Currently to map a DAX page the DAX driver calls vmf_insert_pfn. This creates a special devmap PTE entry for the pfn but does not take a reference on the underlying struct page for the mapping. This is because DAX page refcounts are treated specially, as indicated by the presence of a devmap entry.

[PATCH v7 16/20] huge_memory: Add vmf_insert_folio_pmd()

2025-02-04 Thread Alistair Popple
Currently DAX folio/page reference counts are managed differently to normal pages. To allow these to be managed the same as normal pages introduce vmf_insert_folio_pmd. This will map the entire PMD-sized folio and take references as it would for a normally mapped page. This is distinct from the cu

[PATCH v7 14/20] rmap: Add support for PUD sized mappings to rmap

2025-02-04 Thread Alistair Popple
The rmap doesn't currently support adding a PUD mapping of a folio. This patch adds support for entire PUD mappings of folios, primarily to allow for more standard refcounting of device DAX folios. Currently DAX is the only user of this and it doesn't require support for partially mapped PUD-sized

[PATCH v7 10/20] mm/mm_init: Move p2pdma page refcount initialisation to p2pdma

2025-02-04 Thread Alistair Popple
Currently ZONE_DEVICE page reference counts are initialised by core memory management code in __init_zone_device_page() as part of the memremap() call which driver modules make to obtain ZONE_DEVICE pages. This initialises page refcounts to 1 before returning them to the driver. This was presumabl

[PATCH v7 18/20] dcssblk: Mark DAX broken, remove FS_DAX_LIMITED support

2025-02-04 Thread Alistair Popple
From: Dan Williams The dcssblk driver has long needed special case supoprt to enable limited dax operation, so called CONFIG_FS_DAX_LIMITED. This mode works around the incomplete support for ZONE_DEVICE on s390 by forgoing the ability of dax-mapped pages to support GUP. Now, pending cleanups to

[PATCH v7 19/20] fs/dax: Properly refcount fs dax pages

2025-02-04 Thread Alistair Popple
Currently fs dax pages are considered free when the refcount drops to one and their refcounts are not increased when mapped via PTEs or decreased when unmapped. This requires special logic in mm paths to detect that these pages should not be properly refcounted, and to detect when the refcount drop

[PATCH v7 17/20] mm/gup: Don't allow FOLL_LONGTERM pinning of FS DAX pages

2025-02-04 Thread Alistair Popple
Longterm pinning of FS DAX pages should already be disallowed by various pXX_devmap checks. However a future change will cause these checks to be invalid for FS DAX pages so make folio_is_longterm_pinnable() return false for FS DAX pages. Signed-off-by: Alistair Popple Reviewed-by: John Hubbard

[PATCH v7 15/20] huge_memory: Add vmf_insert_folio_pud()

2025-02-04 Thread Alistair Popple
Currently DAX folio/page reference counts are managed differently to normal pages. To allow these to be managed the same as normal pages introduce vmf_insert_folio_pud. This will map the entire PUD-sized folio and take references as it would for a normally mapped page. This is distinct from the cu

Re: [PATCH 6/9] dt-bindings: pci: Add fsl,mpc83xx-pcie bindings

2025-02-04 Thread J . Neuschäfer
On Sun, Jan 26, 2025 at 10:50:04PM -0600, Rob Herring wrote: > On Sun, Jan 26, 2025 at 07:59:01PM +0100, J. Neuschäfer wrote: > > Supplement Documentation/devicetree/bindings/pci/fsl,pci.txt with a more > > formal binding in YAML format. > > > > Signed-off-by: J. Neuschäfer > > --- [...] > > +tit

Re: [PATCH 6/9] dt-bindings: pci: Add fsl,mpc83xx-pcie bindings

2025-02-04 Thread J . Neuschäfer
On Wed, Jan 29, 2025 at 05:55:26PM -0500, Frank Li wrote: > On Sun, Jan 26, 2025 at 07:59:01PM +0100, J. Neuschäfer wrote: > > Supplement Documentation/devicetree/bindings/pci/fsl,pci.txt with a more > > formal binding in YAML format. > > > > Signed-off-by: J. Neuschäfer > > --- > > .../devicetre

Re: [PATCH v7 02/20] fs/dax: Return unmapped busy pages from dax_layout_busy_page_range()

2025-02-04 Thread Balbir Singh
On 2/5/25 09:47, Alistair Popple wrote: > dax_layout_busy_page_range() is used by file systems to scan the DAX > page-cache to unmap mapping pages from user-space and to determine if > any pages in the given range are busy, either due to ongoing DMA or > other get_user_pages() usage. > > Currently

Re: [PATCH v7 01/20] fuse: Fix dax truncate/punch_hole fault path

2025-02-04 Thread Balbir Singh
On 2/5/25 09:47, Alistair Popple wrote: > FS DAX requires file systems to call into the DAX layout prior to unlinking > inodes to ensure there is no ongoing DMA or other remote access to the > direct mapped page. The fuse file system implements > fuse_dax_break_layouts() to do this which includes a

Re: [PATCH] powerpc: mpic: Use str_enabled_disabled() helper function

2025-02-04 Thread Ricardo B . Marlière
On Tue Feb 4, 2025 at 12:44 PM -03, Thorsten Blum wrote: > Remove hard-coded strings by using the str_enabled_disabled() helper > function. > > Use pr_debug() instead of printk(KERN_DEBUG) to silence a checkpatch > warning. > > Signed-off-by: Thorsten Blum Reviewed-by: Ricardo B. Marlière > ---

Re: [PATCH v6 23/26] mm: Remove pXX_devmap callers

2025-02-04 Thread Dan Williams
Alistair Popple wrote: > On Tue, Jan 14, 2025 at 10:50:49AM -0800, Dan Williams wrote: > > Alistair Popple wrote: > > > The devmap PTE special bit was used to detect mappings of FS DAX > > > pages. This tracking was required to ensure the generic mm did not > > > manipulate the page reference count

kexec failing with KVM on Power8 baremetal host

2025-02-04 Thread Stefan Berger
I bisected Linux between 6.13.0 and 6.12.0 due to failing kexec on a Power8 baremetal host on 6.13.0: 8fec58f503b296af87ffca3898965e3054f2b616 is the first bad commit commit 8fec58f503b296af87ffca3898965e3054f2b616 Author: Ritesh Harjani (IBM) Date: Fri Oct 18 22:59:50 2024 +0530 book3s6

[PATCH] powerpc64/ftrace: fix module loading without patchable function entries

2025-02-04 Thread Anthony Iliopoulos
get_stubs_size assumes that there must always be at least one patchable function entry, which is not always the case (modules that export data but no code), otherwise it returns -ENOEXEC and thus the section header sh_size is set to that value. During module_memory_alloc() the size is passed to exe