* sea_to_user sefltest failure
@ 2025-12-11 17:54 Sebastian Ott
[not found] ` <CACw3F52i_Yr+8Gd1=H=EMi7NnVJ8WCgMkaG1dSe8FD7PvOsW8w@mail.gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Ott @ 2025-12-11 17:54 UTC (permalink / raw)
To: Jiaqi Yan, Oliver Upton, Marc Zyngier, Shuah Khan; +Cc: kvmarm, linux-kselftest
Hi,
sea_to_user fails for me with:
Random seed: 0x6b8b4567
==== Test Assertion Failure ====
include/kvm_syscalls.h:58: mem != MAP_FAILED
pid=4923 tid=4923 errno=12 - Cannot allocate memory
1 0x0000000000405afb: __kvm_mmap at kvm_syscalls.h:58 (discriminator 3)
2 (inlined by) kvm_mmap at kvm_syscalls.h:65 (discriminator 3)
3 (inlined by) vm_mem_add at kvm_util.c:1036 (discriminator 3)
4 0x0000000000402377: vm_create_with_sea_handler at sea_to_user.c:278
5 (inlined by) main at sea_to_user.c:324
6 0x0000ffff8d0a621b: ?? ??:0
7 0x0000ffff8d0a62fb: ?? ??:0
8 0x000000000040282f: _start at ??:?
mmap() failed, rc: -1 errno: 12 (Cannot allocate memory)
this could be related to my config?
# CONFIG_CGROUP_HUGETLB is not set
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
CONFIG_HAVE_ARCH_HUGE_VMAP=y
CONFIG_HAVE_ARCH_HUGE_VMALLOC=y
CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y
# CONFIG_PERSISTENT_HUGE_ZERO_FOLIO is not set
CONFIG_TRANSPARENT_HUGEPAGE=y
# CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS is not set
CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y
# CONFIG_TRANSPARENT_HUGEPAGE_NEVER is not set
CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_NEVER=y
# CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_ALWAYS is not set
# CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_WITHIN_SIZE is not set
# CONFIG_TRANSPARENT_HUGEPAGE_SHMEM_HUGE_ADVISE is not set
CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_NEVER=y
# CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_ALWAYS is not set
# CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_WITHIN_SIZE is not set
# CONFIG_TRANSPARENT_HUGEPAGE_TMPFS_HUGE_ADVISE is not set
CONFIG_PGTABLE_HAS_HUGE_LEAVES=y
CONFIG_ARCH_SUPPORTS_HUGE_PFNMAP=y
CONFIG_ARCH_SUPPORTS_HUGETLBFS=y
CONFIG_HUGETLBFS=y
CONFIG_HUGETLB_PAGE=y
CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING=y
Looking at the code smth like this would skip the test:
get_backing_src_pagesz(VM_MEM_SRC_ANONYMOUS_HUGETLB);
..or is this not worth the effort and my config is too weird?
Thanks,
Sebastian
^ permalink raw reply [flat|nested] 6+ messages in thread[parent not found: <CACw3F52i_Yr+8Gd1=H=EMi7NnVJ8WCgMkaG1dSe8FD7PvOsW8w@mail.gmail.com>]
* Re: sea_to_user sefltest failure [not found] ` <CACw3F52i_Yr+8Gd1=H=EMi7NnVJ8WCgMkaG1dSe8FD7PvOsW8w@mail.gmail.com> @ 2025-12-11 18:11 ` Sebastian Ott 2025-12-12 2:08 ` Jiaqi Yan 2025-12-15 5:54 ` Gavin Shan 2025-12-11 18:19 ` Marc Zyngier 1 sibling, 2 replies; 6+ messages in thread From: Sebastian Ott @ 2025-12-11 18:11 UTC (permalink / raw) To: Jiaqi Yan; +Cc: Oliver Upton, Marc Zyngier, Shuah Khan, kvmarm, linux-kselftest On Thu, 11 Dec 2025, Jiaqi Yan wrote: > CONFIGs seem alright to me. Do you boot kernel with cmdline options like "default_hugepagesz=1G hugepagesz=1G hugepages=64", or dynamically set up > huge pages via "echo 64 > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages"? Neither of these. When I do the test is skipped: # echo 64 > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages # ./arm64/sea_to_user Random seed: 0x6b8b4567 # Mapped 0x40000 pages: gva=0x80000000 to gpa=0xff80000000 # Before EINJect: data=0xbaadcafe # EINJ_GVA=0x81234bad, einj_gpa=0xff81234bad, einj_hva=0xffff41234bad, einj_hpa=0x80241234bad ok 1 # SKIP EINJ module probably not loaded?sh: line 1: /sys/kernel/debug/apei/einj/error_type: No such file or directory Bail out! Failed to write EINJ entry: No such file or directory (2) # 1 skipped test(s) detected. Consider enabling relevant config options to improve coverage. # Planned tests != run tests (0 != 1) # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:1 error:0 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: sea_to_user sefltest failure 2025-12-11 18:11 ` Sebastian Ott @ 2025-12-12 2:08 ` Jiaqi Yan 2025-12-15 5:54 ` Gavin Shan 1 sibling, 0 replies; 6+ messages in thread From: Jiaqi Yan @ 2025-12-12 2:08 UTC (permalink / raw) To: Sebastian Ott Cc: Oliver Upton, Marc Zyngier, Shuah Khan, kvmarm, linux-kselftest On Thu, Dec 11, 2025 at 10:11 AM Sebastian Ott <sebott@redhat.com> wrote: > > On Thu, 11 Dec 2025, Jiaqi Yan wrote: > > CONFIGs seem alright to me. Do you boot kernel with cmdline options like "default_hugepagesz=1G hugepagesz=1G hugepages=64", or dynamically set up > > huge pages via "echo 64 > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages"? > > Neither of these. When I do the test is skipped: > # echo 64 > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages > # ./arm64/sea_to_user > Random seed: 0x6b8b4567 > # Mapped 0x40000 pages: gva=0x80000000 to gpa=0xff80000000 > # Before EINJect: data=0xbaadcafe > # EINJ_GVA=0x81234bad, einj_gpa=0xff81234bad, einj_hva=0xffff41234bad, > einj_hpa=0x80241234bad > ok 1 # SKIP EINJ module probably not loaded?sh: line 1: > /sys/kernel/debug/apei/einj/error_type: No such file or directory > Bail out! Failed to write EINJ entry: No such file or directory (2) Looks like EINJ is not available on your test machine. You will need to check several things: 1. does your firmware have EINJ support? kernel should log something like "ACPI: EINJ populated" at boot time, but it doesn't guarantee the EINJ support, just suggesting it may support. 2. if you are sure about the firmware, did you build kernel with CONFIG_ACPI_APEI_EINJ=m? 3. if CONFIG_ACPI_APEI_EINJ=m, please also "modprobe einj". If modprobe failed or /sys/kernel/debug/apei/einj/error_type still doesn't show up, firmware probably doesn't support EINJ at all. I will probably add more comments at the top of the file to clarify things. > # 1 skipped test(s) detected. Consider enabling relevant config options to > improve coverage. > # Planned tests != run tests (0 != 1) > # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:1 error:0 > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: sea_to_user sefltest failure 2025-12-11 18:11 ` Sebastian Ott 2025-12-12 2:08 ` Jiaqi Yan @ 2025-12-15 5:54 ` Gavin Shan 1 sibling, 0 replies; 6+ messages in thread From: Gavin Shan @ 2025-12-15 5:54 UTC (permalink / raw) To: Sebastian Ott, Jiaqi Yan Cc: Oliver Upton, Marc Zyngier, Shuah Khan, kvmarm, linux-kselftest On 12/12/25 4:11 AM, Sebastian Ott wrote: > On Thu, 11 Dec 2025, Jiaqi Yan wrote: >> CONFIGs seem alright to me. Do you boot kernel with cmdline options like "default_hugepagesz=1G hugepagesz=1G hugepages=64", or dynamically set up >> huge pages via "echo 64 > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages"? > > Neither of these. When I do the test is skipped: > # echo 64 > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages The backing memory is tied to 1GB hugetlb pages which are available on 4KB and 16KB host, but not on 64KB host. So I guess 512MB hugetlb pages shall be used on 64KB host? > # ./arm64/sea_to_user > Random seed: 0x6b8b4567 > # Mapped 0x40000 pages: gva=0x80000000 to gpa=0xff80000000 > # Before EINJect: data=0xbaadcafe > # EINJ_GVA=0x81234bad, einj_gpa=0xff81234bad, einj_hva=0xffff41234bad, einj_hpa=0x80241234bad > ok 1 # SKIP EINJ module probably not loaded?sh: line 1: /sys/kernel/debug/apei/einj/error_type: No such file or directory > Bail out! Failed to write EINJ entry: No such file or directory (2) > # 1 skipped test(s) detected. Consider enabling relevant config options to improve coverage. > # Planned tests != run tests (0 != 1) > # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:1 error:0 > On one of my machines where RAS feature used to work, the test case passed on 4KB host. host$ cat /proc/1/smaps | grep KernelPageSize | head -n 1 KernelPageSize: 4 kB host$ modprobe einj host$ echo 4 > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages host$ ./sea_to_user Random seed: 0x6b8b4567 # Mapped 0x40000 pages: gva=0x80000000 to gpa=0xff80000000 # Before EINJect: data=0xbaadcafe # EINJ_GVA=0x81234bad, einj_gpa=0xff81234bad, einj_hva=0xffff41234bad, einj_hpa=0x400081234bad # echo 0x10 > /sys/kernel/debug/apei/einj/error_type - done # echo 0x2 > /sys/kernel/debug/apei/einj/flags - done # echo 0x400081234bad > /sys/kernel/debug/apei/einj/param1 - done # echo 0xffffffffffffffff > /sys/kernel/debug/apei/einj/param2 - done # echo 0x1 > /sys/kernel/debug/apei/einj/notrigger - done # echo 0x1 > /sys/kernel/debug/apei/einj/error_inject - done # Memory UER EINJected # SIGBUS (7) received, dumping siginfo... # si_signo=7, si_errno=0, si_code=4, si_addr=0xffff41234000 ok 1 # SKIP SEA is claimed by host APEI Thanks, Gavin ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: sea_to_user sefltest failure [not found] ` <CACw3F52i_Yr+8Gd1=H=EMi7NnVJ8WCgMkaG1dSe8FD7PvOsW8w@mail.gmail.com> 2025-12-11 18:11 ` Sebastian Ott @ 2025-12-11 18:19 ` Marc Zyngier 2025-12-12 2:11 ` Jiaqi Yan 1 sibling, 1 reply; 6+ messages in thread From: Marc Zyngier @ 2025-12-11 18:19 UTC (permalink / raw) To: Jiaqi Yan Cc: Sebastian Ott, Oliver Upton, Shuah Khan, kvmarm, linux-kselftest, Zenghui Yu On Thu, 11 Dec 2025 18:04:48 +0000, Jiaqi Yan <jiaqiyan@google.com> wrote: > > [1 <text/plain; UTF-8 (quoted-printable)>] > Hi Sebastian, > > CONFIGs seem alright to me. Do you boot kernel with cmdline options like > "default_hugepagesz=1G hugepagesz=1G hugepages=64", or dynamically set up > huge pages via "echo 64 > > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages"? I don't think this is irrelevant. The whole thing seems to have some logic flaws, see the extensive report from Zenghui[1] as a reply to your series. M. [1] https://lore.kernel.org/r/3061f5f8-cef0-b7b1-c4de-f2ceea29af9a@huawei.com -- Without deviation from the norm, progress is not possible. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: sea_to_user sefltest failure 2025-12-11 18:19 ` Marc Zyngier @ 2025-12-12 2:11 ` Jiaqi Yan 0 siblings, 0 replies; 6+ messages in thread From: Jiaqi Yan @ 2025-12-12 2:11 UTC (permalink / raw) To: Marc Zyngier Cc: Sebastian Ott, Oliver Upton, Shuah Khan, kvmarm, linux-kselftest, Zenghui Yu On Thu, Dec 11, 2025 at 10:19 AM Marc Zyngier <maz@kernel.org> wrote: > > On Thu, 11 Dec 2025 18:04:48 +0000, > Jiaqi Yan <jiaqiyan@google.com> wrote: > > > > [1 <text/plain; UTF-8 (quoted-printable)>] > > Hi Sebastian, > > > > CONFIGs seem alright to me. Do you boot kernel with cmdline options like > > "default_hugepagesz=1G hugepagesz=1G hugepages=64", or dynamically set up > > huge pages via "echo 64 > > > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages"? > > I don't think this is irrelevant. The whole thing seems to have some > logic flaws, see the extensive report from Zenghui[1] as a reply to > your series. Perhaps my test is too coupled with my test environment. I will work with Zhenghui to improve the test for people. > > M. > > [1] https://lore.kernel.org/r/3061f5f8-cef0-b7b1-c4de-f2ceea29af9a@huawei.com > > -- > Without deviation from the norm, progress is not possible. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-12-15 5:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-11 17:54 sea_to_user sefltest failure Sebastian Ott
[not found] ` <CACw3F52i_Yr+8Gd1=H=EMi7NnVJ8WCgMkaG1dSe8FD7PvOsW8w@mail.gmail.com>
2025-12-11 18:11 ` Sebastian Ott
2025-12-12 2:08 ` Jiaqi Yan
2025-12-15 5:54 ` Gavin Shan
2025-12-11 18:19 ` Marc Zyngier
2025-12-12 2:11 ` Jiaqi Yan
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox