mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bibo Mao <maobibo@loongson.cn>
To: Tiezhu Yang <yangtiezhu@loongson.cn>, Jinyang He <hejinyang@loongson.cn>
Cc: Huacai Chen <chenhuacai@kernel.org>,
	Xi Zhang <zhangxi@kylinos.cn>,
	Xianglai Li <lixianglai@loongson.cn>,
	loongarch@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] LoongArch: Handle special PC in unwind_next_frame()
Date: Thu, 27 Nov 2025 09:53:06 +0800	[thread overview]
Message-ID: <7ddd6efc-e7ad-b2f8-9a4d-5ca1cad9e74d@loongson.cn> (raw)
In-Reply-To: <87730f18-4ad7-2a21-f1bd-483074748b37@loongson.cn>



On 2025/11/27 上午9:39, Tiezhu Yang wrote:
> On 2025/11/26 下午5:56, Bibo Mao wrote:
>>
>>
>> On 2025/11/26 下午5:09, Tiezhu Yang wrote:
>>> Cc: Bibo Mao <maobibo@loongson.cn>
> ...
>>> +#if IS_ENABLED(CONFIG_KVM)
>>> +void (*get_kvm_entry_info)(unsigned long *old, unsigned long *new, 
>>> unsigned long *size);
>>> +EXPORT_SYMBOL_GPL(get_kvm_entry_info);
>>> +#endif
>> this method mixes kvm and unwind components and it is obvious hack 
>> method. If there are other modules which have the similar problem, how 
>> to handle it? Add get_MODULE_1_entry_info/get_MODULE_2_entry_info API :)
> 
> Currently, there is no other similar issue and something that should not
> happen in the future, this is "concrete question concrete analysis" and
> "handle special cases with special methods".
If so, I can think LoongArch unwind method is nasty. If this method is 
special for KVM module. KVM prefer to compile the exception function 
with built-in method, rather than using this nasty method.

Just be curious, it is the same orc unwind method. why is clean with 
file arch/x86/kernel/unwind_orc.c, however there is special handling 
bt_address() in file arch/loongarch/kernel/unwind_orc.c ?

> 
>> KVM module copy exception function to allocated memory, it breaks 
>> unwind rules. KVM can compile exception function in kernel and do not 
>> copy the exception functions or LoongArch kernel provides unwind hint 
>> APIs to handle it.
> 
> That is better if it is possible for KVM, no general API for kernel IMO.
> 
>>>   static inline unsigned long bt_address(unsigned long ra)
> ...
>>> +       get_kvm_entry_info = kvm_entry_info;
>> Is this API get_kvm_entry_info() general for all modules or kernel 
>> components?
> 
> No, it is just to get the necessary exception info for this special KVM
> case, we can use something like EXPORT_SYMBOL_FOR_KVM_INTERNAL to avoid
> the potential misuse if possible (not tested yet).
> 
> Thanks,
> Tiezhu


  reply	other threads:[~2025-11-27  1:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-25  6:33 Tiezhu Yang
2025-11-25  8:08 ` Huacai Chen
2025-11-25  8:54   ` Tiezhu Yang
2025-11-25  9:05     ` Huacai Chen
2025-11-26  5:36       ` Tiezhu Yang
2025-11-25 10:52 ` Jinyang He
2025-11-26  6:08   ` Tiezhu Yang
2025-11-26  6:28     ` Tiezhu Yang
2025-11-26  9:09       ` Tiezhu Yang
2025-11-26  9:27         ` Huacai Chen
2025-11-27  1:32           ` Tiezhu Yang
2025-11-26  9:56         ` Bibo Mao
2025-11-27  1:39           ` Tiezhu Yang
2025-11-27  1:53             ` Bibo Mao [this message]
2025-11-27  2:53               ` Jinyang He
2025-11-27  2:58                 ` Bibo Mao
2025-12-09  2:08         ` Tiezhu Yang

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=7ddd6efc-e7ad-b2f8-9a4d-5ca1cad9e74d@loongson.cn \
    --to=maobibo@loongson.cn \
    --cc=chenhuacai@kernel.org \
    --cc=hejinyang@loongson.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lixianglai@loongson.cn \
    --cc=loongarch@lists.linux.dev \
    --cc=yangtiezhu@loongson.cn \
    --cc=zhangxi@kylinos.cn \
    /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

all inboxes | Powered by JetHome®