From: George Guo <dongtai.guo@linux.dev>
To: pratyush@kernel.org
Cc: rppt@kernel.org, pasha.tatashin@soleen.com, shuah@kernel.org,
ardb@kernel.org, chenhuacai@kernel.org, guodongtai@kylinos.cn,
kernel@xen0n.name, graf@amazon.com, liukexin@kylinos.cn,
loongarch@lists.linux.dev, linux-kernel@vger.kernel.org,
kexec@lists.infradead.org, linux-mm@kvack.org,
linux-kselftest@vger.kernel.org, linux-efi@vger.kernel.org
Subject: Re: [PATCH v4 3/4] liveupdate: luo_session: include linux/mm.h for virt/phys translation
Date: Wed, 12 Aug 2026 18:25:32 +0800 [thread overview]
Message-ID: <20260812102532.32673-1-dongtai.guo@linux.dev> (raw)
In-Reply-To: <2vxzfr0l6fam.fsf@kernel.org>
Hi Pratyush,
You are right: the current luo_session.c does not call virt_to_phys() or
phys_to_virt(). I failed to update the target of this fix when rebasing the
patch. The calls that trigger the current failure are in
kernel/liveupdate/kho_block.c. Sorry about that.
I also checked the include chain. asm/kfence.h is not included by this
translation unit. include/linux/slab.h does not include linux/kfence.h; that
inclusion is in the MM-private mm/slab.h. Moreover, asm/kfence.h itself
includes linux/kfence.h, which includes linux/mm.h, so
arch_kfence_init_pool() already has the required declarations.
The actual failure is:
kernel/liveupdate/kho_block.c: In function 'kho_block_set_is_cyclic':
./arch/loongarch/include/asm/io.h:81:9: error: implicit declaration of function 'page_address'
kernel/liveupdate/kho_block.c:210:16: note: in expansion of macro 'phys_to_virt'
The underlying issue is that LoongArch's CONFIG_KFENCE version of
phys_to_virt() uses page_address(), which is provided by linux/mm.h.
Your broader point about fixing this at the architecture level is valid. I
previously tried including linux/mm.h from asm/io.h [1], but that introduces a
circular include through:
linux/slab.h -> linux/kasan.h -> asm/kasan.h -> asm/io.h
-> linux/mm.h -> linux/slab.h
As reported by the kernel test robot [2], this leaves kfree() undeclared while
linux/mm.h is being parsed. A proper architecture-wide fix therefore requires
refactoring the address conversion helpers rather than adding that include to
asm/io.h.
For this series I will move the linux/mm.h include from luo_session.c to the
actual user, kho_block.c, and consider the architecture-wide cleanup
separately.
[1] https://lore.kernel.org/r/20260521063310.52926-1-dongtai.guo@linux.dev/
[2] https://lore.kernel.org/r/202605211925.DbDvQ6ii-lkp@intel.com/
Thanks,
George
next prev parent reply other threads:[~2026-08-12 10:25 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-07 10:37 [PATCH v4 0/4] LoongArch: add KHO support and selftests George Guo
2026-08-07 10:37 ` [PATCH v4 1/4] efi: add a KHO configuration table GUID George Guo
2026-08-09 4:18 ` Huacai Chen
2026-08-10 13:13 ` Ard Biesheuvel
2026-08-10 14:35 ` Huacai Chen
2026-08-10 16:19 ` Pratyush Yadav
2026-08-07 10:37 ` [PATCH v4 2/4] LoongArch: kexec: add KHO support George Guo
2026-08-10 14:42 ` Huacai Chen
2026-08-10 17:37 ` Pratyush Yadav
2026-08-07 10:37 ` [PATCH v4 3/4] liveupdate: luo_session: include linux/mm.h for virt/phys translation George Guo
2026-08-10 14:37 ` Huacai Chen
2026-08-10 17:39 ` Pratyush Yadav
2026-08-10 17:44 ` Pratyush Yadav
2026-08-12 10:25 ` George Guo [this message]
2026-08-07 10:37 ` [PATCH v4 4/4] selftests/kho: add LoongArch vmtest support George Guo
2026-08-09 4:16 ` Huacai Chen
2026-08-13 16:03 ` George Guo
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=20260812102532.32673-1-dongtai.guo@linux.dev \
--to=dongtai.guo@linux.dev \
--cc=ardb@kernel.org \
--cc=chenhuacai@kernel.org \
--cc=graf@amazon.com \
--cc=guodongtai@kylinos.cn \
--cc=kernel@xen0n.name \
--cc=kexec@lists.infradead.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liukexin@kylinos.cn \
--cc=loongarch@lists.linux.dev \
--cc=pasha.tatashin@soleen.com \
--cc=pratyush@kernel.org \
--cc=rppt@kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.