Re: [PATCH 02/12] mm/pgtable: add PAE safety to __pte_offset_map()

2023-06-01 Thread Hugh Dickins
On Wed, 31 May 2023, Jason Gunthorpe wrote: > On Sun, May 28, 2023 at 11:16:16PM -0700, Hugh Dickins wrote: > > There is a faint risk that __pte_offset_map(), on a 32-bit architecture > > with a 64-bit pmd_t e.g. x86-32 with CONFIG_X86_PAE=y, would succeed on > > a pmdval assembled from a pmd_low

Re: [PATCH 10/12] mm/khugepaged: collapse_pte_mapped_thp() with mmap_read_lock()

2023-06-01 Thread Hugh Dickins
On Wed, 31 May 2023, Jann Horn wrote: > On Mon, May 29, 2023 at 8:26 AM Hugh Dickins wrote: > > Bring collapse_and_free_pmd() back into collapse_pte_mapped_thp(). > > It does need mmap_read_lock(), but it does not need mmap_write_lock(), > > nor vma_start_write() nor i_mmap lock nor anon_vma

Re: [PATCH 00/12] mm: free retracted page table by RCU

2023-06-01 Thread Hugh Dickins
On Wed, 31 May 2023, Jann Horn wrote: > On Mon, May 29, 2023 at 8:11 AM Hugh Dickins wrote: > > Here is the third series of patches to mm (and a few architectures), based > > on v6.4-rc3 with the preceding two series applied: in which khugepaged > > takes advantage of pte_offset_map[_lock]()

Re: [PATCH] ASoC: fsl_sai: Enable BCI bit if SAI works on synchronous mode with BYP asserted

2023-06-01 Thread Shengjiu Wang
On Tue, May 30, 2023 at 6:30 PM Chancel Liu wrote: > There's an issue on SAI synchronous mode that TX/RX side can't get BCLK > from RX/TX it sync with if BYP bit is asserted. It's a workaround to > fix it that enable SION of IOMUX pad control and assert BCI. > > For example if TX sync with RX

Re: [PATCH 01/12] mm/pgtable: add rcu_read_lock() and rcu_read_unlock()s

2023-06-01 Thread Hugh Dickins
On Wed, 31 May 2023, Jann Horn wrote: > On Mon, May 29, 2023 at 8:15 AM Hugh Dickins wrote: > > Before putting them to use (several commits later), add rcu_read_lock() > > to pte_offset_map(), and rcu_read_unlock() to pte_unmap(). Make this a > > separate commit, since it risks exposing

Re: [PATCH 00/13] mm: jit/text allocator

2023-06-01 Thread Song Liu
On Thu, Jun 1, 2023 at 3:13 AM Mike Rapoport wrote: > > From: "Mike Rapoport (IBM)" > > Hi, > > module_alloc() is used everywhere as a mean to allocate memory for code. > > Beside being semantically wrong, this unnecessarily ties all subsystmes > that need to allocate code, such as ftrace,

Re: [PATCH 12/13] x86/jitalloc: prepare to allocate exectuatble memory as ROX

2023-06-01 Thread Song Liu
On Thu, Jun 1, 2023 at 4:07 AM Mike Rapoport wrote: > > On Thu, Jun 01, 2023 at 12:30:50PM +0200, Peter Zijlstra wrote: > > On Thu, Jun 01, 2023 at 01:12:56PM +0300, Mike Rapoport wrote: > > > > > +static void __init_or_module do_text_poke(void *addr, const void > > > *opcode, size_t len) > > >

Re: [PATCH 12/13] x86/jitalloc: prepare to allocate exectuatble memory as ROX

2023-06-01 Thread Nadav Amit
> On Jun 1, 2023, at 1:50 PM, Edgecombe, Rick P > wrote: > > On Thu, 2023-06-01 at 14:38 -0400, Kent Overstreet wrote: >> On Thu, Jun 01, 2023 at 06:13:44PM +, Edgecombe, Rick P wrote: text_poke() _does_ create a separate RW mapping. >>> >>> Sorry, I meant a separate RW allocation.

Re: [PATCH v8 00/10] arm64: Add framework to turn an IPI as NMI

2023-06-01 Thread Doug Anderson
Hi, On Wed, May 10, 2023 at 9:42 AM Doug Anderson wrote: > > Hi, > > On Wed, May 10, 2023 at 9:30 AM Mark Rutland wrote: > > > > On Wed, May 10, 2023 at 08:28:17AM -0700, Doug Anderson wrote: > > > Hi, > > > > Hi Doug, > > > > > On Wed, Apr 19, 2023 at 3:57 PM Douglas Anderson > > > wrote: >

Re: [PATCH 12/13] x86/jitalloc: prepare to allocate exectuatble memory as ROX

2023-06-01 Thread Song Liu
On Thu, Jun 1, 2023 at 3:15 AM Mike Rapoport wrote: > > From: Song Liu > > Replace direct memory writes to memory allocated for code with text poking > to allow allocation of executable memory as ROX. > > The only exception is arch_prepare_bpf_trampoline() that cannot jit > directly into module

[PATCH v4 RESEND 3/3] block: sed-opal: keyring support for SED keys

2023-06-01 Thread gjoyce
From: Greg Joyce Extend the SED block driver so it can alternatively obtain a key from a sed-opal kernel keyring. The SED ioctls will indicate the source of the key, either directly in the ioctl data or from the keyring. This allows the use of SED commands in scripts such as udev scripts so

[PATCH v4 RESEND 2/3] block: sed-opal: Implement IOC_OPAL_REVERT_LSP

2023-06-01 Thread gjoyce
From: Greg Joyce This is used in conjunction with IOC_OPAL_REVERT_TPR to return a drive to Original Factory State without erasing the data. If IOC_OPAL_REVERT_LSP is called with opal_revert_lsp.options bit OPAL_PRESERVE set prior to calling IOC_OPAL_REVERT_TPR, the drive global locking range

[PATCH v4 RESEND 1/3] block: sed-opal: Implement IOC_OPAL_DISCOVERY

2023-06-01 Thread gjoyce
From: Greg Joyce Add IOC_OPAL_DISCOVERY ioctl to return raw discovery data to a SED Opal application. This allows the application to display drive capabilities and state. Signed-off-by: Greg Joyce Reviewed-by: Christoph Hellwig Reviewed-by: Jonathan Derrick --- block/sed-opal.c

[PATCH v4 RESEND 0/3] sed-opal: keyrings, discovery, revert, key store

2023-06-01 Thread gjoyce
From: Greg Joyce This patchset has gone through numerous rounds of review and all comments/suggetions have been addressed. I believe that this patchset is ready for inclusion. TCG SED Opal is a specification from The Trusted Computing Group that allows self encrypting storage devices (SED) to

[PATCH v6 0/4] generic and PowerPC SED Opal keystore

2023-06-01 Thread gjoyce
From: Greg Joyce This patchset has gone through numerous rounds of review and all comments/suggetions have been addressed. I believe that this patchset is ready for inclusion. TCG SED Opal is a specification from The Trusted Computing Group that allows self encrypting storage devices (SED) to

[PATCH v6 1/3] block:sed-opal: SED Opal keystore

2023-06-01 Thread gjoyce
From: Greg Joyce TCG SED Opal is a specification from The Trusted Computing Group that allows self encrypting storage devices (SED) to be locked at power on and require an authentication key to unlock the drive. Add read and write functions that allow SED Opal authentication keys to be stored

[PATCH v6 3/3] powerpc/pseries: PLPKS SED Opal keystore support

2023-06-01 Thread gjoyce
From: Greg Joyce Define operations for SED Opal to read/write keys from POWER LPAR Platform KeyStore(PLPKS). This allows non-volatile storage of SED Opal keys. Signed-off-by: Greg Joyce Reviewed-by: Jonathan Derrick --- arch/powerpc/platforms/pseries/Kconfig| 6 +

[PATCH v6 2/3] block/sed-opal: keystore access for SED Opal keys

2023-06-01 Thread gjoyce
From: Greg Joyce Allow for permanent SED Opal authentication keys by reading/writing to the SED Opal non-volatile keystore. Signed-off-by: Greg Joyce Reviewed-by: Jonathan Derrick --- block/sed-opal.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git

Re: [PATCH 04/13] mm/jitalloc, arch: convert remaining overrides of module_alloc to jitalloc

2023-06-01 Thread Song Liu
On Thu, Jun 1, 2023 at 3:13 AM Mike Rapoport wrote: > > From: "Mike Rapoport (IBM)" > > Extend jitalloc parameters to accommodate more complex overrides of > module_alloc() by architectures. > > This includes specification of a fallback range required by arm, arm64 > and powerpc and support for

Re: [PATCH 12/13] x86/jitalloc: prepare to allocate exectuatble memory as ROX

2023-06-01 Thread Edgecombe, Rick P
On Thu, 2023-06-01 at 14:38 -0400, Kent Overstreet wrote: > On Thu, Jun 01, 2023 at 06:13:44PM +, Edgecombe, Rick P wrote: > > > text_poke() _does_ create a separate RW mapping. > > > > Sorry, I meant a separate RW allocation. > > Ah yes, that makes sense > > > > > > > > > > The thing

Re: [PATCH v2 23/25] iommu: Add ops->domain_alloc_paging()

2023-06-01 Thread Jason Gunthorpe
On Thu, Jun 01, 2023 at 08:17:56PM +0100, Robin Murphy wrote: > On 2023-05-16 01:00, Jason Gunthorpe wrote: > > This callback requests the driver to create only a __IOMMU_DOMAIN_PAGING > > domain, so it saves a few lines in a lot of drivers needlessly checking > > the type. > > > > More

Re: [PATCH v3 03/34] s390: Use pt_frag_refcount for pagetables

