From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: 20240223063608.2605736-1-liuyongqiang13@huawei.com
Cc: liuyongqiang13@huawei.com, arnd@arndb.de, keescook@chromium.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, m.szyprowski@samsung.com,
rppt@linux.ibm.com, sunnanyong@huawei.com,
wangkefeng.wang@huawei.com, willy@infradead.org,
yanaijie@huawei.com, zhangxiaoxu5@huawei.com
Subject: Re: [PATCH v2] arm: flush: check if the folio is reserved for no-mapping addresses
Date: Mon, 26 Feb 2024 11:57:29 +0000 [thread overview]
Message-ID: <Zdx8qZLyjh4pO+vx@shell.armlinux.org.uk> (raw)
In-Reply-To: <788c8a64-09ed-96fd-9878-ed126b09c683@huawei.com>
On Mon, Feb 26, 2024 at 02:38:58PM +0800, Jinjiang Tu wrote:
> Since some abuses of pfn_valid() have been reported, I check all the use of
> pfn_valid(), and find some suspicious cases.
I do get really tired of kernel interfaces migrating to become something
different from what they were when code was originally written, and then
having users of that interface labelled as "suspicious" or an "abuse".
I don't follow MM stuff, so I can't comment on the rights or wrongs of
this, but what I understood was that pfn_valid() is there to check that
for a given PFN, pfn_to_page() would return a valid pointer to a struct
page. Given that we only have struct page's for memory which the kernel
is managing, this seems entirely correct.
There may be other RAM in the system which is being managed via
different mechanisms, and because those won't have a struct page
associated with them, pfn_valid() should be returning false (which
means memory carved out for e.g. other processors etc) won't be mapped
cacheable.
Or at least that's how things used to be - because 32-bit Arm's
pfn_valid() was implemented by checking memblock for memory, and
stolen memory _was_ removed from memblock.memory (see
arm_memblock_steal) or quite simply these areas were not passed to
the kernel as memory.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next parent reply other threads:[~2024-02-26 11:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <788c8a64-09ed-96fd-9878-ed126b09c683@huawei.com>
2024-02-26 11:57 ` Russell King (Oracle) [this message]
2024-02-23 6:36 [PATCH v2] arm: flush: check if the folio is reserved for no-mapping addresses Yongqiang Liu
2024-02-26 7:03 ` Jinjiang Tu
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=Zdx8qZLyjh4pO+vx@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=20240223063608.2605736-1-liuyongqiang13@huawei.com \
--cc=arnd@arndb.de \
--cc=keescook@chromium.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuyongqiang13@huawei.com \
--cc=m.szyprowski@samsung.com \
--cc=rppt@linux.ibm.com \
--cc=sunnanyong@huawei.com \
--cc=wangkefeng.wang@huawei.com \
--cc=willy@infradead.org \
--cc=yanaijie@huawei.com \
--cc=zhangxiaoxu5@huawei.com \
/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).