[PATCH v5 13/13] mm: pgtable: remove pte_offset_map_nolock()

2024-09-25 Thread Qi Zheng
Now no users are using the pte_offset_map_nolock(), remove it. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Acked-by: David Hildenbrand --- Documentation/mm/split_page_table_lock.rst | 3 --- include/linux/mm.h | 2 -- mm/pgtable-generic.c |

[PATCH v5 12/13] mm: multi-gen LRU: walk_pte_range() use pte_offset_map_rw_nolock()

2024-09-25 Thread Qi Zheng
In walk_pte_range(), we may modify the pte entry after holding the ptl, so convert it to using pte_offset_map_rw_nolock(). At this time, the pte_same() check is not performed after the ptl held, so we should get pmdval and do pmd_same() check to ensure the stability of pmd entry. Signed-off-by: Qi

[PATCH v5 11/13] mm: userfaultfd: move_pages_pte() use pte_offset_map_rw_nolock()

2024-09-25 Thread Qi Zheng
In move_pages_pte(), we may modify the dst_pte and src_pte after acquiring the ptl, so convert it to using pte_offset_map_rw_nolock(). But since we will use pte_same() to detect the change of the pte entry, there is no need to get pmdval, so just pass a dummy variable to it. Signed-off-by: Qi Zhen

[PATCH v5 10/13] mm: page_vma_mapped_walk: map_pte() use pte_offset_map_rw_nolock()

2024-09-25 Thread Qi Zheng
In the caller of map_pte(), we may modify the pvmw->pte after acquiring the pvmw->ptl, so convert it to using pte_offset_map_rw_nolock(). At this time, the pte_same() check is not performed after the pvmw->ptl held, so we should get pmdval and do pmd_same() check to ensure the stability of pvmw->pm

[PATCH v5 09/13] mm: mremap: move_ptes() use pte_offset_map_rw_nolock()

2024-09-25 Thread Qi Zheng
In move_ptes(), we may modify the new_pte after acquiring the new_ptl, so convert it to using pte_offset_map_rw_nolock(). Now new_pte is none, so hpage_collapse_scan_file() path can not find this by traversing file->f_mapping, so there is no concurrency with retract_page_tables(). In addition, we a

[PATCH v5 08/13] mm: copy_pte_range() use pte_offset_map_rw_nolock()

2024-09-25 Thread Qi Zheng
In copy_pte_range(), we may modify the src_pte entry after holding the src_ptl, so convert it to using pte_offset_map_rw_nolock(). Since we already hold the exclusive mmap_lock, and the copy_pte_range() and retract_page_tables() are using vma->anon_vma to be exclusive, so the PTE page is stable, th

[PATCH v5 07/13] mm: khugepaged: collapse_pte_mapped_thp() use pte_offset_map_rw_nolock()

2024-09-25 Thread Qi Zheng
In collapse_pte_mapped_thp(), we may modify the pte and pmd entry after acquring the ptl, so convert it to using pte_offset_map_rw_nolock(). At this time, the pte_same() check is not performed after the PTL held. So we should get pgt_pmd and do pmd_same() check after the ptl held. Signed-off-by: Q

[PATCH v5 06/13] mm: handle_pte_fault() use pte_offset_map_rw_nolock()

2024-09-25 Thread Qi Zheng
In handle_pte_fault(), we may modify the vmf->pte after acquiring the vmf->ptl, so convert it to using pte_offset_map_rw_nolock(). But since we will do the pte_same() check, so there is no need to get pmdval to do pmd_same() check, just pass a dummy variable to it. Signed-off-by: Qi Zheng Acked-b

[PATCH v5 05/13] arm: adjust_pte() use pte_offset_map_rw_nolock()

2024-09-25 Thread Qi Zheng
In do_adjust_pte(), we may modify the pte entry. The corresponding pmd entry may have been modified concurrently. Therefore, in order to ensure the stability if pmd entry, use pte_offset_map_rw_nolock() to replace pte_offset_map_nolock(), and do pmd_same() check after holding the PTL. All callers

[PATCH v5 04/13] mm: khugepaged: __collapse_huge_page_swapin() use pte_offset_map_ro_nolock()

2024-09-25 Thread Qi Zheng
In __collapse_huge_page_swapin(), we just use the ptl for pte_same() check in do_swap_page(). In other places, we directly use pte_offset_map_lock(), so convert it to using pte_offset_map_ro_nolock(). Signed-off-by: Qi Zheng Acked-by: David Hildenbrand Reviewed-by: Muchun Song --- mm/khugepage

[PATCH v5 03/13] mm: filemap: filemap_fault_recheck_pte_none() use pte_offset_map_ro_nolock()