2023-06-01 Thread Vishal Moola
On Thu, Jun 1, 2023 at 6:19 AM Gerald Schaefer wrote: > > On Wed, 31 May 2023 14:30:01 -0700 > "Vishal Moola (Oracle)" wrote: > > > s390 currently uses _refcount to identify fragmented page tables. > > The page table struct already has a member pt_frag_refcount used by > > powerpc, so have s390

Re: [PATCH v2 25/25] iommu: Convert remaining simple drivers to domain_alloc_paging()

2023-06-01 Thread Jason Gunthorpe
On Thu, Jun 01, 2023 at 08:47:28PM +0100, Robin Murphy wrote: > On 2023-05-16 01:00, Jason Gunthorpe wrote: > > These drivers don't support IOMMU_DOMAIN_DMA, so this commit effectively > > allows them to support that mode. > > > > The prior work to require default_domains makes this safe because

Re: [PATCH v2 09/25] iommu/fsl_pamu: Implement an IDENTITY domain

2023-06-01 Thread Jason Gunthorpe
On Thu, Jun 01, 2023 at 08:53:41PM +0100, Robin Murphy wrote: > On 2023-06-01 20:46, Jason Gunthorpe wrote: > > On Thu, Jun 01, 2023 at 08:37:45PM +0100, Robin Murphy wrote: > > > On 2023-05-16 01:00, Jason Gunthorpe wrote: > > > > Robin was able to check the documentation and what fsl_pamu has >

Re: [PATCH v2 04/25] iommu: Add IOMMU_DOMAIN_PLATFORM for S390

2023-06-01 Thread Jason Gunthorpe
On Thu, Jun 01, 2023 at 07:25:32PM +0100, Robin Murphy wrote: > On 2023-05-16 01:00, Jason Gunthorpe wrote: > > The PLATFORM domain will be set as the default domain and attached as > > normal during probe. The driver will ignore the initial attach from a NULL > > domain to the PLATFORM domain. >

Re: [PATCH v2 09/25] iommu/fsl_pamu: Implement an IDENTITY domain

2023-06-01 Thread Robin Murphy
On 2023-06-01 20:46, Jason Gunthorpe wrote: On Thu, Jun 01, 2023 at 08:37:45PM +0100, Robin Murphy wrote: On 2023-05-16 01:00, Jason Gunthorpe wrote: Robin was able to check the documentation and what fsl_pamu has historically called detach_dev() is really putting the IOMMU into an IDENTITY

Re: [PATCH v2 25/25] iommu: Convert remaining simple drivers to domain_alloc_paging()

2023-06-01 Thread Robin Murphy
On 2023-05-16 01:00, Jason Gunthorpe wrote: These drivers don't support IOMMU_DOMAIN_DMA, so this commit effectively allows them to support that mode. The prior work to require default_domains makes this safe because every one of these drivers is either compilation incompatible with

Re: [PATCH v2 09/25] iommu/fsl_pamu: Implement an IDENTITY domain

2023-06-01 Thread Jason Gunthorpe
On Thu, Jun 01, 2023 at 08:37:45PM +0100, Robin Murphy wrote: > On 2023-05-16 01:00, Jason Gunthorpe wrote: > > Robin was able to check the documentation and what fsl_pamu has > > historically called detach_dev() is really putting the IOMMU into an > > IDENTITY mode. > > Unfortunately it was the

Re: [PATCH v2 09/25] iommu/fsl_pamu: Implement an IDENTITY domain

2023-06-01 Thread Robin Murphy
On 2023-05-16 01:00, Jason Gunthorpe wrote: Robin was able to check the documentation and what fsl_pamu has historically called detach_dev() is really putting the IOMMU into an IDENTITY mode. Unfortunately it was the other way around - it's the call to fsl_setup_liodns() from fsl_pamu_probe()

Re: [PATCH v2 23/25] iommu: Add ops->domain_alloc_paging()

2023-06-01 Thread Robin Murphy
On 2023-05-16 01:00, Jason Gunthorpe wrote: This callback requests the driver to create only a __IOMMU_DOMAIN_PAGING domain, so it saves a few lines in a lot of drivers needlessly checking the type. More critically, this allows us to sweep out all the IOMMU_DOMAIN_UNMANAGED and IOMMU_DOMAIN_DMA

Re: [PATCH v2 08/25] iommu: Allow an IDENTITY domain as the default_domain in ARM32

2023-06-01 Thread Robin Murphy
On 2023-05-16 01:00, Jason Gunthorpe wrote: Even though dma-iommu.c and CONFIG_ARM_DMA_USE_IOMMU do approximately the same stuff, the way they relate to the IOMMU core is quiet different. dma-iommu.c expects the core code to setup an UNMANAGED domain (of type IOMMU_DOMAIN_DMA) and then

Re: [PATCH 12/13] x86/jitalloc: prepare to allocate exectuatble memory as ROX

