Linux IOMMU Development
 help / color / mirror / Atom feed
* an iommufd selftest issue with 6.4-rc1
@ 2023-05-17 13:56 Baolu Lu
  2023-05-17 14:02 ` Jason Gunthorpe
  0 siblings, 1 reply; 3+ messages in thread
From: Baolu Lu @ 2023-05-17 13:56 UTC (permalink / raw)
  To: Jason Gunthorpe; +Cc: iommu@lists.linux.dev, Kevin Tian, Yi Liu, Nicolin Chen

Hi Jason,

I compiled a 6.4-rc1 kernel and ran the iommufd selftest. The test hung,
and I had to break it with Ctrl+C. Is this a known issue, or there is
something wrong with my test setup?

Best regards,
baolu

PS: the test log:

TAP version 13
1..1
# selftests: iommu: iommufd
# TAP version 13
# 1..129
# # Starting 129 tests from 11 test cases.
# #  RUN           iommufd.simple_close ...
# #            OK  iommufd.simple_close
# ok 1 iommufd.simple_close
# #  RUN           iommufd.cmd_fail ...
# #            OK  iommufd.cmd_fail
# ok 2 iommufd.cmd_fail
# #  RUN           iommufd.cmd_length ...
# #            OK  iommufd.cmd_length
# ok 3 iommufd.cmd_length
# #  RUN           iommufd.cmd_ex_fail ...
# #            OK  iommufd.cmd_ex_fail
# ok 4 iommufd.cmd_ex_fail
# #  RUN           iommufd.global_options ...
# #            OK  iommufd.global_options
# ok 5 iommufd.global_options
# #  RUN           iommufd.simple_ioctls ...
# #            OK  iommufd.simple_ioctls
# ok 6 iommufd.simple_ioctls
# #  RUN           iommufd.unmap_cmd ...
# #            OK  iommufd.unmap_cmd
# ok 7 iommufd.unmap_cmd
# #  RUN           iommufd.map_cmd ...
# #            OK  iommufd.map_cmd
# ok 8 iommufd.map_cmd
# #  RUN           iommufd.info_cmd ...
# #            OK  iommufd.info_cmd
# ok 9 iommufd.info_cmd
# #  RUN           iommufd.set_iommu_cmd ...
# #            OK  iommufd.set_iommu_cmd
# ok 10 iommufd.set_iommu_cmd
# #  RUN           iommufd.vfio_ioas ...
# #            OK  iommufd.vfio_ioas
# ok 11 iommufd.vfio_ioas
# #  RUN           iommufd_ioas.no_domain.ioas_auto_destroy ...
# #            OK  iommufd_ioas.no_domain.ioas_auto_destroy
# ok 12 iommufd_ioas.no_domain.ioas_auto_destroy
# #  RUN           iommufd_ioas.no_domain.ioas_destroy ...
# #            OK  iommufd_ioas.no_domain.ioas_destroy
# ok 13 iommufd_ioas.no_domain.ioas_destroy
# #  RUN           iommufd_ioas.no_domain.hwpt_attach ...
# # hwpt_attach: Test terminated unexpectedly by signal 9
# #          FAIL  iommufd_ioas.no_domain.hwpt_attach
# not ok 14 iommufd_ioas.no_domain.hwpt_attach
# #  RUN           iommufd_ioas.no_domain.ioas_area_destroy ...
# #            OK  iommufd_ioas.no_domain.ioas_area_destroy
# ok 15 iommufd_ioas.no_domain.ioas_area_destroy
# #  RUN           iommufd_ioas.no_domain.ioas_area_auto_destroy ...
# #            OK  iommufd_ioas.no_domain.ioas_area_auto_destroy
# ok 16 iommufd_ioas.no_domain.ioas_area_auto_destroy
# #  RUN           iommufd_ioas.no_domain.area ...
# #            OK  iommufd_ioas.no_domain.area
# ok 17 iommufd_ioas.no_domain.area
# #  RUN           iommufd_ioas.no_domain.unmap_fully_contained_areas ...
# #            OK  iommufd_ioas.no_domain.unmap_fully_contained_areas
# ok 18 iommufd_ioas.no_domain.unmap_fully_contained_areas
# #  RUN           iommufd_ioas.no_domain.area_auto_iova ...
# #            OK  iommufd_ioas.no_domain.area_auto_iova
# ok 19 iommufd_ioas.no_domain.area_auto_iova
# #  RUN           iommufd_ioas.no_domain.area_allowed ...
# #            OK  iommufd_ioas.no_domain.area_allowed
# ok 20 iommufd_ioas.no_domain.area_allowed
# #  RUN           iommufd_ioas.no_domain.copy_area ...
# #            OK  iommufd_ioas.no_domain.copy_area
# ok 21 iommufd_ioas.no_domain.copy_area
# #  RUN           iommufd_ioas.no_domain.iova_ranges ...
# #            OK  iommufd_ioas.no_domain.iova_ranges
# ok 22 iommufd_ioas.no_domain.iova_ranges
# #  RUN           iommufd_ioas.no_domain.access_domain_destory ...
# # iommufd.c:611:access_domain_destory:Expected MAP_FAILED 
(18446744073709551615) != buf (18446744073709551615)

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

* Re: an iommufd selftest issue with 6.4-rc1
  2023-05-17 13:56 an iommufd selftest issue with 6.4-rc1 Baolu Lu
@ 2023-05-17 14:02 ` Jason Gunthorpe
  2023-05-18  7:22   ` Baolu Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Gunthorpe @ 2023-05-17 14:02 UTC (permalink / raw)
  To: Baolu Lu; +Cc: iommu@lists.linux.dev, Kevin Tian, Yi Liu, Nicolin Chen

On Wed, May 17, 2023 at 09:56:47PM +0800, Baolu Lu wrote:
> Hi Jason,
> 
> I compiled a 6.4-rc1 kernel and ran the iommufd selftest. The test hung,
> and I had to break it with Ctrl+C. Is this a known issue, or there is
> something wrong with my test setup?

There is an annoying bug in the test harness and it infinite loops for
some failure cases. That explains the hang

> # #  RUN           iommufd_ioas.no_domain.ioas_destroy ...
> # #            OK  iommufd_ioas.no_domain.ioas_destroy
> # ok 13 iommufd_ioas.no_domain.ioas_destroy
> # #  RUN           iommufd_ioas.no_domain.hwpt_attach ...
> # # hwpt_attach: Test terminated unexpectedly by signal 9

That seems bad

> # #          FAIL  iommufd_ioas.no_domain.hwpt_attach
> # not ok 14 iommufd_ioas.no_domain.hwpt_attach
> # #  RUN           iommufd_ioas.no_domain.ioas_area_destroy ...
> # #            OK  iommufd_ioas.no_domain.ioas_area_destroy
> # ok 15 iommufd_ioas.no_domain.ioas_area_destroy
> # #  RUN           iommufd_ioas.no_domain.ioas_area_auto_destroy ...
> # #            OK  iommufd_ioas.no_domain.ioas_area_auto_destroy
> # ok 16 iommufd_ioas.no_domain.ioas_area_auto_destroy
> # #  RUN           iommufd_ioas.no_domain.area ...
> # #            OK  iommufd_ioas.no_domain.area
> # ok 17 iommufd_ioas.no_domain.area
> # #  RUN           iommufd_ioas.no_domain.unmap_fully_contained_areas ...
> # #            OK  iommufd_ioas.no_domain.unmap_fully_contained_areas
> # ok 18 iommufd_ioas.no_domain.unmap_fully_contained_areas
> # #  RUN           iommufd_ioas.no_domain.area_auto_iova ...
> # #            OK  iommufd_ioas.no_domain.area_auto_iova
> # ok 19 iommufd_ioas.no_domain.area_auto_iova
> # #  RUN           iommufd_ioas.no_domain.area_allowed ...
> # #            OK  iommufd_ioas.no_domain.area_allowed
> # ok 20 iommufd_ioas.no_domain.area_allowed
> # #  RUN           iommufd_ioas.no_domain.copy_area ...
> # #            OK  iommufd_ioas.no_domain.copy_area
> # ok 21 iommufd_ioas.no_domain.copy_area
> # #  RUN           iommufd_ioas.no_domain.iova_ranges ...
> # #            OK  iommufd_ioas.no_domain.iova_ranges
> # ok 22 iommufd_ioas.no_domain.iova_ranges
> # #  RUN           iommufd_ioas.no_domain.access_domain_destory ...
> # # iommufd.c:611:access_domain_destory:Expected MAP_FAILED
> (18446744073709551615) != buf (18446744073709551615)

And you had a failed mmp, so probably missing THPs or something

I don't see any failures when I run it..

Jason

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

* Re: an iommufd selftest issue with 6.4-rc1
  2023-05-17 14:02 ` Jason Gunthorpe
@ 2023-05-18  7:22   ` Baolu Lu
  0 siblings, 0 replies; 3+ messages in thread
From: Baolu Lu @ 2023-05-18  7:22 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: baolu.lu, iommu@lists.linux.dev, Kevin Tian, Yi Liu, Nicolin Chen

On 2023/5/17 22:02, Jason Gunthorpe wrote:
> On Wed, May 17, 2023 at 09:56:47PM +0800, Baolu Lu wrote:
>> Hi Jason,
>>
>> I compiled a 6.4-rc1 kernel and ran the iommufd selftest. The test hung,
>> and I had to break it with Ctrl+C. Is this a known issue, or there is
>> something wrong with my test setup?
> 
> There is an annoying bug in the test harness and it infinite loops for
> some failure cases. That explains the hang

Get it, thank you!

> 
>> # #  RUN           iommufd_ioas.no_domain.ioas_destroy ...
>> # #            OK  iommufd_ioas.no_domain.ioas_destroy
>> # ok 13 iommufd_ioas.no_domain.ioas_destroy
>> # #  RUN           iommufd_ioas.no_domain.hwpt_attach ...
>> # # hwpt_attach: Test terminated unexpectedly by signal 9
> 
> That seems bad

I don't know yet, need some investigation.

> 
>> # #          FAIL  iommufd_ioas.no_domain.hwpt_attach
>> # not ok 14 iommufd_ioas.no_domain.hwpt_attach
>> # #  RUN           iommufd_ioas.no_domain.ioas_area_destroy ...
>> # #            OK  iommufd_ioas.no_domain.ioas_area_destroy
>> # ok 15 iommufd_ioas.no_domain.ioas_area_destroy
>> # #  RUN           iommufd_ioas.no_domain.ioas_area_auto_destroy ...
>> # #            OK  iommufd_ioas.no_domain.ioas_area_auto_destroy
>> # ok 16 iommufd_ioas.no_domain.ioas_area_auto_destroy
>> # #  RUN           iommufd_ioas.no_domain.area ...
>> # #            OK  iommufd_ioas.no_domain.area
>> # ok 17 iommufd_ioas.no_domain.area
>> # #  RUN           iommufd_ioas.no_domain.unmap_fully_contained_areas ...
>> # #            OK  iommufd_ioas.no_domain.unmap_fully_contained_areas
>> # ok 18 iommufd_ioas.no_domain.unmap_fully_contained_areas
>> # #  RUN           iommufd_ioas.no_domain.area_auto_iova ...
>> # #            OK  iommufd_ioas.no_domain.area_auto_iova
>> # ok 19 iommufd_ioas.no_domain.area_auto_iova
>> # #  RUN           iommufd_ioas.no_domain.area_allowed ...
>> # #            OK  iommufd_ioas.no_domain.area_allowed
>> # ok 20 iommufd_ioas.no_domain.area_allowed
>> # #  RUN           iommufd_ioas.no_domain.copy_area ...
>> # #            OK  iommufd_ioas.no_domain.copy_area
>> # ok 21 iommufd_ioas.no_domain.copy_area
>> # #  RUN           iommufd_ioas.no_domain.iova_ranges ...
>> # #            OK  iommufd_ioas.no_domain.iova_ranges
>> # ok 22 iommufd_ioas.no_domain.iova_ranges
>> # #  RUN           iommufd_ioas.no_domain.access_domain_destory ...
>> # # iommufd.c:611:access_domain_destory:Expected MAP_FAILED
>> (18446744073709551615) != buf (18446744073709551615)
> 
> And you had a failed mmp, so probably missing THPs or something

Seems to look good.

# grep THP .config
CONFIG_ARCH_ENABLE_THP_MIGRATION=y
CONFIG_ARCH_WANTS_THP_SWAP=y
CONFIG_THP_SWAP=y
# CONFIG_READ_ONLY_THP_FOR_FS is not set

# cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never

> I don't see any failures when I run it..

Okay, that's fine.

Best regards,
baolu


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

end of thread, other threads:[~2023-05-18  7:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-17 13:56 an iommufd selftest issue with 6.4-rc1 Baolu Lu
2023-05-17 14:02 ` Jason Gunthorpe
2023-05-18  7:22   ` Baolu Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox