Re: [PATCH] integrity: powerpc: Do not select CA_MACHINE_KEYRING

2023-09-11 Thread Nayna
On 9/7/23 13:32, Michal Suchánek wrote: Adding more CC's from the original patch, looks like get_maintainers is not that great for this file. On Thu, Sep 07, 2023 at 06:52:19PM +0200, Michal Suchanek wrote: No other platform needs CA_MACHINE_KEYRING, either. This is policy that should be

Re: [syzbot] [kernel?] general protection fault in arch_tlbbatch_flush

2023-09-11 Thread syzbot
syzbot has bisected this issue to: commit 75c400f82d347af1307010a3e06f3aa5d831d995 Author: Alistair Popple Date: Wed Jul 19 12:18:44 2023 + mmu_notifiers: call invalidate_range() when invalidating TLBs bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=14bd6d0c68 start

Re: [PATCH] ASoC: fsl: imx-pcm-rpmsg: Add SNDRV_PCM_INFO_BATCH flag

2023-09-11 Thread Mark Brown
On Mon, 11 Sep 2023 14:38:07 +0800, Shengjiu Wang wrote: > The rpmsg pcm device is a device which should support > double buffering. > > Found this issue with pipewire. When there is no > SNDRV_PCM_INFO_BATCH flag in driver, the pipewire will > set headroom to be zero, and because rpmsg pcm

Re: [PATCH v7 0/3 RESEND] generic and PowerPC SED Opal keystore