2023-06-01 Thread Kent Overstreet
On Thu, Jun 01, 2023 at 06:13:44PM +, Edgecombe, Rick P wrote: > > text_poke() _does_ create a separate RW mapping. > > Sorry, I meant a separate RW allocation. Ah yes, that makes sense > > > > > The thing that sucks about text_poke() is that it always does a full > > TLB > > flush, and

Re: [PATCH v2 04/25] iommu: Add IOMMU_DOMAIN_PLATFORM for S390

2023-06-01 Thread Robin Murphy
On 2023-05-16 01:00, Jason Gunthorpe wrote: The PLATFORM domain will be set as the default domain and attached as normal during probe. The driver will ignore the initial attach from a NULL domain to the PLATFORM domain. After this, the PLATFORM domain's attach_dev will be called whenever we

Re: [PATCH 00/13] mm: jit/text allocator

2023-06-01 Thread Kent Overstreet
On Thu, Jun 01, 2023 at 05:12:03PM +0100, Mark Rutland wrote: > For a while I have wanted to give kprobes its own allocator so that it can > work > even with CONFIG_MODULES=n, and so that it doesn't have to waste VA space in > the modules area. > > Given that, I think these should have their own

Re: [PATCH 12/13] x86/jitalloc: prepare to allocate exectuatble memory as ROX

2023-06-01 Thread Edgecombe, Rick P
On Thu, 2023-06-01 at 14:00 -0400, Kent Overstreet wrote: > On Thu, Jun 01, 2023 at 04:54:27PM +, Edgecombe, Rick P wrote: > > It is just a local flush, but I wonder how much text_poke()ing is > > too > > much. A lot of the are even inside loops. Can't it do the batch > > version > > at least?

Re: [PATCH 12/13] x86/jitalloc: prepare to allocate exectuatble memory as ROX

2023-06-01 Thread Kent Overstreet
On Thu, Jun 01, 2023 at 04:54:27PM +, Edgecombe, Rick P wrote: > It is just a local flush, but I wonder how much text_poke()ing is too > much. A lot of the are even inside loops. Can't it do the batch version > at least? > > The other thing, and maybe this is in paranoia category, but it's >

Re: [PATCH 12/13] x86/jitalloc: prepare to allocate exectuatble memory as ROX

