* linux-next: boot failure after merge of the dma-mapping tree
@ 2025-07-09 13:39 Stephen Rothwell
2025-07-09 17:41 ` Leon Romanovsky
2025-07-09 18:16 ` Leon Romanovsky
0 siblings, 2 replies; 9+ messages in thread
From: Stephen Rothwell @ 2025-07-09 13:39 UTC (permalink / raw)
To: Marek Szyprowski
Cc: Leon Romanovsky, Leon Romanovsky, Linux Kernel Mailing List,
Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 1675 bytes --]
Hi all,
After merging the dma-mapping tree, today's linux-next qemu boot test
(powerpc pseries_le_defconfig) failed like this:
[ 0.219439][ T1] ibmvscsi 71000003: SRP_VERSION: 16.a
[ 0.219472][ T1] ibmvscsi 71000003: Error -4 opening adapter
[ 0.219507][ T1] ibmvscsi 71000003: couldn't initialize crq. rc=-1
[ 0.221963][ T1] ibmvscsi 71000003: probe with driver ibmvscsi failed with error -1
The normal output is:
[ 0.221208][ T1] ibmvscsi 71000003: SRP_VERSION: 16.a
[ 0.221272][ T1] ibmvscsi 71000003: Maximum ID: 64 Maximum LUN: 32 Maximum Channel: 3
[ 0.221310][ T1] scsi host0: IBM POWER Virtual SCSI Adapter 1.5.9
[ 0.221653][ C0] ibmvscsi 71000003: partner initialization complete
[ 0.221696][ C0] ibmvscsi 71000003: host srp version: 16.a, host partition qemu (0), OS 2, max io 2097152
[ 0.221752][ C0] ibmvscsi 71000003: sent SRP login
[ 0.221778][ C0] ibmvscsi 71000003: SRP_LOGIN succeeded
[ 0.223269][ T1] scsi 0:0:2:0: CD-ROM QEMU QEMU CD-ROM 2.5+ PQ: 0 ANSI: 5
[ 0.239389][ T28] Freeing initrd memory: 1844K
[ 0.302192][ C0] sr 0:0:2:0: Power-on or device reset occurred
[ 0.302411][ T1] sr 0:0:2:0: [sr0] scsi3-mmc drive: 16x/50x cd/rw xa/form2 cdda tray
[ 0.302450][ T1] cdrom: Uniform CD-ROM driver Revision: 3.20
[ 0.302800][ T1] sr 0:0:2:0: Attached scsi generic sg0 type 5
Bisectd to commit
ec7352735abf ("dma-mapping: export new dma_*map_phys() interface")
And reverting that commit, and the following one, in today's linux-next
release, fixes the problem.
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: linux-next: boot failure after merge of the dma-mapping tree
2025-07-09 13:39 linux-next: boot failure after merge of the dma-mapping tree Stephen Rothwell
@ 2025-07-09 17:41 ` Leon Romanovsky
2025-07-09 23:46 ` Stephen Rothwell
2025-07-09 18:16 ` Leon Romanovsky
1 sibling, 1 reply; 9+ messages in thread
From: Leon Romanovsky @ 2025-07-09 17:41 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Marek Szyprowski, Linux Kernel Mailing List,
Linux Next Mailing List, Christoph Hellwig, Jason Gunthorpe
On Wed, Jul 09, 2025 at 11:39:53PM +1000, Stephen Rothwell wrote:
> Hi all,
>
> After merging the dma-mapping tree, today's linux-next qemu boot test
> (powerpc pseries_le_defconfig) failed like this:
>
> [ 0.219439][ T1] ibmvscsi 71000003: SRP_VERSION: 16.a
> [ 0.219472][ T1] ibmvscsi 71000003: Error -4 opening adapter
> [ 0.219507][ T1] ibmvscsi 71000003: couldn't initialize crq. rc=-1
> [ 0.221963][ T1] ibmvscsi 71000003: probe with driver ibmvscsi failed with error -1
>
> The normal output is:
>
> [ 0.221208][ T1] ibmvscsi 71000003: SRP_VERSION: 16.a
> [ 0.221272][ T1] ibmvscsi 71000003: Maximum ID: 64 Maximum LUN: 32 Maximum Channel: 3
> [ 0.221310][ T1] scsi host0: IBM POWER Virtual SCSI Adapter 1.5.9
> [ 0.221653][ C0] ibmvscsi 71000003: partner initialization complete
> [ 0.221696][ C0] ibmvscsi 71000003: host srp version: 16.a, host partition qemu (0), OS 2, max io 2097152
> [ 0.221752][ C0] ibmvscsi 71000003: sent SRP login
> [ 0.221778][ C0] ibmvscsi 71000003: SRP_LOGIN succeeded
> [ 0.223269][ T1] scsi 0:0:2:0: CD-ROM QEMU QEMU CD-ROM 2.5+ PQ: 0 ANSI: 5
> [ 0.239389][ T28] Freeing initrd memory: 1844K
> [ 0.302192][ C0] sr 0:0:2:0: Power-on or device reset occurred
> [ 0.302411][ T1] sr 0:0:2:0: [sr0] scsi3-mmc drive: 16x/50x cd/rw xa/form2 cdda tray
> [ 0.302450][ T1] cdrom: Uniform CD-ROM driver Revision: 3.20
> [ 0.302800][ T1] sr 0:0:2:0: Attached scsi generic sg0 type 5
>
> Bisectd to commit
>
> ec7352735abf ("dma-mapping: export new dma_*map_phys() interface")
>
> And reverting that commit, and the following one, in today's linux-next
> release, fixes the problem.
Stephen,
Can you please provide the kernel command line to determine which DMA
path is taken?
Thanks
>
> --
> Cheers,
> Stephen Rothwell
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: linux-next: boot failure after merge of the dma-mapping tree
2025-07-09 17:41 ` Leon Romanovsky
@ 2025-07-09 23:46 ` Stephen Rothwell
0 siblings, 0 replies; 9+ messages in thread
From: Stephen Rothwell @ 2025-07-09 23:46 UTC (permalink / raw)
To: Leon Romanovsky
Cc: Marek Szyprowski, Linux Kernel Mailing List,
Linux Next Mailing List, Christoph Hellwig, Jason Gunthorpe
[-- Attachment #1: Type: text/plain, Size: 704 bytes --]
Hi Leon,
On Wed, 9 Jul 2025 20:41:08 +0300 Leon Romanovsky <leon@kernel.org> wrote:
>
> Can you please provide the kernel command line to determine which DMA
> path is taken?
Sorry I did not respond earlier (your email arrived at 3:41am my time
:-)) but you seem to have figured it out, thanks. I will let you know
this evening if it has not worked.
For reference the qemu command line was
qemu-system-ppc64 -M pseries,cap-hpt-max-page-size=4k,accel=kvm -m 2G -vga none -nographic -enable-kvm -kernel $vmlinux -initrd $initrd
The kernel was a powercp pseries_le_defconfig build (but setting
CONFIG_PPC_4K_PAGES=y instead of CONFIG_PPC_64K_PAGES=y).
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: linux-next: boot failure after merge of the dma-mapping tree
2025-07-09 13:39 linux-next: boot failure after merge of the dma-mapping tree Stephen Rothwell
2025-07-09 17:41 ` Leon Romanovsky
@ 2025-07-09 18:16 ` Leon Romanovsky
2025-07-10 0:10 ` Stephen Rothwell
1 sibling, 1 reply; 9+ messages in thread
From: Leon Romanovsky @ 2025-07-09 18:16 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Marek Szyprowski, Linux Kernel Mailing List,
Linux Next Mailing List
On Wed, Jul 09, 2025 at 11:39:53PM +1000, Stephen Rothwell wrote:
> Hi all,
>
> After merging the dma-mapping tree, today's linux-next qemu boot test
> (powerpc pseries_le_defconfig) failed like this:
>
> [ 0.219439][ T1] ibmvscsi 71000003: SRP_VERSION: 16.a
> [ 0.219472][ T1] ibmvscsi 71000003: Error -4 opening adapter
> [ 0.219507][ T1] ibmvscsi 71000003: couldn't initialize crq. rc=-1
> [ 0.221963][ T1] ibmvscsi 71000003: probe with driver ibmvscsi failed with error -1
>
> The normal output is:
>
> [ 0.221208][ T1] ibmvscsi 71000003: SRP_VERSION: 16.a
> [ 0.221272][ T1] ibmvscsi 71000003: Maximum ID: 64 Maximum LUN: 32 Maximum Channel: 3
> [ 0.221310][ T1] scsi host0: IBM POWER Virtual SCSI Adapter 1.5.9
> [ 0.221653][ C0] ibmvscsi 71000003: partner initialization complete
> [ 0.221696][ C0] ibmvscsi 71000003: host srp version: 16.a, host partition qemu (0), OS 2, max io 2097152
> [ 0.221752][ C0] ibmvscsi 71000003: sent SRP login
> [ 0.221778][ C0] ibmvscsi 71000003: SRP_LOGIN succeeded
> [ 0.223269][ T1] scsi 0:0:2:0: CD-ROM QEMU QEMU CD-ROM 2.5+ PQ: 0 ANSI: 5
> [ 0.239389][ T28] Freeing initrd memory: 1844K
> [ 0.302192][ C0] sr 0:0:2:0: Power-on or device reset occurred
> [ 0.302411][ T1] sr 0:0:2:0: [sr0] scsi3-mmc drive: 16x/50x cd/rw xa/form2 cdda tray
> [ 0.302450][ T1] cdrom: Uniform CD-ROM driver Revision: 3.20
> [ 0.302800][ T1] sr 0:0:2:0: Attached scsi generic sg0 type 5
>
> Bisectd to commit
>
> ec7352735abf ("dma-mapping: export new dma_*map_phys() interface")
>
> And reverting that commit, and the following one, in today's linux-next
> release, fixes the problem.
I assume that this will fix the issue:
diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c
index 29e8594a725a..cb8936e4ffab 100644
--- a/kernel/dma/mapping.c
+++ b/kernel/dma/mapping.c
@@ -157,7 +157,7 @@ dma_addr_t dma_map_phys(struct device *dev, phys_addr_t phys, size_t size,
{
const struct dma_map_ops *ops = get_dma_ops(dev);
struct page *page = phys_to_page(phys);
- size_t offset = offset_in_page(page);
+ size_t offset = offset_in_page(phys);
bool is_pfn_valid = true;
dma_addr_t addr;
>
> --
> Cheers,
> Stephen Rothwell
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: linux-next: boot failure after merge of the dma-mapping tree
2025-07-09 18:16 ` Leon Romanovsky
@ 2025-07-10 0:10 ` Stephen Rothwell
0 siblings, 0 replies; 9+ messages in thread
From: Stephen Rothwell @ 2025-07-10 0:10 UTC (permalink / raw)
To: Leon Romanovsky
Cc: Marek Szyprowski, Linux Kernel Mailing List,
Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 847 bytes --]
Hi Leon,
On Wed, 9 Jul 2025 21:16:31 +0300 Leon Romanovsky <leon@kernel.org> wrote:
>
> I assume that this will fix the issue:
>
> diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c
> index 29e8594a725a..cb8936e4ffab 100644
> --- a/kernel/dma/mapping.c
> +++ b/kernel/dma/mapping.c
> @@ -157,7 +157,7 @@ dma_addr_t dma_map_phys(struct device *dev, phys_addr_t phys, size_t size,
> {
> const struct dma_map_ops *ops = get_dma_ops(dev);
> struct page *page = phys_to_page(phys);
> - size_t offset = offset_in_page(page);
> + size_t offset = offset_in_page(phys);
> bool is_pfn_valid = true;
> dma_addr_t addr;
I found time to test the above on top of yesterday's linux-next and it
fixes the problem for me. Thanks again.
Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* linux-next: boot failure after merge of the dma-mapping tree
@ 2020-08-20 5:51 Stephen Rothwell
2020-08-20 8:36 ` Nicolin Chen
0 siblings, 1 reply; 9+ messages in thread
From: Stephen Rothwell @ 2020-08-20 5:51 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Linux Next Mailing List, Linux Kernel Mailing List, Nicolin Chen
[-- Attachment #1: Type: text/plain, Size: 4412 bytes --]
Hi all,
After merging the dma-mapping tree, today's linux-next build (powerpc
pseries_le_defconfig) failed like this:
[ 1.829053][ T1] ------------[ cut here ]------------
[ 1.829629][ T1] kernel BUG at include/linux/iommu-helper.h:21!
[ 1.830182][ T1] Oops: Exception in kernel mode, sig: 5 [#1]
[ 1.830302][ T1] LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries
[ 1.830436][ T1] Modules linked in:
[ 1.830879][ T1] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.9.0-rc1 #2
[ 1.831042][ T1] NIP: c0000000006f4944 LR: c0000000006f4924 CTR: c00000000004aa10
[ 1.831174][ T1] REGS: c00000007e3a31e0 TRAP: 0700 Not tainted (5.9.0-rc1)
[ 1.831243][ T1] MSR: 8000000002029033 <SF,VEC,EE,ME,IR,DR,RI,LE> CR: 44022422 XER: 20000000
[ 1.831574][ T1] CFAR: c0000000006b3084 IRQMASK: 1
[ 1.831574][ T1] GPR00: c0000000006f4924 c00000007e3a3470 c000000001289000 0000000000000001
[ 1.831574][ T1] GPR04: 0000000000000000 0000000000000003 0000000000000040 0000000000000000
[ 1.831574][ T1] GPR08: 0000000000000001 0000000000000000 fffffffffffffffe c00c000000000000
[ 1.831574][ T1] GPR12: 0000000024028420 c0000000014b0000 c00000007e9cd000 0000000000000001
[ 1.831574][ T1] GPR16: 0000000000000000 0000000000000000 c00000007e9cd100 c00000007e9cd118
[ 1.831574][ T1] GPR20: 00000000ffffffff 0000000000000000 0000000000000001 0000000000000000
[ 1.831574][ T1] GPR24: 0000000000000000 ffffffffffffffff c00000007eb20000 0000000000000000
[ 1.831574][ T1] GPR28: 0000000000000001 000000000000bfff 0000000000000000 0000000000000001
[ 1.833145][ T1] NIP [c0000000006f4944] iommu_area_alloc+0xa4/0x170
[ 1.833271][ T1] LR [c0000000006f4924] iommu_area_alloc+0x84/0x170
[ 1.833494][ T1] Call Trace:
[ 1.833686][ T1] [c00000007e3a3470] [c0000000006f4924] iommu_area_alloc+0x84/0x170 (unreliable)
[ 1.833961][ T1] [c00000007e3a34e0] [c00000000004b034] iommu_range_alloc+0x1a4/0x410
[ 1.834116][ T1] [c00000007e3a35a0] [c00000000004b650] iommu_alloc+0x60/0x130
[ 1.834248][ T1] [c00000007e3a35f0] [c00000000004c6c8] iommu_map_page+0xd8/0x210
[ 1.834381][ T1] [c00000007e3a3680] [c00000000004aa70] dma_iommu_map_page+0x60/0x80
[ 1.834502][ T1] [c00000007e3a36a0] [c0000000001cce30] dma_map_page_attrs+0x190/0x260
[ 1.834628][ T1] [c00000007e3a3750] [c00000000086195c] ibmvscsi_probe+0x12c/0xa2c
[ 1.834768][ T1] [c00000007e3a3830] [c0000000000e049c] vio_bus_probe+0x9c/0x460
[ 1.834880][ T1] [c00000007e3a38d0] [c0000000007f2cbc] really_probe+0x12c/0x4e0
[ 1.834993][ T1] [c00000007e3a3970] [c0000000007f3308] driver_probe_device+0x88/0x120
[ 1.835108][ T1] [c00000007e3a39a0] [c0000000007f36ec] device_driver_attach+0xcc/0xe0
[ 1.835220][ T1] [c00000007e3a39e0] [c0000000007f3780] __driver_attach+0x80/0x140
[ 1.835321][ T1] [c00000007e3a3a20] [c0000000007ef9a8] bus_for_each_dev+0xa8/0x130
[ 1.835429][ T1] [c00000007e3a3a80] [c0000000007f2394] driver_attach+0x34/0x50
[ 1.835534][ T1] [c00000007e3a3aa0] [c0000000007f1878] bus_add_driver+0x1e8/0x2b0
[ 1.835647][ T1] [c00000007e3a3b30] [c0000000007f47f8] driver_register+0x98/0x1a0
[ 1.835782][ T1] [c00000007e3a3ba0] [c0000000000df4bc] __vio_register_driver+0x4c/0x60
[ 1.835938][ T1] [c00000007e3a3bc0] [c000000000f8d924] ibmvscsi_module_init+0xa4/0xdc
[ 1.836056][ T1] [c00000007e3a3c00] [c000000000012430] do_one_initcall+0x60/0x2b0
[ 1.836175][ T1] [c00000007e3a3cd0] [c000000000f44740] kernel_init_freeable+0x2e0/0x378
[ 1.836287][ T1] [c00000007e3a3db0] [c000000000012a24] kernel_init+0x2c/0x158
[ 1.836509][ T1] [c00000007e3a3e20] [c00000000000d9d0] ret_from_kernel_thread+0x5c/0x6c
[ 1.836717][ T1] Instruction dump:
[ 1.836904][ T1] 2da90000 f8010010 f821ff91 4bfbe669 60000000 7c3d1840 7c7f1b78 40810074
[ 1.837082][ T1] 60000000 60000000 60000000 40920010 <0fe00000> 60000000 60000000 408efff4
[ 1.838497][ T1] ---[ end trace e9dbc52052087399 ]---
The BUG is
BUG_ON(!is_power_of_2(boundary_size));
in iommu_is_span_boundary()
Bisected to commit
04d324bf549d ("dma-mapping: set default segment_boundary_mask to ULONG_MAX")
I have reverted that commit for today.
--
Cheers,
Stephen Rothwell
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: linux-next: boot failure after merge of the dma-mapping tree
2020-08-20 5:51 Stephen Rothwell
@ 2020-08-20 8:36 ` Nicolin Chen
2020-08-20 15:49 ` Christoph Hellwig
0 siblings, 1 reply; 9+ messages in thread
From: Nicolin Chen @ 2020-08-20 8:36 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Christoph Hellwig, Linux Next Mailing List,
Linux Kernel Mailing List
Hi Stephen,
On Thu, Aug 20, 2020 at 03:51:12PM +1000, Stephen Rothwell wrote:
> Hi all,
>
> After merging the dma-mapping tree, today's linux-next build (powerpc
> pseries_le_defconfig) failed like this:
>
> [ 1.829053][ T1] ------------[ cut here ]------------
> [ 1.829629][ T1] kernel BUG at include/linux/iommu-helper.h:21!
> [ 1.830182][ T1] Oops: Exception in kernel mode, sig: 5 [#1]
> [ 1.830302][ T1] LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries
> [ 1.830436][ T1] Modules linked in:
> [ 1.830879][ T1] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.9.0-rc1 #2
> [ 1.831042][ T1] NIP: c0000000006f4944 LR: c0000000006f4924 CTR: c00000000004aa10
> [ 1.831174][ T1] REGS: c00000007e3a31e0 TRAP: 0700 Not tainted (5.9.0-rc1)
> [ 1.831243][ T1] MSR: 8000000002029033 <SF,VEC,EE,ME,IR,DR,RI,LE> CR: 44022422 XER: 20000000
> [ 1.831574][ T1] CFAR: c0000000006b3084 IRQMASK: 1
> [ 1.831574][ T1] GPR00: c0000000006f4924 c00000007e3a3470 c000000001289000 0000000000000001
> [ 1.831574][ T1] GPR04: 0000000000000000 0000000000000003 0000000000000040 0000000000000000
> [ 1.831574][ T1] GPR08: 0000000000000001 0000000000000000 fffffffffffffffe c00c000000000000
> [ 1.831574][ T1] GPR12: 0000000024028420 c0000000014b0000 c00000007e9cd000 0000000000000001
> [ 1.831574][ T1] GPR16: 0000000000000000 0000000000000000 c00000007e9cd100 c00000007e9cd118
> [ 1.831574][ T1] GPR20: 00000000ffffffff 0000000000000000 0000000000000001 0000000000000000
> [ 1.831574][ T1] GPR24: 0000000000000000 ffffffffffffffff c00000007eb20000 0000000000000000
> [ 1.831574][ T1] GPR28: 0000000000000001 000000000000bfff 0000000000000000 0000000000000001
> [ 1.833145][ T1] NIP [c0000000006f4944] iommu_area_alloc+0xa4/0x170
> [ 1.833271][ T1] LR [c0000000006f4924] iommu_area_alloc+0x84/0x170
> [ 1.833494][ T1] Call Trace:
> [ 1.833686][ T1] [c00000007e3a3470] [c0000000006f4924] iommu_area_alloc+0x84/0x170 (unreliable)
> [ 1.833961][ T1] [c00000007e3a34e0] [c00000000004b034] iommu_range_alloc+0x1a4/0x410
> [ 1.834116][ T1] [c00000007e3a35a0] [c00000000004b650] iommu_alloc+0x60/0x130
> [ 1.834248][ T1] [c00000007e3a35f0] [c00000000004c6c8] iommu_map_page+0xd8/0x210
> [ 1.834381][ T1] [c00000007e3a3680] [c00000000004aa70] dma_iommu_map_page+0x60/0x80
> [ 1.834502][ T1] [c00000007e3a36a0] [c0000000001cce30] dma_map_page_attrs+0x190/0x260
> [ 1.834628][ T1] [c00000007e3a3750] [c00000000086195c] ibmvscsi_probe+0x12c/0xa2c
> [ 1.834768][ T1] [c00000007e3a3830] [c0000000000e049c] vio_bus_probe+0x9c/0x460
> [ 1.834880][ T1] [c00000007e3a38d0] [c0000000007f2cbc] really_probe+0x12c/0x4e0
> [ 1.834993][ T1] [c00000007e3a3970] [c0000000007f3308] driver_probe_device+0x88/0x120
> [ 1.835108][ T1] [c00000007e3a39a0] [c0000000007f36ec] device_driver_attach+0xcc/0xe0
> [ 1.835220][ T1] [c00000007e3a39e0] [c0000000007f3780] __driver_attach+0x80/0x140
> [ 1.835321][ T1] [c00000007e3a3a20] [c0000000007ef9a8] bus_for_each_dev+0xa8/0x130
> [ 1.835429][ T1] [c00000007e3a3a80] [c0000000007f2394] driver_attach+0x34/0x50
> [ 1.835534][ T1] [c00000007e3a3aa0] [c0000000007f1878] bus_add_driver+0x1e8/0x2b0
> [ 1.835647][ T1] [c00000007e3a3b30] [c0000000007f47f8] driver_register+0x98/0x1a0
> [ 1.835782][ T1] [c00000007e3a3ba0] [c0000000000df4bc] __vio_register_driver+0x4c/0x60
> [ 1.835938][ T1] [c00000007e3a3bc0] [c000000000f8d924] ibmvscsi_module_init+0xa4/0xdc
> [ 1.836056][ T1] [c00000007e3a3c00] [c000000000012430] do_one_initcall+0x60/0x2b0
> [ 1.836175][ T1] [c00000007e3a3cd0] [c000000000f44740] kernel_init_freeable+0x2e0/0x378
> [ 1.836287][ T1] [c00000007e3a3db0] [c000000000012a24] kernel_init+0x2c/0x158
> [ 1.836509][ T1] [c00000007e3a3e20] [c00000000000d9d0] ret_from_kernel_thread+0x5c/0x6c
> [ 1.836717][ T1] Instruction dump:
> [ 1.836904][ T1] 2da90000 f8010010 f821ff91 4bfbe669 60000000 7c3d1840 7c7f1b78 40810074
> [ 1.837082][ T1] 60000000 60000000 60000000 40920010 <0fe00000> 60000000 60000000 408efff4
> [ 1.838497][ T1] ---[ end trace e9dbc52052087399 ]---
>
> The BUG is
>
> BUG_ON(!is_power_of_2(boundary_size));
>
> in iommu_is_span_boundary()
Took a quick look -- the boundary_size is seemingly passed from
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/powerpc/kernel/iommu.c#n240
boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1,
1 << tbl->it_page_shift);
Looks like an overflow happens due to (ULONG_MAX + 1). Should
we fix here instead (or also)?
Thanks
Nic
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: linux-next: boot failure after merge of the dma-mapping tree
2020-08-20 8:36 ` Nicolin Chen
@ 2020-08-20 15:49 ` Christoph Hellwig
2020-08-20 20:31 ` Nicolin Chen
0 siblings, 1 reply; 9+ messages in thread
From: Christoph Hellwig @ 2020-08-20 15:49 UTC (permalink / raw)
To: Nicolin Chen
Cc: Stephen Rothwell, Christoph Hellwig, Linux Next Mailing List,
Linux Kernel Mailing List
On Thu, Aug 20, 2020 at 01:36:17AM -0700, Nicolin Chen wrote:
> Took a quick look -- the boundary_size is seemingly passed from
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/powerpc/kernel/iommu.c#n240
>
> boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1,
> 1 << tbl->it_page_shift);
>
> Looks like an overflow happens due to (ULONG_MAX + 1). Should
> we fix here instead (or also)?
Yes, please. I'll drop the patch again for now, but once we've
got this sorted out I'll readd it.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: linux-next: boot failure after merge of the dma-mapping tree
2020-08-20 15:49 ` Christoph Hellwig
@ 2020-08-20 20:31 ` Nicolin Chen
0 siblings, 0 replies; 9+ messages in thread
From: Nicolin Chen @ 2020-08-20 20:31 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Stephen Rothwell, Linux Next Mailing List,
Linux Kernel Mailing List
On Thu, Aug 20, 2020 at 05:49:41PM +0200, Christoph Hellwig wrote:
> On Thu, Aug 20, 2020 at 01:36:17AM -0700, Nicolin Chen wrote:
> > Took a quick look -- the boundary_size is seemingly passed from
> > https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/powerpc/kernel/iommu.c#n240
> >
> > boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1,
> > 1 << tbl->it_page_shift);
> >
> > Looks like an overflow happens due to (ULONG_MAX + 1). Should
> > we fix here instead (or also)?
>
> Yes, please. I'll drop the patch again for now, but once we've
> got this sorted out I'll readd it.
I'll send a series of changes, as I found these...
1 145 arch/alpha/kernel/pci_iommu.c <<iommu_arena_find_pages>>
boundary_size = dma_get_seg_boundary(dev) + 1;
2 488 arch/ia64/hp/common/sba_iommu.c <<sba_search_bitmap>>
boundary_size = (unsigned long long )dma_get_seg_boundary(dev) + 1;
3 266 arch/s390/pci/pci_dma.c <<__dma_alloc_iommu>>
boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1,
4 170 arch/sparc/kernel/iommu-common.c <<iommu_tbl_range_alloc>>
boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1,
5 475 arch/sparc/kernel/iommu.c <<dma_4u_map_sg>>
seg_boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1,
6 511 arch/sparc/kernel/pci_sun4v.c <<dma_4v_map_sg>>
seg_boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1,
7 97 arch/x86/kernel/amd_gart_64.c <<alloc_iommu>>
base_index = ALIGN(iommu_bus_base & dma_get_seg_boundary(dev),
8 99 arch/x86/kernel/amd_gart_64.c <<alloc_iommu>>
boundary_size = ALIGN((u64)dma_get_seg_boundary(dev) + 1,
9 359 drivers/parisc/ccio-dma.c <<ccio_alloc_range>>
boundary_size = ALIGN((unsigned long long )dma_get_seg_boundary(dev) + 1,
10 110 drivers/parisc/iommu-helpers.h <<iommu_coalesce_chunks>>
unsigned int max_seg_boundary = dma_get_seg_boundary(dev) + 1;
11 345 drivers/parisc/sba_iommu.c <<sba_search_bitmap>>
boundary_size = ALIGN((unsigned long long )dma_get_seg_boundary(dev) + 1,
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-07-10 0:10 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-09 13:39 linux-next: boot failure after merge of the dma-mapping tree Stephen Rothwell
2025-07-09 17:41 ` Leon Romanovsky
2025-07-09 23:46 ` Stephen Rothwell
2025-07-09 18:16 ` Leon Romanovsky
2025-07-10 0:10 ` Stephen Rothwell
-- strict thread matches above, loose matches on Subject: below --
2020-08-20 5:51 Stephen Rothwell
2020-08-20 8:36 ` Nicolin Chen
2020-08-20 15:49 ` Christoph Hellwig
2020-08-20 20:31 ` Nicolin Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).