iommu/io-pgtable-arm: dynamically allocate selftest device struct
authorArnd Bergmann <arnd@arndb.de>
Wed, 23 Apr 2025 16:48:16 +0000 (18:48 +0200)
committerJoerg Roedel <jroedel@suse.de>
Mon, 28 Apr 2025 11:21:18 +0000 (13:21 +0200)
commitfa26198d30f3cdd7627ce47362057848219de765
tree22ad69bb3b5773bc85f0dcc9c49e97c8f7cb6e7f
parent21c03574df19f0d77cb2e4d28bc02c79b21e656a
iommu/io-pgtable-arm: dynamically allocate selftest device struct

In general a 'struct device' is way too large to be put on the kernel
stack. Apparently something just caused it to grow a slightly larger,
which pushed the arm_lpae_do_selftests() function over the warning
limit in some configurations:

drivers/iommu/io-pgtable-arm.c:1423:19: error: stack frame size (1032) exceeds limit (1024) in 'arm_lpae_do_selftests' [-Werror,-Wframe-larger-than]
 1423 | static int __init arm_lpae_do_selftests(void)
      |                   ^

Change the function to use a dynamically allocated faux_device
instead of the on-stack device structure.

Fixes: ca25ec247aad ("iommu/io-pgtable-arm: Remove iommu_dev==NULL special case")
Link: https://lore.kernel.org/all/ab75a444-22a1-47f5-b3c0-253660395b5a@arm.com/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/20250423164826.2931382-1-arnd@kernel.org
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/io-pgtable-arm.c