Linux Hardening
 help / color / mirror / Atom feed
From: "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>
To: Erhard Furtner <erhard_f@mailbox.org>,
	linux-hardening@vger.kernel.org, Kees Cook <kees@kernel.org>,
	David Howells <dhowells@redhat.com>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: iov_kunit_copy_to_kvec: ASSERTION FAILED at lib/tests/kunit_iov_iter.c:63, Expected got == npages, but, got == 1 (0x1), npages == 256 (0x100) (v7.0.2, ppc)
Date: Wed, 29 Apr 2026 16:56:05 +0200	[thread overview]
Message-ID: <87c448ad-4ee0-4605-8a5f-7c7661a156a2@kernel.org> (raw)
In-Reply-To: <2708666d-68f8-4cd3-9b25-f14ceeba3a1f@mailbox.org>



Le 29/04/2026 à 13:45, Erhard Furtner a écrit :
> Greetings!
> 
> Getting this on my G4 DP on kernel v7.0.2 and v7.1-rc1 via 'modprobe -v 
> kunit_iov_iter':
> 
> [...]
> KTAP version 1
>   1..1
>       KTAP version 1
>       # Subtest: iov_iter
>       # module: kunit_iov_iter
>       1..12
>       # iov_kunit_copy_to_kvec: ASSERTION FAILED at lib/tests/ 
> kunit_iov_iter.c:63
>       Expected got == npages, but
>           got == 1 (0x1)
>           npages == 256 (0x100)
>       not ok 1 iov_kunit_copy_to_kvec

This happens in alloc_pages_bulk_noprof(), due to

	pcp = pcp_spin_trylock(zone->per_cpu_pageset);
	if (!pcp)
		goto failed;

Because:

#ifdef CONFIG_SMP
[...]
/*
  * On CONFIG_SMP=n the UP implementation of spin_trylock() never fails 
and thus
  * is not compatible with our locking scheme. However we do not need 
pcp for
  * scalability in the first place, so just make all the trylocks fail 
and take
  * the slow path unconditionally.
  */
#else
#define pcp_spin_trylock(ptr)		\
		NULL


So apparently it is expected that alloc_pages_bulk() returns 1 on non-SMP.

Christophe

>       # iov_kunit_copy_from_kvec: ASSERTION FAILED at lib/tests/ 
> kunit_iov_iter.c:63
>       Expected got == npages, but
>           got == 1 (0x1)
>           npages == 256 (0x100)
>       not ok 2 iov_kunit_copy_from_kvec
>       # iov_kunit_copy_to_bvec: ASSERTION FAILED at lib/tests/ 
> kunit_iov_iter.c:63
>       Expected got == npages, but
>           got == 1 (0x1)
>           npages == 256 (0x100)
>       not ok 3 iov_kunit_copy_to_bvec
>       # iov_kunit_copy_from_bvec: ASSERTION FAILED at lib/tests/ 
> kunit_iov_iter.c:63
>       Expected got == npages, but
>           got == 1 (0x1)
>           npages == 256 (0x100)
>       not ok 4 iov_kunit_copy_from_bvec
>       # iov_kunit_copy_to_folioq: ASSERTION FAILED at lib/tests/ 
> kunit_iov_iter.c:63
>       Expected got == npages, but
>           got == 1 (0x1)
>           npages == 256 (0x100)
>       not ok 5 iov_kunit_copy_to_folioq
>       # iov_kunit_copy_from_folioq: ASSERTION FAILED at lib/tests/ 
> kunit_iov_iter.c:63
>       Expected got == npages, but
>           got == 1 (0x1)
>           npages == 256 (0x100)
>       not ok 6 iov_kunit_copy_from_folioq
>       # iov_kunit_copy_to_xarray: ASSERTION FAILED at lib/tests/ 
> kunit_iov_iter.c:63
>       Expected got == npages, but
>           got == 1 (0x1)
>           npages == 256 (0x100)
>       not ok 7 iov_kunit_copy_to_xarray
>       # iov_kunit_copy_from_xarray: ASSERTION FAILED at lib/tests/ 
> kunit_iov_iter.c:63
>       Expected got == npages, but
>           got == 1 (0x1)
>           npages == 256 (0x100)
>       not ok 8 iov_kunit_copy_from_xarray
>       # iov_kunit_extract_pages_kvec: ASSERTION FAILED at lib/tests/ 
> kunit_iov_iter.c:63
>       Expected got == npages, but
>           got == 1 (0x1)
>           npages == 256 (0x100)
>       not ok 9 iov_kunit_extract_pages_kvec
>       # iov_kunit_extract_pages_bvec: ASSERTION FAILED at lib/tests/ 
> kunit_iov_iter.c:63
>       Expected got == npages, but
>           got == 1 (0x1)
>           npages == 256 (0x100)
>       not ok 10 iov_kunit_extract_pages_bvec
>       # iov_kunit_extract_pages_folioq: ASSERTION FAILED at lib/tests/ 
> kunit_iov_iter.c:63
>       Expected got == npages, but
>           got == 1 (0x1)
>           npages == 256 (0x100)
>       not ok 11 iov_kunit_extract_pages_folioq
>       # iov_kunit_extract_pages_xarray: ASSERTION FAILED at lib/tests/ 
> kunit_iov_iter.c:63
>       Expected got == npages, but
>           got == 1 (0x1)
>           npages == 256 (0x100)
>       not ok 12 iov_kunit_extract_pages_xarray
>   # iov_iter: pass:0 fail:12 skip:0 total:12
>   # Totals: pass:0 fail:12 skip:0 total:12
>   not ok 1 iov_iter
> 
> 
> Suppose this may be a ppc/BE specific test failure as I don't get it on 
> my Thinkpad T60 (x86).
> 
> Full dmesg and kernel .config available on request.
> 
> Greetings,
> Erhard
> 


      parent reply	other threads:[~2026-04-29 14:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29 11:45 iov_kunit_copy_to_kvec: ASSERTION FAILED at lib/tests/kunit_iov_iter.c:63, Expected got == npages, but, got == 1 (0x1), npages == 256 (0x100) (v7.0.2, ppc) Erhard Furtner
2026-04-29 14:55 ` LEROY Christophe
2026-04-29 16:05   ` Erhard Furtner
2026-04-29 14:56 ` Christophe Leroy (CS GROUP) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87c448ad-4ee0-4605-8a5f-7c7661a156a2@kernel.org \
    --to=chleroy@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=erhard_f@mailbox.org \
    --cc=kees@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox