From: David Hildenbrand <david@redhat.com>
To: Ryan Roberts <ryan.roberts@arm.com>, linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Shuah Khan <shuah@kernel.org>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
Ingo Molnar <mingo@redhat.com>, Peter Xu <peterx@redhat.com>,
Dev Jain <dev.jain@arm.com>,
Aishwarya TCV <Aishwarya.TCV@arm.com>
Subject: Re: [PATCH v2] selftests/mm: add simple VM_PFNMAP tests based on mmap'ing /dev/mem
Date: Wed, 28 May 2025 12:48:59 +0200 [thread overview]
Message-ID: <3c15a093-7c19-4c2a-a571-56a5ed4b445f@redhat.com> (raw)
In-Reply-To: <7cb7f23a-ce9e-4664-8083-deb73ed23da3@redhat.com>
On 28.05.25 12:44, David Hildenbrand wrote:
> On 28.05.25 12:34, Ryan Roberts wrote:
>> Hi David,
>>
>>
>> On 09/05/2025 16:30, David Hildenbrand wrote:
>>> Let's test some basic functionality using /dev/mem. These tests will
>>> implicitly cover some PAT (Page Attribute Handling) handling on x86.
>>>
>>> These tests will only run when /dev/mem access to the first two pages
>>> in physical address space is possible and allowed; otherwise, the tests
>>> are skipped.
>>
>> We are seeing really horrible RAS errors with this test when run on arm64 tx2
>> machine. Based solely on reviewing the code, I think the problem is that tx2
>> doesn't have anything at phys address 0, so test_read_access() is trying to put
>> trasactions out to a bad address on the bus.
>>
>> tx2 /proc/iomem:
>>
>> $ sudo cat /proc/iomem
>> 30000000-37ffffff : PCI ECAM
>> 38000000-3fffffff : PCI ECAM
>> 40000000-5fffffff : PCI Bus 0000:00
>> ...
>>
>> Whereas my x86 box has some reserved memory:
>>
>> $ sudo cat /proc/iomem
>> 00000000-00000fff : Reserved
>> 00001000-0003dfff : System RAM
>> ...
>>
>
> A quick fix would be to make this test specific to x86 (the only one I
> tested on). We should always have the lower two pages IIRC (BIOS stuff etc).
>
>> I think perhaps the only safe way to handle this is to parse /proc/iomem for a
>> region of "System RAM" that is at least 2 pages then use that for your read
>> tests. This would also solve the hypothetical issue of reading something that
>> has read size effects.
>
> That sounds also plausible yes. I somehow remembered that mmap() would
> fail if "there is nothing".
Ah, my memory comes back, we perform checks only with CONFIG_STRICT_DEVMEM.
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2025-05-28 10:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-09 15:30 David Hildenbrand
2025-05-09 15:55 ` Lorenzo Stoakes
2025-05-12 8:18 ` David Hildenbrand
2025-05-12 11:52 ` Lorenzo Stoakes
2025-05-28 10:34 ` Ryan Roberts
2025-05-28 10:44 ` David Hildenbrand
2025-05-28 10:48 ` David Hildenbrand [this message]
2025-05-28 10:53 ` Ryan Roberts
2025-05-28 11:03 ` David Hildenbrand
2025-05-28 12:40 ` David Hildenbrand
2025-05-28 13:44 ` Ryan Roberts
2025-05-28 18:23 ` Aishwarya
2025-05-28 19:47 ` David Hildenbrand
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=3c15a093-7c19-4c2a-a571-56a5ed4b445f@redhat.com \
--to=david@redhat.com \
--cc=Aishwarya.TCV@arm.com \
--cc=akpm@linux-foundation.org \
--cc=dev.jain@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mingo@redhat.com \
--cc=peterx@redhat.com \
--cc=ryan.roberts@arm.com \
--cc=shuah@kernel.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