Re: kexec verbose dumps with 6.8 [was: [PATCH v4 1/7] kexec_file: add kexec_file flag to control debug printing]

2024-03-13 Thread Baoquan He
On 03/13/24 at 06:58am, Jiri Slaby wrote: > Hi, > > > On 13. 03. 24, 1:48, Baoquan He wrote: > > Hi Jiri, > > > > On 03/12/24 at 10:58am, Jiri Slaby wrote: > > > On 13. 12. 23, 6:57, Baoquan He wrote: > > ... snip... > > > > --- a/include/linux/kexec.h > > > > +++ b/include/linux/kexec.h > > >

[PATCH] KVM: PPC: Book3S HV nestedv2: Cancel pending HDEC exception

2024-03-13 Thread Vaibhav Jain
This reverts commit 180c6b072bf360b686e53d893d8dcf7dbbaec6bb ("KVM: PPC: Book3S HV nestedv2: Do not cancel pending decrementer exception") which prevented cancelling a pending HDEC exception for nestedv2 KVM guests. It was done to avoid overhead of a H_GUEST_GET_STATE hcall to read the 'HDEC expiry

Re: [PATCH 00/14] Add support for suppressing warning backtraces

2024-03-13 Thread Dan Carpenter
Thanks! Acked-by: Dan Carpenter regards, dan carpenter

Re: [PATCH net v5 1/2] soc: fsl: qbman: Always disable interrupts when taking cgr_lock

2024-03-13 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net.git (main) by David S. Miller : On Mon, 11 Mar 2024 12:38:29 -0400 you wrote: > smp_call_function_single disables IRQs when executing the callback. To > prevent deadlocks, we must disable IRQs when taking cgr_lock elsewhere. > This is already done by q

Re: [PATCH v10 08/12] powerpc: mm: Replace p{u,m,4}d_is_leaf with p{u,m,4}_leaf

2024-03-13 Thread Christophe Leroy
Hi, Le 13/03/2024 à 05:21, Rohan McLure a écrit : > Replace occurrences of p{u,m,4}d_is_leaf with p{u,m,4}_leaf, as the > latter is the name given to checking that a higher-level entry in > multi-level paging contains a page translation entry (pte) throughout > all other archs. There's already an

Re: [PATCH v10 09/12] powerpc: mm: Add common pud_pfn stub for all platforms

2024-03-13 Thread Christophe Leroy
Le 13/03/2024 à 05:21, Rohan McLure a écrit : > Prior to this commit, pud_pfn was implemented with BUILD_BUG as the inline > function for 64-bit Book3S systems but is never included, as its > invocations in generic code are guarded by calls to pud_devmap which return > zero on such systems. A fut

Re: [PATCH v10 10/12] poweprc: mm: Implement *_user_accessible_page() for ptes

2024-03-13 Thread Christophe Leroy
Le 13/03/2024 à 05:21, Rohan McLure a écrit : > Page table checking depends on architectures providing an > implementation of p{te,md,ud}_user_accessible_page. With > refactorisations made on powerpc/mm, the pte_access_permitted() and > similar methods verify whether a userland page is accessible

Re: [PATCH v10 11/12] powerpc: mm: Use set_pte_at_unchecked() for early-boot / internal usages

2024-03-13 Thread Christophe Leroy
Le 13/03/2024 à 05:21, Rohan McLure a écrit : > In the new set_ptes() API, set_pte_at() (a special case of set_ptes()) > is intended to be instrumented by the page table check facility. There > are however several other routines that constitute the API for setting > page table entries, including

Re: [RFC PATCH 3/3] pseries/iommu: Enable DDW for VFIO TCE create

2024-03-13 Thread Michael Ellerman
Hi Shivaprasad, Shivaprasad G Bhat writes: > The commit 9d67c9433509 ("powerpc/iommu: Add \"borrowing\" > iommu_table_group_ops") implemented the "borrow" mechanism for > the pSeries SPAPR TCE. It did implement this support partially > that it left out creating the DDW if not present already. > >

Re: [PATCH] powerpc: Implement set_memory_rox()

2024-03-13 Thread Michael Ellerman
On Fri, 16 Feb 2024 11:12:05 +0100, Christophe Leroy wrote: > Same as x86 and s390, add set_memory_rox() to avoid doing > one pass with set_memory_ro() and a second pass with set_memory_x(). > > See commit 60463628c9e0 ("x86/mm: Implement native set_memory_rox()") > and commit 22e99fa56443 ("s390/

Re: [PATCH] powerpc: Use user_mode() macro when possible

2024-03-13 Thread Michael Ellerman
On Fri, 16 Feb 2024 11:10:36 +0100, Christophe Leroy wrote: > There is a nice macro to check user mode. > > Use it instead of open coding anding with MSR_PR to increase > readability and avoid having to comment what that anding is for. > > Applied to powerpc/next. [1/1] powerpc: Use user_mode(

Re: [PATCH] powerpc/trace: Restrict hash_fault trace event to HASH MMU

2024-03-13 Thread Michael Ellerman
On Fri, 16 Feb 2024 10:46:43 +0100, Christophe Leroy wrote: > 'perf list' on powerpc 8xx shows an event named "1:hash_fault". > > This event is pointless because trace_hash_fault() is called only > from mm/book3s64/hash_utils.c > > Only define it when CONFIG_PPC_64S_HASH_MMU is selected. > > [..

Re: [PATCH v2] powerpc/hv-gpci: Fix the H_GET_PERF_COUNTER_INFO hcall return value checks

2024-03-13 Thread Michael Ellerman
On Thu, 29 Feb 2024 17:58:47 +0530, Kajol Jain wrote: > Running event > hv_gpci/dispatch_timebase_by_processor_processor_time_in_timebase_cycles,phys_processor_idx=0/ > in one of the system throws below error: > > ---Logs--- > # perf list | grep > hv_gpci/dispatch_timebase_by_processor_process

Re: [PATCH v2] powerpc/mm: Code cleanup for __hash_page_thp

2024-03-13 Thread Michael Ellerman
On Fri, 01 Mar 2024 16:58:34 +0800, Kunwu Chan wrote: > This part was commented from commit 6d492ecc6489 > ("powerpc/THP: Add code to handle HPTE faults for hugepages") > in about 11 years before. > > If there are no plans to enable this part code in the future, > we can remove this dead code and

Re: [PATCH 1/2] powerpc: Refactor __kernel_map_pages()

2024-03-13 Thread Michael Ellerman
On Fri, 16 Feb 2024 11:17:33 +0100, Christophe Leroy wrote: > __kernel_map_pages() is almost identical for PPC32 and RADIX. > > Refactor it. > > On PPC32 it is not needed for KFENCE, but to keep it simple > just make it similar to PPC64. > > [...] Applied to powerpc/next. [1/2] powerpc: Refact

Re: [PATCH] powerpc/pseries: Fix potential memleak in papr_get_attr()

2024-03-13 Thread Michael Ellerman
On Thu, 08 Dec 2022 21:34:49 +0800, Qiheng Lin wrote: > `buf` is allocated in papr_get_attr(), and krealloc() of `buf` > could fail. We need to free the original `buf` in the case of failure. > > Applied to powerpc/next. [1/1] powerpc/pseries: Fix potential memleak in papr_get_attr() http

Re: (subset) [PATCH 1/3] powerpc/64s: Fix get_hugepd_cache_index() build failure

2024-03-13 Thread Michael Ellerman
On Wed, 06 Mar 2024 23:58:51 +1100, Michael Ellerman wrote: > With CONFIG_BUG=n, the 64-bit Book3S build fails with: > > arch/powerpc/include/asm/book3s/64/pgtable-64k.h: In function > 'get_hugepd_cache_index': > arch/powerpc/include/asm/book3s/64/pgtable-64k.h:51:1: error: no return > state

Re: [PATCH 1/3] powerpc/embedded6xx: Fix no previous prototype for avr_uart_send() etc.

2024-03-13 Thread Michael Ellerman
On Tue, 05 Mar 2024 23:34:08 +1100, Michael Ellerman wrote: > Move the prototypes into mpc10x.h which is included by all the relevant > C files, fixes: > > arch/powerpc/platforms/embedded6xx/ls_uart.c:59:6: error: no previous > prototype for 'avr_uart_configure' > arch/powerpc/platforms/embed

Re: [PATCH 1/5] powerpc/64s: Move dcbt/dcbtst sequence into a macro

2024-03-13 Thread Michael Ellerman
On Thu, 29 Feb 2024 23:25:17 +1100, Michael Ellerman wrote: > There's an almost identical code sequence to specify load/store access > hints in __copy_tofrom_user_power7(), copypage_power7() and > memcpy_power7(). > > Move the sequence into a common macro, which is passed the registers to > use as

Re: [PATCH] powerpc/85xx: Make some pic_init functions static

2024-03-13 Thread Michael Ellerman
On Thu, 29 Feb 2024 22:42:16 +1100, Michael Ellerman wrote: > These functions can all be static, make them so, which also fixes no > previous prototype warnings. > > Applied to powerpc/next. [1/1] powerpc/85xx: Make some pic_init functions static https://git.kernel.org/powerpc/c/3f9f3557a

Re: [PATCH] powerpc/kprobes: Handle error returned by set_memory_rox()

2024-03-13 Thread Michael Ellerman
On Fri, 16 Feb 2024 11:13:28 +0100, Christophe Leroy wrote: > set_memory_rox() can fail. > > In case it fails, free allocated memory and return NULL. > > Applied to powerpc/next. [1/1] powerpc/kprobes: Handle error returned by set_memory_rox() https://git.kernel.org/powerpc/c/f7f18e30b46

Re: [PATCH] powerpc: Enable support for 32 bit MSI-X vectors

2024-03-13 Thread Michael Ellerman
On Wed, 17 Jan 2024 15:46:32 -0600, Brian King wrote: > Some devices are not capable of addressing 64 bits > via DMA, which includes MSI-X vectors. This allows > us to ensure these devices use MSI-X vectors in > 32 bit space. > > Applied to powerpc/next. [1/1] powerpc: Enable support for 32 bit

Re: [PATCH] powerpc: Add allmodconfig for all 32-bit sub-arches

2024-03-13 Thread Michael Ellerman
On Thu, 29 Feb 2024 22:41:08 +1100, Michael Ellerman wrote: > 32-bit powerpc kernels can be built for one of 5 sub-arches, see > Kconfig.cputype: > > PPC_BOOK3S_32: "512x/52xx/6xx/7xx/74xx/82xx/83xx/86xx" > PPC_85xx: "Freescale 85xx" > PPC_8xx: "Freescale 8xx" > 40x: "AMCC 40x" > 44x: "A

Re: [PATCH] powerpc/boot: Only free if realloc() succeeds

2024-03-13 Thread Michael Ellerman
On Thu, 29 Feb 2024 22:51:49 +1100, Michael Ellerman wrote: > simple_realloc() frees the original buffer (ptr) even if the > reallocation failed. > > Fix it to behave like standard realloc() and only free the original > buffer if the reallocation succeeded. > > > [...] Applied to powerpc/next.

Re: [PATCH] powerpc/irq: Allow softirq to hardirq stack transition

2024-03-13 Thread Michael Ellerman
On Thu, 30 Nov 2023 23:50:45 +1100, Michael Ellerman wrote: > Allow a transition from the softirq stack to the hardirq stack when > handling a hardirq. Doing so means a hardirq received while deep in > softirq processing is less likely to cause a stack overflow of the > softirq stack. > > Previous

Re: [PATCH v2 1/5] of: Add of_machine_compatible_match()

2024-03-13 Thread Michael Ellerman
On Thu, 14 Dec 2023 21:31:48 +1100, Michael Ellerman wrote: > We have of_machine_is_compatible() to check if a machine is compatible > with a single compatible string. However some code is able to support > multiple compatible boards, and so wants to check for one of many > compatible strings. > >

Re: [PATCH] powerpc: xor_vmx: Add '-mhard-float' to CFLAGS

2024-03-13 Thread Michael Ellerman
On Sat, 27 Jan 2024 11:07:43 -0700, Nathan Chancellor wrote: > arch/powerpc/lib/xor_vmx.o is built with '-msoft-float' (from the main > powerpc Makefile) and '-maltivec' (from its CFLAGS), which causes an > error when building with clang after a recent change in main: > > error: option '-msoft-f

Re: [PATCH] macintosh: adb: make adb_dev_class constant

2024-03-13 Thread Michael Ellerman
On Tue, 05 Mar 2024 17:13:48 -0300, Ricardo B. Marliere wrote: > Since commit 43a7206b0963 ("driver core: class: make class_register() take > a const *"), the driver core allows for struct class to be in read-only > memory, so move the adb_dev_class structure to be declared at build time > placing

Re: [PATCH v3] powerpc: macio: Make remove callback of macio driver void returned

2024-03-13 Thread Michael Ellerman
On Wed, 01 Feb 2023 22:36:19 +0800, Dawei Li wrote: > Commit fc7a6209d571 ("bus: Make remove callback return void") forces > bus_type::remove be void-returned, it doesn't make much sense for any > bus based driver implementing remove callbalk to return non-void to > its caller. > > This change is

Re: [PATCH] powerpc/32: Curb objtool unannotated intra-function call warning

2024-03-13 Thread Michael Ellerman
On Thu, 15 Dec 2022 17:22:58 +0530, Sathvika Vasireddy wrote: > objtool throws the following warning: > arch/powerpc/kexec/relocate_32.o: warning: objtool: .text+0x2bc: unannotated > intra-function call > > Fix this warning by annotating intra-function call, using > ANNOTATE_INTRA_FUNCTION_CALL m

Re: [PATCH] boot: simple_alloc: check after increasing memory allocation

2024-03-13 Thread Michael Ellerman
On Mon, 19 Dec 2022 10:18:16 +0800, Li zeming wrote: > The pointer new adds judgment and should help with program robustness. > > Applied to powerpc/next. [1/1] boot: simple_alloc: check after increasing memory allocation https://git.kernel.org/powerpc/c/69b0194ccec033c208b071e019032c1919

[PATCH v1 1/1] powerpc/52xx: Replace of_gpio.h by proper one

2024-03-13 Thread Andy Shevchenko
of_gpio.h is deprecated and subject to remove. The driver doesn't use it directly, replace it with what is really being used. Signed-off-by: Andy Shevchenko --- arch/powerpc/platforms/52xx/mpc52xx_common.c | 2 -- arch/powerpc/platforms/52xx/mpc52xx_gpt.c| 2 +- 2 files changed, 1 insertion(

Re: [PATCH v3 07/12] powerpc: Use initializer for struct vm_unmapped_area_info

2024-03-13 Thread Edgecombe, Rick P
On Wed, 2024-03-13 at 06:44 +, Christophe Leroy wrote: > I understand from this text that, as agreed, this patch removes the > pointless/redundant zero-init of individual members. But it is not > what > is done, see below ? Err, right. I think I decided to leave it because it was already ack

Re: [PATCH v9 07/10] PCI: dwc: ep: Remove "core_init_notifier" flag

2024-03-13 Thread Manivannan Sadhasivam
On Mon, Mar 11, 2024 at 10:54:28PM +0100, Niklas Cassel wrote: > On Mon, Mar 11, 2024 at 08:15:59PM +0530, Manivannan Sadhasivam wrote: > > > > > > I would say that it is the following change that breaks things: > > > > > > > - if (!core_init_notifier) { > > > > - ret = pci_ep

[PATCH 01/13] mm/hmm: Process pud swap entry without pud_huge()

2024-03-13 Thread peterx
From: Peter Xu Swap pud entries do not always return true for pud_huge() for all archs. x86 and sparc (so far) allow it, but all the rest do not accept a swap entry to be reported as pud_huge(). So it's not safe to check swap entries within pud_huge(). Check swap entries before pud_huge(), so i

[PATCH 00/13] mm/treewide: Remove pXd_huge() API

2024-03-13 Thread peterx
From: Peter Xu [based on akpm/mm-unstable latest commit 9af2e4c429b5] v1: - Rebase, remove RFC tag - Fixed powerpc patch build issue, enhancing commit message [Michael] - Optimize patch 1 & 3 on "none || !present" check [Jason] In previous work [1], we removed the pXd_large() API, which is arch

[PATCH 02/13] mm/gup: Cache p4d in follow_p4d_mask()

2024-03-13 Thread peterx
From: Peter Xu Add a variable to cache p4d in follow_p4d_mask(). It's a good practise to make sure all the following checks will have a consistent view of the entry. Signed-off-by: Peter Xu --- mm/gup.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mm/gup.c

[PATCH 04/13] mm/x86: Change pXd_huge() behavior to exclude swap entries

2024-03-13 Thread peterx
From: Peter Xu This patch partly reverts below commits: 3a194f3f8ad0 ("mm/hugetlb: make pud_huge() and follow_huge_pud() aware of non-present pud entry") cbef8478bee5 ("mm/hugetlb: pmd_huge() returns true for non-present hugepage") Right now, pXd_huge() definition across kernel is unclear. We

[PATCH 03/13] mm/gup: Check p4d presence before going on

2024-03-13 Thread peterx
From: Peter Xu Currently there should have no p4d swap entries so it may not matter much, however this may help us to rule out swap entries in pXd_huge() API, which will include p4d_huge(). The p4d_present() checks make it 100% clear that we won't rely on p4d_huge() for swap entries. Signed-off

[PATCH 05/13] mm/sparc: Change pXd_huge() behavior to exclude swap entries

2024-03-13 Thread peterx
From: Peter Xu Please refer to the previous patch on the reasoning for x86. Now sparc is the only architecture that will allow swap entries to be reported as pXd_huge(). After this patch, all architectures should forbid swap entries in pXd_huge(). Cc: David S. Miller Cc: Andreas Larsson Cc:

[PATCH 06/13] mm/arm: Use macros to define pmd/pud helpers

2024-03-13 Thread peterx
From: Peter Xu It's already confusing that ARM 2-level v.s. 3-level defines SECT bit differently on pmd/puds. Always use a macro which is much clearer. Cc: Russell King Cc: Shawn Guo Cc: Krzysztof Kozlowski Cc: Bjorn Andersson Cc: Arnd Bergmann Cc: Konrad Dybcio Cc: Fabio Estevam Cc: lin

[PATCH 07/13] mm/arm: Redefine pmd_huge() with pmd_leaf()

2024-03-13 Thread peterx
From: Peter Xu Most of the archs already define these two APIs the same way. ARM is more complicated in two aspects: - For pXd_huge() it's always checking against !PXD_TABLE_BIT, while for pXd_leaf() it's always checking against PXD_TYPE_SECT. - SECT/TABLE bits are defined differently

[PATCH 08/13] mm/arm64: Merge pXd_huge() and pXd_leaf() definitions

2024-03-13 Thread peterx
From: Peter Xu Unlike most archs, aarch64 defines pXd_huge() and pXd_leaf() slightly differently. Redefine the pXd_huge() with pXd_leaf(). There used to be two traps for old aarch64 definitions over these APIs that I found when reading the code around, they're: (1) 4797ec2dc83a ("arm64: fix p

[PATCH 09/13] mm/powerpc: Redefine pXd_huge() with pXd_leaf()

2024-03-13 Thread peterx
From: Peter Xu PowerPC book3s 4K mostly has the same definition on both, except pXd_huge() constantly returns 0 for hash MMUs. As Michael Ellerman pointed out [1], it is safe to check _PAGE_PTE on hash MMUs, as the bit will never be set so it will keep returning false. As a reference, __p[mu]d_

[PATCH 10/13] mm/gup: Merge pXd huge mapping checks

2024-03-13 Thread peterx
From: Peter Xu Huge mapping checks in GUP are slightly redundant and can be simplified. pXd_huge() now is the same as pXd_leaf(). pmd_trans_huge() and pXd_devmap() should both imply pXd_leaf(). Time to merge them into one. Reviewed-by: Jason Gunthorpe Signed-off-by: Peter Xu --- mm/gup.c |

[PATCH 11/13] mm/treewide: Replace pXd_huge() with pXd_leaf()

2024-03-13 Thread peterx
From: Peter Xu Now after we're sure all pXd_huge() definitions are the same as pXd_leaf(), reuse it. Luckily, pXd_huge() isn't widely used. Signed-off-by: Peter Xu --- arch/arm/include/asm/pgtable-3level.h | 2 +- arch/arm64/include/asm/pgtable.h | 2 +- arch/arm64/mm/hugetlbpage.c

[PATCH 12/13] mm/treewide: Remove pXd_huge()

2024-03-13 Thread peterx
From: Peter Xu This API is not used anymore, drop it for the whole tree. Signed-off-by: Peter Xu --- arch/arm/mm/Makefile | 1 - arch/arm/mm/hugetlbpage.c | 29 --- arch/arm64/mm/hugetlbpage.c | 10 --- arch/lo

[PATCH 13/13] mm: Document pXd_leaf() API

2024-03-13 Thread peterx
From: Peter Xu There's one small section already, but since we're going to remove pXd_huge(), that comment may start to obsolete. Rewrite that section with more information, hopefully with that the API is crystal clear on what it implies. Reviewed-by: Jason Gunthorpe Signed-off-by: Peter Xu -

Re: [PATCH v3 07/12] powerpc: Use initializer for struct vm_unmapped_area_info

2024-03-13 Thread Michael Ellerman
"Edgecombe, Rick P" writes: > On Wed, 2024-03-13 at 06:44 +, Christophe Leroy wrote: >> I understand from this text that, as agreed, this patch removes the >> pointless/redundant zero-init of individual members. But it is not >> what >> is done, see below ? > > Err, right. I think I decided

Re: [PATCH v7 1/5] net: wan: Add support for QMC HDLC

2024-03-13 Thread Michael Ellerman
Hi Herve, Herve Codina writes: > The QMC HDLC driver provides support for HDLC using the QMC (QUICC > Multichannel Controller) to transfer the HDLC data. ... > > diff --git a/drivers/net/wan/fsl_qmc_hdlc.c b/drivers/net/wan/fsl_qmc_hdlc.c > new file mode 100644 > index ..5fd7ed325f5

Re: [PATCH v10 09/12] powerpc: mm: Add common pud_pfn stub for all platforms

2024-03-13 Thread LTC IMAP
On Wed, 2024-03-13 at 11:08 +, Christophe Leroy wrote: > > > Le 13/03/2024 à 05:21, Rohan McLure a écrit : > > Prior to this commit, pud_pfn was implemented with BUILD_BUG as the > > inline > > function for 64-bit Book3S systems but is never included, as its > > invocations in generic code ar

[powerpc:merge] BUILD SUCCESS d5bdfb09862ffbf009951f56d324129d1efb9de0

2024-03-13 Thread kernel test robot
clang i386 allmodconfig gcc i386 allnoconfig gcc i386 allyesconfig gcc i386 buildonly-randconfig-001-20240313 gcc i386 buildonly-randconfig-001-20240314 clang i386 buildonly-randconfig-00

[PATCH v2] powerpc/pseries: fix max polling time in plpks_confirm_object_flushed() function

2024-03-13 Thread Nayna Jain
usleep_range() function takes input time and range in usec. However, currently it is assumed in msec in the function plpks_confirm_object_flushed(). Fix the total polling time for the object flushing from 5msec to 5sec. Reported-by: Nageswara R Sastry Fixes: 2454a7af0f2a ("powerpc/pseries: defin