2023-09-11 Thread Jens Axboe
On 9/8/23 9:30 AM, gjo...@linux.vnet.ibm.com wrote: > From: Greg Joyce > > This patchset extends the capabilites incorporated into for-6.6/block > (https://git.kernel.dk/cgit/linux/commit/?h=for-6.6/block=3bfeb61256643281ac4be5b8a57e9d9da3db4335) > by allowing the SED Opal key to be seeded into

[PATCH v1 04/19] powerpc: Remove pte_ERROR()

2023-09-11 Thread Christophe Leroy
pte_ERROR() is used neither in powerpc code nor in common mm code. Remove it. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/pgtable.h | 3 --- arch/powerpc/include/asm/book3s/64/pgtable.h | 2 -- arch/powerpc/include/asm/nohash/32/pgtable.h | 3 ---

[PATCH v1 19/19] powerpc/nohash: Refactor __ptep_set_access_flags()

2023-09-11 Thread Christophe Leroy
nohash/32 version of __ptep_set_access_flags() does the same as nohash/64 version, the only difference is that nohash/32 version is more complete and uses pte_update(). Make it common and remove the nohash/64 version. Signed-off-by: Christophe Leroy ---

[PATCH v1 13/19] powerpc/nohash: Refactor checking of no-change in pte_update()

2023-09-11 Thread Christophe Leroy
On nohash/64, a few callers of pte_update() check if there is really a change in order to avoid an unnecessary write. Refactor that inside pte_update(). Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/64/pgtable.h | 9 - arch/powerpc/include/asm/nohash/pgtable.h

[PATCH v1 02/19] powerpc/64e: Fix wrong test in __ptep_test_and_clear_young()

2023-09-11 Thread Christophe Leroy
Commit 45201c879469 ("powerpc/nohash: Remove hash related code from nohash headers.") replaced: if ((pte_val(*ptep) & (_PAGE_ACCESSED | _PAGE_HASHPTE)) == 0) return 0; By: if (pte_young(*ptep)) return 0; But it should be: if (!pte_young(*ptep)) return 0; Fix it.

[PATCH v1 06/19] powerpc: Refactor update_mmu_cache_range()

2023-09-11 Thread Christophe Leroy
On nohash, this function voids except for E500 with hugepages. Take the book3s version and include that exception in the logic and rename E500 update_mmu_cache_range() as __update_mmu_cache() which gets called by update_mmu_cache_range(). Signed-off-by: Christophe Leroy ---

[PATCH v1 07/19] powerpc: Untangle fixmap.h and pgtable.h and mmu.h

2023-09-11 Thread Christophe Leroy
fixmap.h need pgtable.h for [un]map_kernel_page() pgtable.h need fixmap.h for FIXADDR_TOP. Untangle the two files by moving FIXADDR_TOP into pgtable.h Also move VIRT_IMMR_BASE to fixmap.h to avoid fixmap.h in mmu.h Signed-off-by: Christophe Leroy ---

[PATCH v1 17/19] powerpc/nohash: Deduplicate ptep_set_wrprotect() and ptep_get_and_clear()

2023-09-11 Thread Christophe Leroy
ptep_set_wrprotect() and ptep_get_and_clear are identical for nohash/32 and nohash/64. Make them common. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgtable.h | 16 arch/powerpc/include/asm/nohash/64/pgtable.h | 15 ---

[PATCH v1 10/19] powerpc/nohash: Move 8xx version of pte_update() into pte-8xx.h

2023-09-11 Thread Christophe Leroy
No point in having 8xx special pte_update() in common header, move it into pte-8xx.h Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgtable.h | 57 +--- arch/powerpc/include/asm/nohash/32/pte-8xx.h | 57 2 files changed, 58

[PATCH v1 01/19] powerpc/8xx: Fix pte_access_permitted() for PAGE_NONE

2023-09-11 Thread Christophe Leroy
On 8xx, PAGE_NONE is handled by setting _PAGE_NA instead of clearing _PAGE_USER. But then pte_user() returns 1 also for PAGE_NONE. As _PAGE_NA prevent reads, add a specific version of pte_read() that returns 0 when _PAGE_NA is set instead of always returning 1. Fixes: 351750331fc1 ("powerpc/mm:

[PATCH v1 16/19] powerpc/nohash: Refactor ptep_test_and_clear_young()

2023-09-11 Thread Christophe Leroy
Remove ptep_test_and_clear_young() macro, make __ptep_test_and_clear_young() common to nohash/32 and nohash/64 and change it to become ptep_test_and_clear_young() Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgtable.h | 11 ---

[PATCH v1 03/19] powerpc/40x: Remove stale PTE_ATOMIC_UPDATES macro

2023-09-11 Thread Christophe Leroy
40x TLB handlers were reworked by commit 2c74e2586bb9 ("powerpc/40x: Rework 40x PTE access and TLB miss") to not require PTE_ATOMIC_UPDATES anymore. Then commit 4e1df545e2fa ("powerpc/pgtable: Drop PTE_ATOMIC_UPDATES") removed all code related to PTE_ATOMIC_UPDATES. Remove left over

[PATCH v1 14/19] powerpc/nohash: Deduplicate _PAGE_CHG_MASK

2023-09-11 Thread Christophe Leroy
_PAGE_CHG_MASK is identical between nohash/32 and nohash/64, deduplicate it. While at it, clean the #ifdef for PTE_RPN_MASK in nohash/32 as it is already CONFIG_PPC32. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgtable.h | 8 +---

[PATCH v1 15/19] powerpc/nohash: Deduplicate pte helpers

2023-09-11 Thread Christophe Leroy
Deduplicate following helpers that are identical on nohash/32 and nohash/64: pte_mkwrite_novma() pte_mkdirty() pte_mkyoung() pte_wrprotect() pte_mkexec() pte_young() Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgtable.h | 36

[PATCH v1 08/19] powerpc/nohash: Remove {pte/pmd}_protnone()

2023-09-11 Thread Christophe Leroy
Only book3s/64 selects ARCH_SUPPORTS_NUMA_BALANCING so CONFIG_NUMA_BALANCING can't be selected on nohash targets. Remove pte_protnone() and pmd_protnone(). Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/pgtable.h | 17 - 1 file changed, 17 deletions(-)

[PATCH v1 09/19] powerpc/nohash: Refactor declaration of {map/unmap}_kernel_page()

2023-09-11 Thread Christophe Leroy
map_kernel_page() and unmap_kernel_page() have the same prototypes on nohash/32 and nohash/64, keep only one declaration. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgtable.h | 8 arch/powerpc/include/asm/nohash/64/pgtable.h | 2 --

[PATCH v1 05/19] powerpc: Deduplicate prototypes of ptep_set_access_flags() and phys_mem_access_prot()

2023-09-11 Thread Christophe Leroy
Prototypes of ptep_set_access_flags() and phys_mem_access_prot() are identical for book3s and nohash. Deduplicate them. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/pgtable.h | 9 - arch/powerpc/include/asm/nohash/pgtable.h | 10 --

[PATCH v1 11/19] powerpc/nohash: Replace #ifdef CONFIG_44x by IS_ENABLED(CONFIG_44x) in pgtable.h

2023-09-11 Thread Christophe Leroy
No need of a #ifdef, use IS_ENABLED(CONFIG_44x) Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgtable.h | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/nohash/32/pgtable.h

[PATCH v1 12/19] powerpc/nohash: Refactor pte_update()

2023-09-11 Thread Christophe Leroy
pte_update() is similar. Take the nohash/32 version which works on nohash/64 and add the debug call to assert_pte_locked() which is only on nohash/64. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgtable.h | 33 ---

[PATCH v1 00/19] cleanup/refactor pgtable.h

2023-09-11 Thread Christophe Leroy
This series is a cleanup of pgtable.h for nohash mainly Main purpose is to refactor a lot of common code between nohash/32 and nohash/64. This series is a prerequisite for following series that will rework PAGE flags and implement execute-only protection. Christophe Leroy (19): powerpc/8xx:

[PATCH v1 18/19] powerpc/nohash: Refactor pte_clear()

2023-09-11 Thread Christophe Leroy
pte_clear() are doing the same on nohash/32 and nohash/64, Keep the static inline version of nohash/64, make it common and remove the macro version of nohash/32. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgtable.h | 3 ---

Re: (subset) [PATCH 00/11] add missing of_node_put

2023-09-11 Thread Mark Brown
On Thu, 07 Sep 2023 11:55:10 +0200, Julia Lawall wrote: > Add of_node_put on a break out of an of_node loop. > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [10/11] ASoC: rsnd: add missing of_node_put commit:

Re: [PATCH v3 2/5] fbdev: Replace fb_pgprotect() with fb_pgprot_device()

2023-09-11 Thread Thomas Zimmermann
Am 11.09.23 um 16:19 schrieb Christophe Leroy: Le 11/09/2023 à 15:08, Thomas Zimmermann a écrit : Rename the fbdev mmap helper fb_pgprotect() to pgprot_framebuffer(). The helper sets VMA page-access flags for framebuffers in device I/O memory. Also clean up the helper's parameters and

Re: [PATCH v3 2/5] fbdev: Replace fb_pgprotect() with fb_pgprot_device()

2023-09-11 Thread Christophe Leroy
Le 11/09/2023 à 15:08, Thomas Zimmermann a écrit : > Rename the fbdev mmap helper fb_pgprotect() to pgprot_framebuffer(). > The helper sets VMA page-access flags for framebuffers in device I/O > memory. > > Also clean up the helper's parameters and return value. Instead of > the VMA instance,

Re: [RFC PATCH] powerpc: Make crashing cpu to be discovered first in kdump kernel.

2023-09-11 Thread Pingfan Liu
Hi Mahesh, I am not quite sure about fdt, so I skip that part, and leave some comments from the kexec view. On Thu, Sep 7, 2023 at 1:59 AM Mahesh Salgaonkar wrote: > > The kernel boot parameter 'nr_cpus=' allows one to specify number of > possible cpus in the system. In the normal scenario the

[PATCHv6 3/3] powerpc/setup: alloc extra paca_ptrs to hold boot_cpuid

2023-09-11 Thread Pingfan Liu
paca_ptrs should be large enough to hold the boot_cpuid, hence, its lower boundary is set to the bigger one between boot_cpuid+1 and nr_cpus. On the other hand, some kernel component: -1. the timer assumes cpu0 online since the timer_list->flags subfield 'TIMER_CPUMASK' is zero if not initialized

[PATCHv6 2/3] powerpc/setup: Handle the case when boot_cpuid greater than nr_cpus

2023-09-11 Thread Pingfan Liu
If the boot_cpuid is smaller than nr_cpus, it requires extra effort to ensure the boot_cpu is in cpu_present_mask. This can be achieved by reserving the last quota for the boot cpu. Note: the restriction on nr_cpus will be lifted with more effort in the next patch Signed-off-by: Pingfan Liu Cc:

[PATCHv6 1/3] powerpc/setup: Loosen the mapping between cpu logical id and its seq in dt

2023-09-11 Thread Pingfan Liu
*** Idea *** For kexec -p, the boot cpu can be not the cpu0, this may waste plenty of room when of allocating memory for paca_ptrs[]. However, in theory, there is no requirement to assign cpu's logical id as its present sequence in the device tree. But there is something like

[PATCHv6 0/3] enable nr_cpus for powerpc

2023-09-11 Thread Pingfan Liu
Since my last v4 [1], the code has undergone great changes. The paca[] array has been reorganized and indexed by paca_ptrs[], which dramatically decreases the memory consumption even if there are many unpresent cpus in the middle. However, reordering the logical cpu numbers can further decrease

[PATCH v3 2/5] fbdev: Replace fb_pgprotect() with fb_pgprot_device()

2023-09-11 Thread Thomas Zimmermann
Rename the fbdev mmap helper fb_pgprotect() to pgprot_framebuffer(). The helper sets VMA page-access flags for framebuffers in device I/O memory. Also clean up the helper's parameters and return value. Instead of the VMA instance, pass the individial parameters separately: existing page-access

[PATCH v3 4/5] arch/powerpc: Remove file parameter from phys_mem_access_prot code

2023-09-11 Thread Thomas Zimmermann
Remove 'file' parameter from struct machdep_calls.phys_mem_access_prot and its implementation in pci_phys_mem_access_prot(). The file is not used on PowerPC. By removing it, a later patch can simplify fbdev's mmap code, which uses phys_mem_access_prot() on PowerPC. Signed-off-by: Thomas

[PATCH v3 0/5] ppc, fbdev: Clean up fbdev mmap helper

2023-09-11 Thread Thomas Zimmermann
Clean up and rename fb_pgprotect() to work without struct file. Then refactor the implementation for PowerPC. This change has been discussed at [1] in the context of refactoring fbdev's mmap code. The first two patches update fbdev and replace fbdev's fb_pgprotect() with pgprot_framebuffer() on

[PATCH v3 3/5] arch/powerpc: Remove trailing whitespaces

2023-09-11 Thread Thomas Zimmermann
Fix coding style. No functional changes. Signed-off-by: Thomas Zimmermann --- arch/powerpc/include/asm/machdep.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index

[PATCH v3 5/5] arch/powerpc: Call internal __phys_mem_access_prot() in fbdev code

2023-09-11 Thread Thomas Zimmermann
Call __phys_mem_access_prot() from the fbdev mmap helper pgprot_framebuffer(). Allows to avoid the file argument of NULL. Signed-off-by: Thomas Zimmermann --- arch/powerpc/include/asm/fb.h | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/powerpc/include/asm/fb.h

[PATCH v3 1/5] fbdev: Avoid file argument in fb_pgprotect()

2023-09-11 Thread Thomas Zimmermann
Only PowerPC's fb_pgprotect() needs the file argument, although the implementation does not use it. Pass NULL to the internal helper in preparation of further updates. A later patch will remove the file parameter from fb_pgprotect(). While at it, replace the shift operation with PHYS_PFN().

Re: [PATCH v2 2/3] vmcore: allow fadump to export vmcore even if is_kdump_kernel() is false

2023-09-11 Thread Baoquan He
On 09/11/23 at 05:13pm, Michael Ellerman wrote: > Hari Bathini writes: > > Currently, is_kdump_kernel() returns true when elfcorehdr_addr is set. > > While elfcorehdr_addr is set for kexec based kernel dump mechanism, > > alternate dump capturing methods like fadump [1] also set it to export > >

[PATCH] powerpc: add `cur_cpu_spec` symbol to vmcoreinfo

2023-09-11 Thread Aditya Gupta
Presently, while reading a vmcore, makedumpfile uses `cur_cpu_spec.mmu_features` to decide whether the crashed system had RADIX MMU or not. Currently, makedumpfile fails to get the `cur_cpu_spec` symbol (unless a vmlinux is passed with the `-x` flag to makedumpfile), and hence assigns offsets and

[PATCH] ASoC: fsl: imx-pcm-rpmsg: Add SNDRV_PCM_INFO_BATCH flag

2023-09-11 Thread Shengjiu Wang
The rpmsg pcm device is a device which should support double buffering. Found this issue with pipewire. When there is no SNDRV_PCM_INFO_BATCH flag in driver, the pipewire will set headroom to be zero, and because rpmsg pcm device don't support residue report, when the latency setting is small,

Re: [PATCH] tty: hvc: remove set but unused variable

2023-09-11 Thread Jiri Slaby
On 08. 09. 23, 8:17, Bo Liu wrote: The local variable vdev in hvcs_destruct_port() is set but not used. Remove the variable and related code. Signed-off-by: Bo Liu Reviewed-by: Jiri Slaby -- js suse labs

Re: [PATCH v2 2/3] vmcore: allow fadump to export vmcore even if is_kdump_kernel() is false

2023-09-11 Thread Michael Ellerman
Hari Bathini writes: > Currently, is_kdump_kernel() returns true when elfcorehdr_addr is set. > While elfcorehdr_addr is set for kexec based kernel dump mechanism, > alternate dump capturing methods like fadump [1] also set it to export > the vmcore. Since, is_kdump_kernel() is used to restrict