Re: [PATCH v2] tools/mm: add hwpoison-panic tool

Breno Leitao <[email protected]>
Newsgroups org.infradead.lists.linux-riscv,org.kernel.vger.linux-kernel,org.kvack.linux-mm
Message-ID <[email protected]>
Hello Miaohe,

First of all, thanks for looking at this one.

On Thu, Aug 13, 2026 at 03:32:34PM +0800, Miaohe Lin wrote:
> On 2026/8/3 19:31, Breno Leitao wrote:
> > +static int pick_kpageflags_phys_addr(uint64_t want, uint64_t *phys_addr)
> > +{
> > +	uint64_t pfn = (16UL << 20) / page_size;
> 
> Could we use SZ_16M macro here?

Sure, for that I will include ../../include/linux/sizes.h in the next
version.

> > +/* hard_offline_page() injects with MF_SW_SIMULATED, so unpoison is allowed. */
> > +static void unpoison_pfn(uint64_t pfn)
> > +{
> > +	char path[PATH_MAX], buf[32];
> > +	const char *debugfs;
> > +	int fd, len;
> > +
> > +	debugfs = debugfs__mount();
> 
> I might be miss something but I can't find the implementation of debugfs__mount.

It is an ugly macro declared in tools/lib/api/fs/fs.h:

        #define FS(name)                                \
                const char *name##__mountpoint(void);   \
                const char *name##__mount(void);        \
                bool name##__configured(void);

And then:
        FS(debugfs)

> > +	if (access(INJECT_PATH, W_OK))
> > +		fatal("%s not present (no MEMORY_HOTPLUG?)\n", INJECT_PATH);
> 
> MEMORY_HOTPLUG?

lol. it should be MEMORY_FAILURE

I will get these points fixed and respin.
--breno

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.