Skip to content

[PW_SID:1148143] irqchip/ast2700-intc: Avoid allocating in the irq_domain activate callback - #2489

Closed
linux-riscv-bot wants to merge 4 commits into
workflow__riscv__fixesfrom
pw1148143
Closed

[PW_SID:1148143] irqchip/ast2700-intc: Avoid allocating in the irq_domain activate callback#2489
linux-riscv-bot wants to merge 4 commits into
workflow__riscv__fixesfrom
pw1148143

Conversation

@linux-riscv-bot

Copy link
Copy Markdown

PR for series 1148143 applied to workflow__riscv__fixes

Name: irqchip/ast2700-intc: Avoid allocating in the irq_domain activate callback
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1148143
Version: 1

ThreeBottleCap and others added 4 commits August 14, 2026 14:12
…_RWX

When CONFIG_STRICT_MODULE_RWX is not set, execmem cannot create
temporary writable mappings for read-only executable pages. In this
case, the execmem ranges must already have writable permissions.

Currently EXECMEM_KPROBES unconditionally uses PAGE_KERNEL_READ_EXEC,
which causes kprobe instruction slot writes to trigger page faults
on systems where CONFIG_STRICT_MODULE_RWX is not enabled.

Fix this by using PAGE_KERNEL_EXEC when CONFIG_STRICT_MODULE_RWX
is not available.

Signed-off-by: Xiaofeng Yuan <xiaofengmian@163.com>
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Nam Cao <namcao@linutronix.de>
Link: https://patch.msgid.link/20260814082742.148403-2-xiaofengmian@163.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
patch_map() always creates a temporary writable mapping via fixmap for
kernel text addresses, even when CONFIG_STRICT_KERNEL_RWX is disabled
and the kernel text is already mapped with _PAGE_WRITE.

This is unnecessary overhead at best, and on minimal configurations
it can cause page faults.

Skip the fixmap path for kernel text when CONFIG_STRICT_KERNEL_RWX
is not enabled, since the text pages are already writable in that case.
The module text path is already gated on CONFIG_STRICT_MODULE_RWX and
is kept unchanged.

Reported-by: Klara Modin <klara@kasm.eu>
Closes: https://lore.kernel.org/all/ant_8TaBbov_GS4i@soda.int.kasm.eu/
Reported-by: Lad Prabhakar <prabhakar.csengg@gmail.com>
Closes: https://lore.kernel.org/all/CA+V-a8tQK8rih9SGGTyqrEBGpNkx4H0eX2YccCRrgkVAPr+EBg@mail.gmail.com/
Tested-by: Klara Modin <klarasmodin@gmail.com>
Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Link: https://patch.msgid.link/20260814082742.148403-3-xiaofengmian@163.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
…lback

The IRQ core calls the irq_domain .activate callback from __setup_irq()
with desc->lock held and interrupts disabled. Both
aspeed_intc1_irq_domain_activate() and the aspeed_intc0_resolve_route()
it invokes test a compatible string with fwnode_device_is_compatible(),
which wraps fwnode_property_match_string() and allocates with GFP_KERNEL.

Besides sleeping in atomic context, that makes the irq_desc lock depend
on fs_reclaim, which lockdep reports as an inversion because
irq_desc_lock_class is also taken in hardirq context:

  WARNING: possible irq lock inversion dependency detected
  swapper/0/0 just changed the state of lock:
  (&irq_desc_lock_class){-...}-{2:2}, at: handle_level_irq+0x28/0x168
  but this lock took another, HARDIRQ-unsafe lock in the past:
   (fs_reclaim){+.+.}-{0:0}
  ...
    fs_reclaim_acquire
    __kmalloc_noprof
    fwnode_property_match_string
    aspeed_intc0_resolve_route
    aspeed_intc1_irq_domain_activate

Both call sites are only ever handed OF nodes, so use
of_device_is_compatible() instead: it walks the property in place and
does not allocate.

Fixes: 07825e4 ("irqchip/ast2700-intc: Add AST2700-A2 support")
Reported-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Signed-off-by: Ryan Chen <ryan_chen@aspeedtech.com>
Tested-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "irqchip/ast2700-intc: Avoid allocating in the irq_domain activate callback"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 143.46 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "irqchip/ast2700-intc: Avoid allocating in the irq_domain activate callback"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1447.49 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "irqchip/ast2700-intc: Avoid allocating in the irq_domain activate callback"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1741.36 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "irqchip/ast2700-intc: Avoid allocating in the irq_domain activate callback"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.52 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "irqchip/ast2700-intc: Avoid allocating in the irq_domain activate callback"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.99 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "irqchip/ast2700-intc: Avoid allocating in the irq_domain activate callback"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.13 seconds
Result: WARNING
Output:

WARNING: Reported-by: should be immediately followed by Closes: or Link: with a URL to the report
#34: 
Reported-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Signed-off-by: Ryan Chen <ryan_chen@aspeedtech.com>

total: 0 errors, 1 warnings, 0 checks, 17 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 76fcb9dce8a1 ("irqchip/ast2700-intc: Avoid allocating in the irq_domain activate callback") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 1 warnings, 0 checks, 17 lines checked
WARNING: Reported-by: should be immediately followed by Closes: or Link: with a URL to the report


@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "irqchip/ast2700-intc: Avoid allocating in the irq_domain activate callback"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 87.08 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "irqchip/ast2700-intc: Avoid allocating in the irq_domain activate callback"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "irqchip/ast2700-intc: Avoid allocating in the irq_domain activate callback"
kdoc
Desc: Detects for kdoc errors
Duration: 0.88 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "irqchip/ast2700-intc: Avoid allocating in the irq_domain activate callback"
module-param
Desc: Detect module_param changes
Duration: 0.28 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "irqchip/ast2700-intc: Avoid allocating in the irq_domain activate callback"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "irqchip/ast2700-intc: Avoid allocating in the irq_domain activate callback"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.47 seconds
Result: PASS

@linux-riscv-bot
linux-riscv-bot force-pushed the workflow__riscv__fixes branch 2 times, most recently from bb1a926 to 6f6f7c0 Compare August 21, 2026 03:35
@linux-riscv-bot
linux-riscv-bot deleted the pw1148143 branch August 27, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants