All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] swiotlb: swiotlb_tbl_map_single() kernel BUG in iommu-helper.h:30
@ 2021-02-26 20:43 ` Brad Larson
  0 siblings, 0 replies; 7+ messages in thread
From: Brad Larson @ 2021-02-26 20:43 UTC (permalink / raw)
  To: hch, konrad.wilk, m.szyprowski, robin.murphy, iommu, linux-kernel
  Cc: Brad Larson

Kernel Oops introduced in next-20210222 due to get_max_slots return arg size.
In the function find_slots() variable max_slots is zero when boundary_mask is
0xffffffffffffffff.

[    0.242119] kernel BUG at ./include/linux/iommu-helper.h:30!
[    0.247793] Internal error: Oops - BUG: 0 [#1] SMP
[    0.252595] Modules linked in:
[    0.255657] CPU: 0 PID: 93 Comm: kworker/0:1 Not tainted 5.11.0-next-20210224+ #25
[    0.263245] Hardware name: Elba ASIC Board (DT)
[    0.267784] Workqueue: events_freezable mmc_rescan
[    0.272592] pstate: 60000085 (nZCv daIf -PAN -UAO -TCO BTYPE=--)
[    0.278612] pc : swiotlb_tbl_map_single+0x2b0/0x6a0
[    0.283505] lr : swiotlb_tbl_map_single+0x440/0x6a0
[    0.288395] sp : ffffffc0122736b0
[    0.291713] x29: ffffffc0122736b0 x28: ffffffc010e30000
[    0.297039] x27: 00000000bbf58000 x26: 0000000000000000
[    0.302364] x25: 0000000000000000 x24: 0000000000000001
[    0.307689] x23: 0000000000000000 x22: 0000000000000000
[    0.313013] x21: 0000000000000000 x20: 0000000000000000
[    0.318338] x19: 0000001241fd4600 x18: ffffffc010d288c8
[    0.323662] x17: 0000000000000007 x16: 0000000000000001
[    0.328987] x15: ffffffc092273367 x14: 3a424c54204f4920
[    0.334311] x13: 6572617774666f73 x12: 20726e2030207865
[    0.339636] x11: 646e692078787820 x10: 3062653737317830
[    0.344960] x9 : 2074666968732031 x8 : ffffff977cf82368
[    0.350285] x7 : 0000000000000001 x6 : c0000000ffffefff
[    0.355609] x5 : 0000000000017fe8 x4 : 0000000000000000
[    0.360934] x3 : 0000000000000000 x2 : 18b0d50da009d000
[    0.366258] x1 : 0000000000000000 x0 : 0000000000000042
[    0.371583] Call trace:
[    0.374032]  swiotlb_tbl_map_single+0x2b0/0x6a0
[    0.378573]  swiotlb_map+0xa8/0x2b0

Signed-off-by: Brad Larson <brad@pensando.io>
---
 kernel/dma/swiotlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 369e4c3a0f2b..c10e855a03bc 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -534,7 +534,7 @@ static int find_slots(struct device *dev, phys_addr_t orig_addr,
 	unsigned long boundary_mask = dma_get_seg_boundary(dev);
 	dma_addr_t tbl_dma_addr =
 		phys_to_dma_unencrypted(dev, io_tlb_start) & boundary_mask;
-	unsigned int max_slots = get_max_slots(boundary_mask);
+	unsigned long max_slots = get_max_slots(boundary_mask);
 	unsigned int iotlb_align_mask =
 		dma_get_min_align_mask(dev) & ~(IO_TLB_SIZE - 1);
 	unsigned int nslots = nr_slots(alloc_size), stride;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] swiotlb: swiotlb_tbl_map_single() kernel BUG in iommu-helper.h:30
@ 2021-02-26 20:43 ` Brad Larson
  0 siblings, 0 replies; 7+ messages in thread
From: Brad Larson @ 2021-02-26 20:43 UTC (permalink / raw)
  To: hch, konrad.wilk, m.szyprowski, robin.murphy, iommu, linux-kernel
  Cc: Brad Larson

Kernel Oops introduced in next-20210222 due to get_max_slots return arg size.
In the function find_slots() variable max_slots is zero when boundary_mask is
0xffffffffffffffff.

[    0.242119] kernel BUG at ./include/linux/iommu-helper.h:30!
[    0.247793] Internal error: Oops - BUG: 0 [#1] SMP
[    0.252595] Modules linked in:
[    0.255657] CPU: 0 PID: 93 Comm: kworker/0:1 Not tainted 5.11.0-next-20210224+ #25
[    0.263245] Hardware name: Elba ASIC Board (DT)
[    0.267784] Workqueue: events_freezable mmc_rescan
[    0.272592] pstate: 60000085 (nZCv daIf -PAN -UAO -TCO BTYPE=--)
[    0.278612] pc : swiotlb_tbl_map_single+0x2b0/0x6a0
[    0.283505] lr : swiotlb_tbl_map_single+0x440/0x6a0
[    0.288395] sp : ffffffc0122736b0
[    0.291713] x29: ffffffc0122736b0 x28: ffffffc010e30000
[    0.297039] x27: 00000000bbf58000 x26: 0000000000000000
[    0.302364] x25: 0000000000000000 x24: 0000000000000001
[    0.307689] x23: 0000000000000000 x22: 0000000000000000
[    0.313013] x21: 0000000000000000 x20: 0000000000000000
[    0.318338] x19: 0000001241fd4600 x18: ffffffc010d288c8
[    0.323662] x17: 0000000000000007 x16: 0000000000000001
[    0.328987] x15: ffffffc092273367 x14: 3a424c54204f4920
[    0.334311] x13: 6572617774666f73 x12: 20726e2030207865
[    0.339636] x11: 646e692078787820 x10: 3062653737317830
[    0.344960] x9 : 2074666968732031 x8 : ffffff977cf82368
[    0.350285] x7 : 0000000000000001 x6 : c0000000ffffefff
[    0.355609] x5 : 0000000000017fe8 x4 : 0000000000000000
[    0.360934] x3 : 0000000000000000 x2 : 18b0d50da009d000
[    0.366258] x1 : 0000000000000000 x0 : 0000000000000042
[    0.371583] Call trace:
[    0.374032]  swiotlb_tbl_map_single+0x2b0/0x6a0
[    0.378573]  swiotlb_map+0xa8/0x2b0

Signed-off-by: Brad Larson <brad@pensando.io>
---
 kernel/dma/swiotlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 369e4c3a0f2b..c10e855a03bc 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -534,7 +534,7 @@ static int find_slots(struct device *dev, phys_addr_t orig_addr,
 	unsigned long boundary_mask = dma_get_seg_boundary(dev);
 	dma_addr_t tbl_dma_addr =
 		phys_to_dma_unencrypted(dev, io_tlb_start) & boundary_mask;
-	unsigned int max_slots = get_max_slots(boundary_mask);
+	unsigned long max_slots = get_max_slots(boundary_mask);
 	unsigned int iotlb_align_mask =
 		dma_get_min_align_mask(dev) & ~(IO_TLB_SIZE - 1);
 	unsigned int nslots = nr_slots(alloc_size), stride;
-- 
2.17.1

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] swiotlb: swiotlb_tbl_map_single() kernel BUG in iommu-helper.h:30
  2021-02-26 20:43 ` Brad Larson
@ 2021-02-26 21:00   ` Konrad Rzeszutek Wilk
  -1 siblings, 0 replies; 7+ messages in thread
From: Konrad Rzeszutek Wilk @ 2021-02-26 21:00 UTC (permalink / raw)
  To: Brad Larson; +Cc: hch, m.szyprowski, robin.murphy, iommu, linux-kernel

On Fri, Feb 26, 2021 at 12:43:07PM -0800, Brad Larson wrote:
> Kernel Oops introduced in next-20210222 due to get_max_slots return arg size.
> In the function find_slots() variable max_slots is zero when boundary_mask is
> 0xffffffffffffffff.

I am looking at the stable/for-linus-5.12 and what I sent out for
a GIT PULL and I believe this is already squashed in:

531 static int find_slots(struct device *dev, phys_addr_t orig_addr,                
532                 size_t alloc_size)                                              
533 {                                                                               
534         unsigned long boundary_mask = dma_get_seg_boundary(dev);                
535         dma_addr_t tbl_dma_addr =                                               
536                 phys_to_dma_unencrypted(dev, io_tlb_start) & boundary_mask;     
537         unsigned long max_slots = get_max_slots(boundary_mask);

Could you double-check please?

> 
> [    0.242119] kernel BUG at ./include/linux/iommu-helper.h:30!
> [    0.247793] Internal error: Oops - BUG: 0 [#1] SMP
> [    0.252595] Modules linked in:
> [    0.255657] CPU: 0 PID: 93 Comm: kworker/0:1 Not tainted 5.11.0-next-20210224+ #25
> [    0.263245] Hardware name: Elba ASIC Board (DT)
> [    0.267784] Workqueue: events_freezable mmc_rescan
> [    0.272592] pstate: 60000085 (nZCv daIf -PAN -UAO -TCO BTYPE=--)
> [    0.278612] pc : swiotlb_tbl_map_single+0x2b0/0x6a0
> [    0.283505] lr : swiotlb_tbl_map_single+0x440/0x6a0
> [    0.288395] sp : ffffffc0122736b0
> [    0.291713] x29: ffffffc0122736b0 x28: ffffffc010e30000
> [    0.297039] x27: 00000000bbf58000 x26: 0000000000000000
> [    0.302364] x25: 0000000000000000 x24: 0000000000000001
> [    0.307689] x23: 0000000000000000 x22: 0000000000000000
> [    0.313013] x21: 0000000000000000 x20: 0000000000000000
> [    0.318338] x19: 0000001241fd4600 x18: ffffffc010d288c8
> [    0.323662] x17: 0000000000000007 x16: 0000000000000001
> [    0.328987] x15: ffffffc092273367 x14: 3a424c54204f4920
> [    0.334311] x13: 6572617774666f73 x12: 20726e2030207865
> [    0.339636] x11: 646e692078787820 x10: 3062653737317830
> [    0.344960] x9 : 2074666968732031 x8 : ffffff977cf82368
> [    0.350285] x7 : 0000000000000001 x6 : c0000000ffffefff
> [    0.355609] x5 : 0000000000017fe8 x4 : 0000000000000000
> [    0.360934] x3 : 0000000000000000 x2 : 18b0d50da009d000
> [    0.366258] x1 : 0000000000000000 x0 : 0000000000000042
> [    0.371583] Call trace:
> [    0.374032]  swiotlb_tbl_map_single+0x2b0/0x6a0
> [    0.378573]  swiotlb_map+0xa8/0x2b0
> 
> Signed-off-by: Brad Larson <brad@pensando.io>
> ---
>  kernel/dma/swiotlb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
> index 369e4c3a0f2b..c10e855a03bc 100644
> --- a/kernel/dma/swiotlb.c
> +++ b/kernel/dma/swiotlb.c
> @@ -534,7 +534,7 @@ static int find_slots(struct device *dev, phys_addr_t orig_addr,
>  	unsigned long boundary_mask = dma_get_seg_boundary(dev);
>  	dma_addr_t tbl_dma_addr =
>  		phys_to_dma_unencrypted(dev, io_tlb_start) & boundary_mask;
> -	unsigned int max_slots = get_max_slots(boundary_mask);
> +	unsigned long max_slots = get_max_slots(boundary_mask);
>  	unsigned int iotlb_align_mask =
>  		dma_get_min_align_mask(dev) & ~(IO_TLB_SIZE - 1);
>  	unsigned int nslots = nr_slots(alloc_size), stride;
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] swiotlb: swiotlb_tbl_map_single() kernel BUG in iommu-helper.h:30
@ 2021-02-26 21:00   ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 7+ messages in thread
From: Konrad Rzeszutek Wilk @ 2021-02-26 21:00 UTC (permalink / raw)
  To: Brad Larson; +Cc: linux-kernel, iommu, robin.murphy, hch

On Fri, Feb 26, 2021 at 12:43:07PM -0800, Brad Larson wrote:
> Kernel Oops introduced in next-20210222 due to get_max_slots return arg size.
> In the function find_slots() variable max_slots is zero when boundary_mask is
> 0xffffffffffffffff.

I am looking at the stable/for-linus-5.12 and what I sent out for
a GIT PULL and I believe this is already squashed in:

531 static int find_slots(struct device *dev, phys_addr_t orig_addr,                
532                 size_t alloc_size)                                              
533 {                                                                               
534         unsigned long boundary_mask = dma_get_seg_boundary(dev);                
535         dma_addr_t tbl_dma_addr =                                               
536                 phys_to_dma_unencrypted(dev, io_tlb_start) & boundary_mask;     
537         unsigned long max_slots = get_max_slots(boundary_mask);

Could you double-check please?

> 
> [    0.242119] kernel BUG at ./include/linux/iommu-helper.h:30!
> [    0.247793] Internal error: Oops - BUG: 0 [#1] SMP
> [    0.252595] Modules linked in:
> [    0.255657] CPU: 0 PID: 93 Comm: kworker/0:1 Not tainted 5.11.0-next-20210224+ #25
> [    0.263245] Hardware name: Elba ASIC Board (DT)
> [    0.267784] Workqueue: events_freezable mmc_rescan
> [    0.272592] pstate: 60000085 (nZCv daIf -PAN -UAO -TCO BTYPE=--)
> [    0.278612] pc : swiotlb_tbl_map_single+0x2b0/0x6a0
> [    0.283505] lr : swiotlb_tbl_map_single+0x440/0x6a0
> [    0.288395] sp : ffffffc0122736b0
> [    0.291713] x29: ffffffc0122736b0 x28: ffffffc010e30000
> [    0.297039] x27: 00000000bbf58000 x26: 0000000000000000
> [    0.302364] x25: 0000000000000000 x24: 0000000000000001
> [    0.307689] x23: 0000000000000000 x22: 0000000000000000
> [    0.313013] x21: 0000000000000000 x20: 0000000000000000
> [    0.318338] x19: 0000001241fd4600 x18: ffffffc010d288c8
> [    0.323662] x17: 0000000000000007 x16: 0000000000000001
> [    0.328987] x15: ffffffc092273367 x14: 3a424c54204f4920
> [    0.334311] x13: 6572617774666f73 x12: 20726e2030207865
> [    0.339636] x11: 646e692078787820 x10: 3062653737317830
> [    0.344960] x9 : 2074666968732031 x8 : ffffff977cf82368
> [    0.350285] x7 : 0000000000000001 x6 : c0000000ffffefff
> [    0.355609] x5 : 0000000000017fe8 x4 : 0000000000000000
> [    0.360934] x3 : 0000000000000000 x2 : 18b0d50da009d000
> [    0.366258] x1 : 0000000000000000 x0 : 0000000000000042
> [    0.371583] Call trace:
> [    0.374032]  swiotlb_tbl_map_single+0x2b0/0x6a0
> [    0.378573]  swiotlb_map+0xa8/0x2b0
> 
> Signed-off-by: Brad Larson <brad@pensando.io>
> ---
>  kernel/dma/swiotlb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
> index 369e4c3a0f2b..c10e855a03bc 100644
> --- a/kernel/dma/swiotlb.c
> +++ b/kernel/dma/swiotlb.c
> @@ -534,7 +534,7 @@ static int find_slots(struct device *dev, phys_addr_t orig_addr,
>  	unsigned long boundary_mask = dma_get_seg_boundary(dev);
>  	dma_addr_t tbl_dma_addr =
>  		phys_to_dma_unencrypted(dev, io_tlb_start) & boundary_mask;
> -	unsigned int max_slots = get_max_slots(boundary_mask);
> +	unsigned long max_slots = get_max_slots(boundary_mask);
>  	unsigned int iotlb_align_mask =
>  		dma_get_min_align_mask(dev) & ~(IO_TLB_SIZE - 1);
>  	unsigned int nslots = nr_slots(alloc_size), stride;
> -- 
> 2.17.1
> 
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] swiotlb: swiotlb_tbl_map_single() kernel BUG in iommu-helper.h:30
  2021-02-26 21:00   ` Konrad Rzeszutek Wilk
  (?)
@ 2021-02-26 21:18   ` Brad Larson
  2021-02-26 21:28       ` Konrad Rzeszutek Wilk
  -1 siblings, 1 reply; 7+ messages in thread
From: Brad Larson @ 2021-02-26 21:18 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: linux-kernel, iommu, robin.murphy, hch


[-- Attachment #1.1: Type: text/plain, Size: 4469 bytes --]

>
> On Fri, Feb 26, 2021 at 12:43:07PM -0800, Brad Larson wrote:
> > Kernel Oops introduced in next-20210222 due to get_max_slots return arg
> size.
> > In the function find_slots() variable max_slots is zero when
> boundary_mask is
> > 0xffffffffffffffff.
>
> I am looking at the stable/for-linus-5.12 and what I sent out for
> a GIT PULL and I believe this is already squashed in:
>
> 531 static int find_slots(struct device *dev, phys_addr_t orig_addr,
>
> 532                 size_t alloc_size)
>
> 533 {
>
> 534         unsigned long boundary_mask = dma_get_seg_boundary(dev);
>
> 535         dma_addr_t tbl_dma_addr =
>
> 536                 phys_to_dma_unencrypted(dev, io_tlb_start) &
> boundary_mask;
> 537         unsigned long max_slots = get_max_slots(boundary_mask);
>
> Could you double-check please?
>

Yes this is squashed in the snippet you are showing.  The bug was
introduced in
next-20210222 and is still there when I updated to next-20210226 today.


On Fri, Feb 26, 2021 at 1:00 PM Konrad Rzeszutek Wilk <
konrad.wilk@oracle.com> wrote:

> On Fri, Feb 26, 2021 at 12:43:07PM -0800, Brad Larson wrote:
> > Kernel Oops introduced in next-20210222 due to get_max_slots return arg
> size.
> > In the function find_slots() variable max_slots is zero when
> boundary_mask is
> > 0xffffffffffffffff.
>
> I am looking at the stable/for-linus-5.12 and what I sent out for
> a GIT PULL and I believe this is already squashed in:
>
> 531 static int find_slots(struct device *dev, phys_addr_t orig_addr,
>
> 532                 size_t alloc_size)
>
> 533 {
>
> 534         unsigned long boundary_mask = dma_get_seg_boundary(dev);
>
> 535         dma_addr_t tbl_dma_addr =
>
> 536                 phys_to_dma_unencrypted(dev, io_tlb_start) &
> boundary_mask;
> 537         unsigned long max_slots = get_max_slots(boundary_mask);
>
> Could you double-check please?
>
> >
> > [    0.242119] kernel BUG at ./include/linux/iommu-helper.h:30!
> > [    0.247793] Internal error: Oops - BUG: 0 [#1] SMP
> > [    0.252595] Modules linked in:
> > [    0.255657] CPU: 0 PID: 93 Comm: kworker/0:1 Not tainted
> 5.11.0-next-20210224+ #25
> > [    0.263245] Hardware name: Elba ASIC Board (DT)
> > [    0.267784] Workqueue: events_freezable mmc_rescan
> > [    0.272592] pstate: 60000085 (nZCv daIf -PAN -UAO -TCO BTYPE=--)
> > [    0.278612] pc : swiotlb_tbl_map_single+0x2b0/0x6a0
> > [    0.283505] lr : swiotlb_tbl_map_single+0x440/0x6a0
> > [    0.288395] sp : ffffffc0122736b0
> > [    0.291713] x29: ffffffc0122736b0 x28: ffffffc010e30000
> > [    0.297039] x27: 00000000bbf58000 x26: 0000000000000000
> > [    0.302364] x25: 0000000000000000 x24: 0000000000000001
> > [    0.307689] x23: 0000000000000000 x22: 0000000000000000
> > [    0.313013] x21: 0000000000000000 x20: 0000000000000000
> > [    0.318338] x19: 0000001241fd4600 x18: ffffffc010d288c8
> > [    0.323662] x17: 0000000000000007 x16: 0000000000000001
> > [    0.328987] x15: ffffffc092273367 x14: 3a424c54204f4920
> > [    0.334311] x13: 6572617774666f73 x12: 20726e2030207865
> > [    0.339636] x11: 646e692078787820 x10: 3062653737317830
> > [    0.344960] x9 : 2074666968732031 x8 : ffffff977cf82368
> > [    0.350285] x7 : 0000000000000001 x6 : c0000000ffffefff
> > [    0.355609] x5 : 0000000000017fe8 x4 : 0000000000000000
> > [    0.360934] x3 : 0000000000000000 x2 : 18b0d50da009d000
> > [    0.366258] x1 : 0000000000000000 x0 : 0000000000000042
> > [    0.371583] Call trace:
> > [    0.374032]  swiotlb_tbl_map_single+0x2b0/0x6a0
> > [    0.378573]  swiotlb_map+0xa8/0x2b0
> >
> > Signed-off-by: Brad Larson <brad@pensando.io>
> > ---
> >  kernel/dma/swiotlb.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
> > index 369e4c3a0f2b..c10e855a03bc 100644
> > --- a/kernel/dma/swiotlb.c
> > +++ b/kernel/dma/swiotlb.c
> > @@ -534,7 +534,7 @@ static int find_slots(struct device *dev,
> phys_addr_t orig_addr,
> >       unsigned long boundary_mask = dma_get_seg_boundary(dev);
> >       dma_addr_t tbl_dma_addr =
> >               phys_to_dma_unencrypted(dev, io_tlb_start) & boundary_mask;
> > -     unsigned int max_slots = get_max_slots(boundary_mask);
> > +     unsigned long max_slots = get_max_slots(boundary_mask);
> >       unsigned int iotlb_align_mask =
> >               dma_get_min_align_mask(dev) & ~(IO_TLB_SIZE - 1);
> >       unsigned int nslots = nr_slots(alloc_size), stride;
> > --
> > 2.17.1
> >
>

[-- Attachment #1.2: Type: text/html, Size: 6453 bytes --]

[-- Attachment #2: Type: text/plain, Size: 156 bytes --]

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] swiotlb: swiotlb_tbl_map_single() kernel BUG in iommu-helper.h:30
  2021-02-26 21:18   ` Brad Larson
@ 2021-02-26 21:28       ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 7+ messages in thread
From: Konrad Rzeszutek Wilk @ 2021-02-26 21:28 UTC (permalink / raw)
  To: Brad Larson; +Cc: hch, m.szyprowski, robin.murphy, iommu, linux-kernel

On Fri, Feb 26, 2021 at 01:18:14PM -0800, Brad Larson wrote:
>     On Fri, Feb 26, 2021 at 12:43:07PM -0800, Brad Larson wrote:
>     > Kernel Oops introduced in next-20210222 due to get_max_slots return arg
>     size.
>     > In the function find_slots() variable max_slots is zero when
>     boundary_mask is
>     > 0xffffffffffffffff.
> 
>     I am looking at the stable/for-linus-5.12 and what I sent out for
>     a GIT PULL and I believe this is already squashed in:
> 
>     531 static int find_slots(struct device *dev, phys_addr_t orig_addr,       
>             
>     532                 size_t alloc_size)                                     
>             
>     533 {                                                                     
>              
>     534         unsigned long boundary_mask = dma_get_seg_boundary(dev);       
>             
>     535         dma_addr_t tbl_dma_addr =                                     
>              
>     536                 phys_to_dma_unencrypted(dev, io_tlb_start) &
>     boundary_mask;     
>     537         unsigned long max_slots = get_max_slots(boundary_mask);
> 
>     Could you double-check please?
> 
>  
> Yes this is squashed in the snippet you are showing.  The bug was introduced in
> next-20210222 and is still there when I updated to next-20210226 today. 

Duh! It should be fixed now for the next one. Thank you!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] swiotlb: swiotlb_tbl_map_single() kernel BUG in iommu-helper.h:30
@ 2021-02-26 21:28       ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 7+ messages in thread
From: Konrad Rzeszutek Wilk @ 2021-02-26 21:28 UTC (permalink / raw)
  To: Brad Larson; +Cc: linux-kernel, iommu, robin.murphy, hch

On Fri, Feb 26, 2021 at 01:18:14PM -0800, Brad Larson wrote:
>     On Fri, Feb 26, 2021 at 12:43:07PM -0800, Brad Larson wrote:
>     > Kernel Oops introduced in next-20210222 due to get_max_slots return arg
>     size.
>     > In the function find_slots() variable max_slots is zero when
>     boundary_mask is
>     > 0xffffffffffffffff.
> 
>     I am looking at the stable/for-linus-5.12 and what I sent out for
>     a GIT PULL and I believe this is already squashed in:
> 
>     531 static int find_slots(struct device *dev, phys_addr_t orig_addr,       
>             
>     532                 size_t alloc_size)                                     
>             
>     533 {                                                                     
>              
>     534         unsigned long boundary_mask = dma_get_seg_boundary(dev);       
>             
>     535         dma_addr_t tbl_dma_addr =                                     
>              
>     536                 phys_to_dma_unencrypted(dev, io_tlb_start) &
>     boundary_mask;     
>     537         unsigned long max_slots = get_max_slots(boundary_mask);
> 
>     Could you double-check please?
> 
>  
> Yes this is squashed in the snippet you are showing.  The bug was introduced in
> next-20210222 and is still there when I updated to next-20210226 today. 

Duh! It should be fixed now for the next one. Thank you!
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-02-26 21:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26 20:43 [PATCH] swiotlb: swiotlb_tbl_map_single() kernel BUG in iommu-helper.h:30 Brad Larson
2021-02-26 20:43 ` Brad Larson
2021-02-26 21:00 ` Konrad Rzeszutek Wilk
2021-02-26 21:00   ` Konrad Rzeszutek Wilk
2021-02-26 21:18   ` Brad Larson
2021-02-26 21:28     ` Konrad Rzeszutek Wilk
2021-02-26 21:28       ` Konrad Rzeszutek Wilk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.