2024-09-25 Thread Qi Zheng
In filemap_fault_recheck_pte_none(), we just do pte_none() check, so convert it to using pte_offset_map_ro_nolock(). Signed-off-by: Qi Zheng Acked-by: David Hildenbrand Reviewed-by: Muchun Song --- mm/filemap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/filemap.

[PATCH v5 02/13] powerpc: assert_pte_locked() use pte_offset_map_ro_nolock()

2024-09-25 Thread Qi Zheng
In assert_pte_locked(), we just get the ptl and assert if it was already held, so convert it to using pte_offset_map_ro_nolock(). Signed-off-by: Qi Zheng Acked-by: David Hildenbrand Reviewed-by: Muchun Song --- arch/powerpc/mm/pgtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

[PATCH v5 01/13] mm: pgtable: introduce pte_offset_map_{ro|rw}_nolock()

2024-09-25 Thread Qi Zheng
Currently, the usage of pte_offset_map_nolock() can be divided into the following two cases: 1) After acquiring PTL, only read-only operations are performed on the PTE page. In this case, the RCU lock in pte_offset_map_nolock() will ensure that the PTE page will not be freed, and there is no

[PATCH v5 00/13] introduce pte_offset_map_{ro|rw}_nolock()

2024-09-25 Thread Qi Zheng
Changes in v5: - directly pass pmdvalp to __pte_offset_map() in pte_offset_map_rw_nolock() (Muchun Song) - fix the problem of the reference of folio and the mm counter in [PATCH v4 07/13] (Muchun Song) - directly pass pmdvalp to pte_offset_map_rw_nolock() in map_pte() (Muchun Song) - c

Re: [PATCH v5 00/11] KVM: PPC: Nested APIv2 guest support

2024-09-25 Thread Vaibhav Jain
Hi Michal, Michal Suchánek writes: > Hello, > > are there any machines on which this is supposed to work? > > On a 9105-22A with ML1050_fw1050.20 (78) and On 9105-22A you need atleast: Firmware level: FW1060.10 > Linux 6.11.0-lp155.4.gce149d2-default I get: Kernel version is fine. ATM anythi

Re: [PATCH v4 14/16] modules: Support extended MODVERSIONS info

2024-09-25 Thread Matthew Maurer
Thanks for the catch. I've sent up v5 to include that fix. I've also added a changelog and made sure the patches make it to linux-modules@ as Daniel suggested. On Wed, Sep 25, 2024 at 4:00 PM Sami Tolvanen wrote: > > Hi Matt, > > On Tue, Sep 24, 2024 at 09:19:56PM +, Matthew Maurer wrote: >

[PATCH v5 14/16] modules: Support extended MODVERSIONS info

2024-09-25 Thread Matthew Maurer
Adds a new format for MODVERSIONS which stores each field in a separate ELF section. This initially adds support for variable length names, but could later be used to add additional fields to MODVERSIONS in a backwards compatible way if needed. Any new fields will be ignored by old user tooling, un

Re: [PATCH] powerpc/vdso: allow r30 in vDSO code generation of getrandom

2024-09-25 Thread Jason A. Donenfeld
On Wed, Sep 25, 2024 at 08:48:31PM +0200, Christophe Leroy wrote: > > > Le 25/09/2024 à 20:38, Jason A. Donenfeld a écrit : > > On Wed, Sep 25, 2024 at 07:50:22PM +0200, Jason A. Donenfeld wrote: > >> For gettimeofday, -ffixed-r30 was passed to work around a bug in Go > >> code, where the vDSO tr

Re: [PATCH v4 14/16] modules: Support extended MODVERSIONS info

2024-09-25 Thread Sami Tolvanen
Hi Matt, On Tue, Sep 24, 2024 at 09:19:56PM +, Matthew Maurer wrote: > +static void dedotify_ext_version_names(char *str_seq, unsigned long size) > +{ > + unsigned long out = 0; > + unsigned long in; > + char last = '\0'; > + > + for (in = 0; in < size; in++) { > +

[PATCH 5/5] [RFC] mm: Remove MAP_UNINITIALIZED support

2024-09-25 Thread Arnd Bergmann
From: Arnd Bergmann MAP_UNINITIALIZED was added back in 2009 for NOMMU kernels, specifically for blackfin, which is long gone. MAP_HUGE_SHIFT/MAP_HUGE_MASK were added in 2012 for architectures supporting hugepages, which at the time did not overlap with the ones supporting NOMMU. Adding the macr

[PATCH 4/5] asm-generic: use asm-generic/mman-common.h on parisc and alpha

2024-09-25 Thread Arnd Bergmann
From: Arnd Bergmann These two architectures each have their own set of MAP_* flags, like powerpc, mips and others do. In addition, the msync() flags are also different, here both define the same flags but in a different order. Finally, alpha also has a custom MADV_DONTNEED flag for madvise. Make

[PATCH 3/5] asm-generic: use asm-generic/mman-common.h on mips and xtensa

2024-09-25 Thread Arnd Bergmann
From: Arnd Bergmann mips and xtensa have almost the same asm/mman.h, aside from an unintentional difference in MAP_UNINITIALIZED that has no effect in practice. Now that the MAP_* flags are moved out of asm-generic/mman-common.h, the only difference from the its contents and the mips/xtensa vers

[PATCH 2/5] asm-generic: move MAP_* flags from mman-common.h to mman.h

2024-09-25 Thread Arnd Bergmann
From: Arnd Bergmann powerpc and sparc include asm-generic/mman-common.h to get the MAP_* flags 0x008000 through 0x400, but those flags are all different on alpha, mips, parisc and xtensa. Add duplicate definitions for these along with the MAP_* flags for 0x100 through 0x4000 that are already

[PATCH 1/5] asm-generic: cosmetic updates to uapi/asm/mman.h

2024-09-25 Thread Arnd Bergmann
From: Arnd Bergmann All but four architectures use asm-generic/mman-common.h, and the differences between these are mostly accidental. Rearrange them slightly to make it possible to 'vimdiff' them to see the actual relevant differences: - Move MADV_HWPOISON/MADV_SOFT_OFFLINE to the end of the l

[PATCH 0/5] asm-generic: clean up asm/mman.h

2024-09-25 Thread Arnd Bergmann
From: Arnd Bergmann While thinking about the changes to linux/mman.h in https://lore.kernel.org/all/20240923141943.133551-1-vincenzo.frasc...@arm.com/ I ended up trying to clean up the duplicate definitions in order to better see what's in there, and then I found a clash between two MAP_* flags.

Re: [PATCH] powerpc/vdso: allow r30 in vDSO code generation of getrandom

2024-09-25 Thread Christophe Leroy
Le 25/09/2024 à 20:38, Jason A. Donenfeld a écrit : On Wed, Sep 25, 2024 at 07:50:22PM +0200, Jason A. Donenfeld wrote: For gettimeofday, -ffixed-r30 was passed to work around a bug in Go code, where the vDSO trampoline forgot to save and restore this register across function calls. But Go re

Re: [PATCH] powerpc/vdso: allow r30 in vDSO code generation of getrandom

2024-09-25 Thread Jason A. Donenfeld
On Wed, Sep 25, 2024 at 07:50:22PM +0200, Jason A. Donenfeld wrote: > For gettimeofday, -ffixed-r30 was passed to work around a bug in Go > code, where the vDSO trampoline forgot to save and restore this register > across function calls. But Go requires a different trampoline for every > call, and

Re: [GIT PULL] Please pull powerpc/linux.git powerpc-6.12-2 tag

2024-09-25 Thread pr-tracker-bot
The pull request you sent on Wed, 25 Sep 2024 20:30:08 +1000: > https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git > tags/powerpc-6.12-2 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/4ffc45808373e32112500756d6f02fe56c42f371 Thank you! -- Deet-doot-d

[PATCH] powerpc/vdso: allow r30 in vDSO code generation of getrandom

2024-09-25 Thread Jason A. Donenfeld
For gettimeofday, -ffixed-r30 was passed to work around a bug in Go code, where the vDSO trampoline forgot to save and restore this register across function calls. But Go requires a different trampoline for every call, and there's no reason that new Go code needs to be broken and add more bugs. So

Re: [PATCH v5 00/11] KVM: PPC: Nested APIv2 guest support

2024-09-25 Thread Michal Suchánek
On Thu, Sep 14, 2023 at 01:05:49PM +1000, Jordan Niethe wrote: > > A nested-HV API for PAPR has been developed based on the KVM-specific > nested-HV API that is upstream in Linux/KVM and QEMU. The PAPR API had > to break compatibility to accommodate implementation in other > hypervisors and partit

[PATCH AUTOSEL 6.6 126/139] powerpc/pseries: Use correct data types from pseries_hp_errorlog struct

2024-09-25 Thread Sasha Levin
From: Haren Myneni [ Upstream commit b76e0d4215b6b622127ebcceaa7f603313ceaec4 ] _be32 type is defined for some elements in pseries_hp_errorlog struct but also used them u32 after be32_to_cpu() conversion. Example: In handle_dlpar_errorlog() hp_elog->_drc_u.drc_index = be32_to_cpu(hp_elog->_drc_

[PATCH AUTOSEL 6.10 178/197] powerpc/pseries: Use correct data types from pseries_hp_errorlog struct

2024-09-25 Thread Sasha Levin
From: Haren Myneni [ Upstream commit b76e0d4215b6b622127ebcceaa7f603313ceaec4 ] _be32 type is defined for some elements in pseries_hp_errorlog struct but also used them u32 after be32_to_cpu() conversion. Example: In handle_dlpar_errorlog() hp_elog->_drc_u.drc_index = be32_to_cpu(hp_elog->_drc_

[PATCH AUTOSEL 6.11 221/244] powerpc/pseries: Use correct data types from pseries_hp_errorlog struct

2024-09-25 Thread Sasha Levin
From: Haren Myneni [ Upstream commit b76e0d4215b6b622127ebcceaa7f603313ceaec4 ] _be32 type is defined for some elements in pseries_hp_errorlog struct but also used them u32 after be32_to_cpu() conversion. Example: In handle_dlpar_errorlog() hp_elog->_drc_u.drc_index = be32_to_cpu(hp_elog->_drc_

Re: [PATCH] ASoC: fsl: Use maple tree register cache

2024-09-25 Thread Daniel Baluta
On Tue, Sep 24, 2024 at 4:59 PM Mark Brown wrote: > > Several of the NXP drivers use regmaps with a rbtree register cache. Since > the maple tree cache is uisng a generally more modern data structure which > makes implementation choices more suitable for modern systems let's convert > these driver

[GIT PULL] Please pull powerpc/linux.git powerpc-6.12-2 tag

2024-09-25 Thread Michael Ellerman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hi Linus, Please pull a couple of powerpc fixes for 6.12: The following changes since commit 3a7101e9b27fe97240c2fd430c71e61262447dd1: Merge tag 'powerpc-6.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux (2024-09-19 08:03:

[PATCH v4 7/7] ASoC: fsl_easrc: register m2m platform device

2024-09-25 Thread Shengjiu Wang
Register m2m platform device,that user can use M2M feature. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_easrc.c | 33 +++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c index a1a7a90ff5ef..

[PATCH v4 6/7] ASoC: fsl_asrc: register m2m platform device

2024-09-25 Thread Shengjiu Wang
Register m2m platform device, that user can use M2M feature. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_asrc.c | 37 + 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index b1b35954f7ac

[PATCH v4 5/7] ASoC: fsl_asrc_m2m: Add memory to memory function

2024-09-25 Thread Shengjiu Wang
Implement the ASRC memory to memory function using the compress framework, user can use this function with compress ioctl interface. This feature can be shared by ASRC and EASRC drivers Signed-off-by: Shengjiu Wang --- sound/soc/fsl/Kconfig | 1 + sound/soc/fsl/Makefile |

[PATCH v4 4/7] ASoC: fsl_easrc: define functions for memory to memory usage

2024-09-25 Thread Shengjiu Wang
ASRC can be used on memory to memory case, define several functions for m2m usage and export them as function pointer. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_easrc.c | 228 ++ sound/soc/fsl/fsl_easrc.h | 4 + 2 files changed, 232 insertions(+) d

[PATCH v4 3/7] ASoC: fsl_asrc: define functions for memory to memory usage

2024-09-25 Thread Shengjiu Wang
ASRC can be used on memory to memory case, define several functions for m2m usage. m2m_prepare: prepare for the start step m2m_start: the start step m2m_unprepare: unprepare for stop step, optional m2m_stop: stop step m2m_check_format: check format is supported or not m2m_calc_out_len: calculate o

[PATCH v4 2/7] ALSA: compress: Add output rate and output format support

2024-09-25 Thread Shengjiu Wang
Add 'pcm_format' for struct snd_codec, add 'pcm_formats' for struct snd_codec_desc, these are used for accelerator usage. Current accelerator example is sample rate converter (SRC). Define struct snd_codec_desc_src for descript minmum and maxmum sample rates. And add 'src_d' in union snd_codec_opt

[PATCH v4 0/7] ASoC: fsl: add memory to memory function for ASRC

2024-09-25 Thread Shengjiu Wang
This function is base on the accelerator implementation for compress API: https://patchwork.kernel.org/project/alsa-devel/patch/20240731083843.59911-1-pe...@perex.cz/ Add it to this patch set. Audio signal processing also has the requirement for memory to memory similar as Video. This asrc memory

[PATCH v4 1/7] ALSA: compress_offload: introduce accel operation mode

2024-09-25 Thread Shengjiu Wang
From: Jaroslav Kysela There is a requirement to expose the audio hardware that accelerates various tasks for user space such as sample rate converters, compressed stream decoders, etc. This is description for the API extension for the compress ALSA API which is able to handle "tasks" that are no