2023-06-01 Thread Kent Overstreet
On Thu, Jun 01, 2023 at 12:30:50PM +0200, Peter Zijlstra wrote: > On Thu, Jun 01, 2023 at 01:12:56PM +0300, Mike Rapoport wrote: > > > +static void __init_or_module do_text_poke(void *addr, const void *opcode, > > size_t len) > > +{ > > + if (system_state < SYSTEM_RUNNING) { > > +

Re: [PATCH 12/13] x86/jitalloc: prepare to allocate exectuatble memory as ROX

2023-06-01 Thread Edgecombe, Rick P
On Thu, 2023-06-01 at 13:12 +0300, Mike Rapoport wrote: >  /* >   * Are we looking at a near JMP with a 1 or 4-byte displacement. > @@ -331,7 +344,7 @@ void __init_or_module noinline > apply_alternatives(struct alt_instr *start, >   > DUMP_BYTES(insn_buff, insn_buff_sz, "%px:

Re: [PATCH v2 05/25] iommu/tegra-gart: Remove tegra-gart

2023-06-01 Thread Thierry Reding
On Mon, May 15, 2023 at 09:00:38PM -0300, Jason Gunthorpe wrote: > Thierry says this is not used anymore, and doesn't think it ever will > be. The HW it supports is about 10 years old now and newer HW uses > different IOMMU drivers. > > As this is the only driver with a GART approach, and it

Re: [PATCH v8 0/7] Add pci_dev_for_each_resource() helper and update users

2023-06-01 Thread Andy Shevchenko
On Thu, Jun 01, 2023 at 07:25:46PM +0300, Andy Shevchenko wrote: > On Wed, May 31, 2023 at 08:48:35PM +0200, Jonas Gorski wrote: > > On Tue, 30 May 2023 at 23:34, Bjorn Helgaas wrote: > > > On Fri, May 12, 2023 at 02:48:51PM -0500, Bjorn Helgaas wrote: ... > > > Where are we at? Are we going

Re: [PATCH v8 0/7] Add pci_dev_for_each_resource() helper and update users

2023-06-01 Thread Andy Shevchenko
On Wed, May 31, 2023 at 08:48:35PM +0200, Jonas Gorski wrote: > On Tue, 30 May 2023 at 23:34, Bjorn Helgaas wrote: > > On Fri, May 12, 2023 at 02:48:51PM -0500, Bjorn Helgaas wrote: > > > On Fri, May 12, 2023 at 01:56:29PM +0300, Andy Shevchenko wrote: > > > > On Tue, May 09, 2023 at 01:21:22PM

Re: [PATCH 8/9] powerpc: Add HOTPLUG_SMT support

2023-06-01 Thread Laurent Dufour
On 01/06/2023 15:27:30, Laurent Dufour wrote: > On 24/05/2023 17:56:29, Michael Ellerman wrote: >> Add support for HOTPLUG_SMT, which enables the generic sysfs SMT support >> files in /sys/devices/system/cpu/smt, as well as the "nosmt" boot >> parameter. > > Hi Michael, > > It seems that there

Re: [PATCH 00/13] mm: jit/text allocator

2023-06-01 Thread Mark Rutland
Hi Mike, On Thu, Jun 01, 2023 at 01:12:44PM +0300, Mike Rapoport wrote: > From: "Mike Rapoport (IBM)" > > Hi, > > module_alloc() is used everywhere as a mean to allocate memory for code. > > Beside being semantically wrong, this unnecessarily ties all subsystmes > that need to allocate code,

Re: [PATCH 1/4] block:sed-opal: SED Opal keystore

2023-06-01 Thread Greg Joyce
On Thu, 2023-05-11 at 01:50 +0300, Jarkko Sakkinen wrote: > On Fri May 5, 2023 at 10:43 PM EEST, wrote: > > From: Greg Joyce > > > > Add read and write functions that allow SED Opal keys to stored > > in a permanent keystore. > > Please be more verbose starting from "Self-Encrypting Drive

Re: [PATCH 4/4] powerpc/pseries: update SED for PLPKS api changes

2023-06-01 Thread Greg Joyce
On Mon, 2023-05-15 at 15:52 +1000, Andrew Donnellan wrote: > On Fri, 2023-05-05 at 14:44 -0500, gjo...@linux.vnet.ibm.com wrote: > > From: Greg Joyce > > > > Changes to the PLPKS API require minor updates to the SED Opal > > PLPKS keystore code. > > > > Signed-off-by: Greg Joyce > > [+ Nayna]

Re: [PATCH v3 25/34] m68k: Convert various functions to use ptdescs

2023-06-01 Thread kernel test robot
-functions/20230601-053454 base: next-20230531 patch link: https://lore.kernel.org/r/20230531213032.25338-26-vishal.moola%40gmail.com patch subject: [PATCH v3 25/34] m68k: Convert various functions to use ptdescs config: m68k-randconfig-r002-20230531 (https://download.01.org/0day-ci/archive

Re: [PATCH v4 22/23] PCI/AER: Forward RCH downstream port-detected errors to the CXL.mem dev handler

2023-06-01 Thread Jonathan Cameron
On Tue, 23 May 2023 18:22:13 -0500 Terry Bowman wrote: > From: Robert Richter > > In Restricted CXL Device (RCD) mode a CXL device is exposed as an > RCiEP, but CXL downstream and upstream ports are not enumerated and > not visible in the PCIe hierarchy. Protocol and link errors are sent > to

Re: [PATCH 09/12] mm/khugepaged: retract_page_tables() without mmap or vma lock

2023-06-01 Thread Jason Gunthorpe
On Thu, Jun 01, 2023 at 12:18:43AM +0200, Jann Horn wrote: > 3. We have to *serialize* with page table walks performed by the > IOMMU. We're doing an RCU barrier to synchronize against page table > walks from the MMU, but without an appropriate mmu_notifier call, we > have nothing to ensure that

Re: [PATCH 05/12] powerpc: add pte_free_defer() for pgtables sharing page

2023-06-01 Thread Gerald Schaefer
On Mon, 29 May 2023 07:36:40 -0700 (PDT) Hugh Dickins wrote: > On Mon, 29 May 2023, Matthew Wilcox wrote: > > On Sun, May 28, 2023 at 11:20:21PM -0700, Hugh Dickins wrote: > > > +void pte_free_defer(struct mm_struct *mm, pgtable_t pgtable) > > > +{ > > > + struct page *page; > > > + > > > +

Re: [PATCH 08/12] mm/pgtable: add pte_free_defer() for pgtable as page

2023-06-01 Thread Jann Horn
On Mon, May 29, 2023 at 8:23 AM Hugh Dickins wrote: > Add the generic pte_free_defer(), to call pte_free() via call_rcu(). > pte_free_defer() will be called inside khugepaged's retract_page_tables() > loop, where allocating extra memory cannot be relied upon. This version > suits all those

Re: [PATCH 8/9] powerpc: Add HOTPLUG_SMT support

2023-06-01 Thread Laurent Dufour
On 24/05/2023 17:56:29, Michael Ellerman wrote: > Add support for HOTPLUG_SMT, which enables the generic sysfs SMT support > files in /sys/devices/system/cpu/smt, as well as the "nosmt" boot > parameter. Hi Michael, It seems that there is now a conflict between with the PPC 'smt-enabled' boot

Re: [PATCH v3 03/34] s390: Use pt_frag_refcount for pagetables

2023-06-01 Thread Gerald Schaefer
On Wed, 31 May 2023 14:30:01 -0700 "Vishal Moola (Oracle)" wrote: > s390 currently uses _refcount to identify fragmented page tables. > The page table struct already has a member pt_frag_refcount used by > powerpc, so have s390 use that instead of the _refcount field as well. > This improves

Re: [PATCH 10/10] watchdog/hardlockup: Rename HAVE_HARDLOCKUP_DETECTOR_NON_ARCH to ..._PERF_OR_BUDDY

2023-06-01 Thread Petr Mladek
On Fri 2023-05-26 18:41:40, Douglas Anderson wrote: > HAVE_HARDLOCKUP_DETECTOR_NON_ARCH is a mouthful and > confusing. HAVE_HARDLOCKUP_DETECTOR_PERF_OR_BUDDY is even more of a > mouthful, but probably less confusing. Rename the Kconfig names. It is better. But I have an idea that might be even

Re: [PATCH 2/2] powerpc/xmon: use KSYM_NAME_LEN in array size

2023-06-01 Thread Michael Ellerman
Miguel Ojeda writes: > On Thu, Jun 1, 2023 at 4:02 AM Michael Ellerman wrote: >> >> > Side-note: in `get_function_bounds()`, I see `kallsyms_lookup()` being >> > used, but the name seems discarded? Can >> > `kallsyms_lookup_size_offset()` be used instead, thus avoiding the >> > usage of the

RE: [PATCH 00/89] i2c: Convert to platform remove callback returning void

2023-06-01 Thread Biju Das
> Subject: Re: [PATCH 00/89] i2c: Convert to platform remove callback > returning void > > [Dropped Phil Edworthy from recipents as his email address has problems] Phil no longer works with Renesas. Adding Fabrizio who is taking care of RZ/V2M I2C driver. Cheers, Biju

Re: [PATCH 00/89] i2c: Convert to platform remove callback returning void

2023-06-01 Thread Uwe Kleine-König
[Dropped Phil Edworthy from recipents as his email address has problems] Hello, On Mon, May 08, 2023 at 10:51:37PM +0200, Uwe Kleine-König wrote: > this series convers the drivers below drivers/i2c to the .remove_new() > callback of struct platform_driver(). The motivation is to make the >

Re: [PATCH v8 0/7] Add pci_dev_for_each_resource() helper and update users

2023-06-01 Thread Jonas Gorski
On Wed, 31 May 2023 at 23:30, Bjorn Helgaas wrote: > > On Wed, May 31, 2023 at 08:48:35PM +0200, Jonas Gorski wrote: > > ... > > > Looking at the code I understand where coverity is coming from: > > > > #define __pci_dev_for_each_res0(dev, res, ...) \ > >for

Re: [PATCH 12/13] x86/jitalloc: prepare to allocate exectuatble memory as ROX

2023-06-01 Thread Mike Rapoport
On Thu, Jun 01, 2023 at 12:30:50PM +0200, Peter Zijlstra wrote: > On Thu, Jun 01, 2023 at 01:12:56PM +0300, Mike Rapoport wrote: > > > +static void __init_or_module do_text_poke(void *addr, const void *opcode, > > size_t len) > > +{ > > + if (system_state < SYSTEM_RUNNING) { > > +

WARN at kernel/sched/core.c:5358 (kthread_end_lazy_tlb_mm)

2023-06-01 Thread Sachin Sant
While compiling a kernel on a IBM Power system booted with 6.4.0-rc4-next-20230601 following warning is observed [ 276.351697] [ cut here ] [ 276.351709] WARNING: CPU: 27 PID: 9237 at kernel/sched/core.c:5358 kthread_end_lazy_tlb_mm+0x90/0xa0 [ 276.351719] Modules

Re: [PATCH 12/13] x86/jitalloc: prepare to allocate exectuatble memory as ROX

2023-06-01 Thread Peter Zijlstra
On Thu, Jun 01, 2023 at 01:12:56PM +0300, Mike Rapoport wrote: > +static void __init_or_module do_text_poke(void *addr, const void *opcode, > size_t len) > +{ > + if (system_state < SYSTEM_RUNNING) { > + text_poke_early(addr, opcode, len); > + } else { > +

Re: [PATCH 2/2] powerpc/xmon: use KSYM_NAME_LEN in array size

2023-06-01 Thread Miguel Ojeda
On Thu, Jun 1, 2023 at 4:02 AM Michael Ellerman wrote: > > > Side-note: in `get_function_bounds()`, I see `kallsyms_lookup()` being > > used, but the name seems discarded? Can > > `kallsyms_lookup_size_offset()` be used instead, thus avoiding the > > usage of the buffer there to begin with? > > A

[PATCH 13/13] x86/jitalloc: make memory allocated for code ROX

2023-06-01 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" When STRICT_KERNEL_RWX or STRICT_MODULE_RWX is enabled, force text allocations to use KERNEL_PAGE_ROX. Signed-off-by: Mike Rapoport (IBM) --- arch/Kconfig | 3 +++ arch/x86/Kconfig | 1 + arch/x86/kernel/ftrace.c | 3 --- arch/x86/mm/init.c

[PATCH 12/13] x86/jitalloc: prepare to allocate exectuatble memory as ROX

2023-06-01 Thread Mike Rapoport
From: Song Liu Replace direct memory writes to memory allocated for code with text poking to allow allocation of executable memory as ROX. The only exception is arch_prepare_bpf_trampoline() that cannot jit directly into module memory yet, so it uses set_memory calls to unprotect the memory

[PATCH 11/13] ftrace: Add swap_func to ftrace_process_locs()

2023-06-01 Thread Mike Rapoport
From: Song Liu ftrace_process_locs sorts module mcount, which is inside RO memory. Add a ftrace_swap_func so that archs can use RO-memory-poke function to do the sorting. Signed-off-by: Song Liu --- include/linux/ftrace.h | 2 ++ kernel/trace/ftrace.c | 13 - 2 files changed, 14

[PATCH 10/13] modules, jitalloc: prepare to allocate executable memory as ROX

2023-06-01 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" When executable memory will be allocated as ROX it won't be possible to update it using memset() and memcpy(). Introduce jit_update_copy() and jit_update_set() APIs and use them in modules loading code instead of memcpy() and memset(). Signed-off-by: Mike Rapoport

[PATCH 09/13] kprobes: remove dependcy on CONFIG_MODULES

2023-06-01 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" kprobes depended on CONFIG_MODULES because it has to allocate memory for code. Since code allocations are now implemented with jitalloc, kprobes can be enabled in non-modular kernels. Add #ifdef CONFIG_MODULE guars for the code dealing with kprobes inside modules,

[PATCH 08/13] arch: make jitalloc setup available regardless of CONFIG_MODULES

2023-06-01 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" jitalloc does not depend on modules, on the contrary modules use jitalloc. To make jitalloc available when CONFIG_MODULES=n, for instance for kprobes, split jit_alloc_params initialization out from arch/kernel/module.c and compile it when CONFIG_JIT_ALLOC=y

[PATCH 07/13] x86/ftrace: enable dynamic ftrace without CONFIG_MODULES

2023-06-01 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" Dynamic ftrace must allocate memory for code and this was impossible without CONFIG_MODULES. With jitalloc separated from the modules code, the jit_text_alloc() is available regardless of CONFIG_MODULE. Move jitalloc initialization to x86/mm/init.c so that it won't

[PATCH 06/13] mm/jitalloc: introduce jit_data_alloc()

2023-06-01 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" Data related to code allocations, such as module data section, need to comply with architecture constraints for its placement and its allocation right now was done using jit_text_alloc(). Create a dedicated API for allocating data related to code allocations and

[PATCH 05/13] module, jitalloc: drop module_alloc

2023-06-01 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" Define default parameters for address range for code allocations using the current values in module_alloc() and make jit_text_alloc() use these defaults when an architecure does not supply its specific parameters. With this, jit_text_alloc() implements memory

[PATCH 04/13] mm/jitalloc, arch: convert remaining overrides of module_alloc to jitalloc

2023-06-01 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" Extend jitalloc parameters to accommodate more complex overrides of module_alloc() by architectures. This includes specification of a fallback range required by arm, arm64 and powerpc and support for allocation of KASAN shadow required by arm64, s390 and x86. The

[PATCH 03/13] mm/jitalloc, arch: convert simple overrides of module_alloc to jitalloc

2023-06-01 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" Several architectures override module_alloc() only to define address range for code allocations different than VMALLOC address space. Provide a generic implementation in jitalloc that uses the parameters for address space ranges, required alignment and page

[PATCH 02/13] mm: introduce jit_text_alloc() and use it instead of module_alloc()

2023-06-01 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" module_alloc() is used everywhere as a mean to allocate memory for code. Beside being semantically wrong, this unnecessarily ties all subsystmes that need to allocate code, such as ftrace, kprobes and BPF to modules and puts the burden of code allocation to the

[PATCH 01/13] nios2: define virtual address space for modules

2023-06-01 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" nios2 uses kmalloc() to implement module_alloc() because CALL26/PCREL26 cannot reach all of vmalloc address space. Define module space as 32MiB below the kernel base and switch nios2 to use vmalloc for module allocations. Suggested-by: Thomas Gleixner

[PATCH 00/13] mm: jit/text allocator

2023-06-01 Thread Mike Rapoport
From: "Mike Rapoport (IBM)" Hi, module_alloc() is used everywhere as a mean to allocate memory for code. Beside being semantically wrong, this unnecessarily ties all subsystmes that need to allocate code, such as ftrace, kprobes and BPF to modules and puts the burden of code allocation to the

Re: [PATCH v2 0/3] Remove iommu_group_remove_device() from fsl

2023-06-01 Thread Joerg Roedel
On Wed, May 31, 2023 at 05:04:04PM +1000, Michael Ellerman wrote: > Great, yep consider it: > > Tested-by: Michael Ellerman Alright, applied them for 6.5.

Re: [PATCH v3 30/34] sh: Convert pte_free_tlb() to use ptdescs

2023-06-01 Thread Vishal Moola
On Thu, Jun 1, 2023 at 12:28 AM John Paul Adrian Glaubitz wrote: > > Hi Geert! > > On Thu, 2023-06-01 at 09:20 +0200, Geert Uytterhoeven wrote: > > On Wed, May 31, 2023 at 11:33 PM Vishal Moola (Oracle) > > wrote: > > > Part of the conversions to replace pgtable constructor/destructors with > >

Re: [PATCH v3 25/34] m68k: Convert various functions to use ptdescs

2023-06-01 Thread Vishal Moola
On Thu, Jun 1, 2023 at 12:40 AM Geert Uytterhoeven wrote: > > Hi Vishal, > > On Wed, May 31, 2023 at 11:32 PM Vishal Moola (Oracle) > wrote: > > As part of the conversions to replace pgtable constructor/destructors with > > ptdesc equivalents, convert various page table functions to use ptdescs.

Re: [PATCH v3 30/34] sh: Convert pte_free_tlb() to use ptdescs

2023-06-01 Thread John Paul Adrian Glaubitz
On Thu, 2023-06-01 at 09:42 +0200, Geert Uytterhoeven wrote: > Hi Adrian, > > On Thu, Jun 1, 2023 at 9:28 AM John Paul Adrian Glaubitz > wrote: > > On Thu, 2023-06-01 at 09:20 +0200, Geert Uytterhoeven wrote: > > > On Wed, May 31, 2023 at 11:33 PM Vishal Moola (Oracle) > > > wrote: > > > > Part

Re: [PATCH v3 30/34] sh: Convert pte_free_tlb() to use ptdescs

2023-06-01 Thread Geert Uytterhoeven
Hi Adrian, On Thu, Jun 1, 2023 at 9:28 AM John Paul Adrian Glaubitz wrote: > On Thu, 2023-06-01 at 09:20 +0200, Geert Uytterhoeven wrote: > > On Wed, May 31, 2023 at 11:33 PM Vishal Moola (Oracle) > > wrote: > > > Part of the conversions to replace pgtable constructor/destructors with > > >

Re: [PATCH v3 25/34] m68k: Convert various functions to use ptdescs

2023-06-01 Thread Geert Uytterhoeven
Hi Vishal, On Wed, May 31, 2023 at 11:32 PM Vishal Moola (Oracle) wrote: > As part of the conversions to replace pgtable constructor/destructors with > ptdesc equivalents, convert various page table functions to use ptdescs. > > Some of the functions use the *get*page*() helper functions.

Re: [PATCH] MAINTAINERS: Exclude m68k-only drivers from powerpc entry

2023-06-01 Thread Michael Ellerman
Finn Thain writes: > On Wed, 31 May 2023, Geert Uytterhoeven wrote: >> On Wed, May 31, 2023 at 2:50 PM Michael Ellerman wrote: >> > The powerpc section has a "F:" entry for drivers/macintosh, matching >> > all files in or below drivers/macintosh. That is correct for the most >> > part, but

Re: [PATCH] MAINTAINERS: Exclude m68k-only drivers from powerpc entry

2023-06-01 Thread Michael Ellerman
Geert Uytterhoeven writes: > Hi Michael, > > CC Finn > > On Wed, May 31, 2023 at 2:50 PM Michael Ellerman wrote: >> The powerpc section has a "F:" entry for drivers/macintosh, matching all >> files in or below drivers/macintosh. That is correct for the most part, >> but there are a couple of

Re: [PATCH v3 30/34] sh: Convert pte_free_tlb() to use ptdescs

2023-06-01 Thread John Paul Adrian Glaubitz
Hi Geert! On Thu, 2023-06-01 at 09:20 +0200, Geert Uytterhoeven wrote: > On Wed, May 31, 2023 at 11:33 PM Vishal Moola (Oracle) > wrote: > > Part of the conversions to replace pgtable constructor/destructors with > > ptdesc equivalents. Also cleans up some spacing issues. > > > > Signed-off-by:

Re: [PATCH v3 30/34] sh: Convert pte_free_tlb() to use ptdescs

2023-06-01 Thread Geert Uytterhoeven
On Wed, May 31, 2023 at 11:33 PM Vishal Moola (Oracle) wrote: > Part of the conversions to replace pgtable constructor/destructors with > ptdesc equivalents. Also cleans up some spacing issues. > > Signed-off-by: Vishal Moola (Oracle) LGTM, so Reviewed-by: Geert Uytterhoeven

Re: [PATCH] macintosh: Switch i2c drivers back to use .probe()

2023-06-01 Thread Jean Delvare
On Tue, 23 May 2023 21:50:53 +0200, Uwe Kleine-König wrote: > After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new() > call-back type"), all drivers being converted to .probe_new() and then > 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert > back to (the new)