linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Hinko Kocevar <hinko.kocevar@ess.eu>,
	Linux PCI <linux-pci@vger.kernel.org>
Subject: Re: /proc/iomem and /proc/ioports show 0 for address range
Date: Wed, 13 Jan 2021 10:45:07 -0800	[thread overview]
Message-ID: <ae1da3a0-11d3-b1dd-601c-3169e783fcb4@infradead.org> (raw)
In-Reply-To: <375ef4e6-b9a1-d4f2-81b6-582f2152820d@ess.eu>

On 1/13/21 2:29 AM, Hinko Kocevar wrote:
> [I noticed this while working on PCI devices; not sure which kernel list would be best for this, though]
> 
> I noticed that my system shows address range for iomem and ioports as all 0. Sometimes (after a power cycle) the addresses are proper, albeit I have not been able to see that in a while now, after performing numerous reboots in the last coupe of days.
> 
> FWIW, I think the list of devices (names, count) looks the same in both cases. The system seems to work in both cases; at least I have not seen any complaints in kernel logs, OTOH, not sure what the error message would be.
> 
> What may be the reason for not getting the proper addresses listed?

config STRICT_DEVMEM
	bool "Filter access to /dev/mem"

and

config IO_STRICT_DEVMEM
	bool "Filter I/O access to /dev/mem"

so what are your CONFIG_STRICT_DEVMEM and CONFIG_IO_STRICT_DEVMEM set to?

What do you see in /proc/iomem and /proc/ioports if you are admin/root?
That should be non-zero values.

> This likely poses any issues for userspace tools that would look at those /proc files, OTOH, I wonder if would kernel suffer in any way as well?

Yes, it could affect userspace.

> Kernel version is 5.10.0 (pci git tree).
> 
> [dev@bd-cpu18 ~]$ cat /proc/iomem
> 00000000-00000000 : Reserved
> 00000000-00000000 : System RAM
> 00000000-00000000 : Reserved
> 00000000-00000000 : PCI Bus 0000:00
> 00000000-00000000 : Video ROM
> 00000000-00000000 : Reserved
>   00000000-00000000 : System ROM
> 00000000-00000000 : System RAM
>   00000000-00000000 : Kernel code
>   00000000-00000000 : Kernel rodata
>   00000000-00000000 : Kernel data
>   00000000-00000000 : Kernel bss


-- 
~Randy
You can't do anything without having to do something else first.
-- Belefant's Law

  reply	other threads:[~2021-01-13 18:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13 10:29 /proc/iomem and /proc/ioports show 0 for address range Hinko Kocevar
2021-01-13 18:45 ` Randy Dunlap [this message]
2021-01-13 21:27   ` Hinko Kocevar

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=ae1da3a0-11d3-b1dd-601c-3169e783fcb4@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=hinko.kocevar@ess.eu \
    --cc=linux-pci@vger.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;
as well as URLs for NNTP newsgroup(s).