[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ea6bf206-6a68-496e-a941-4423973ef4ba@linux.dev>
Date: Fri, 1 Aug 2025 16:00:43 +0800
From: Kunwu Chan <kunwu.chan@...ux.dev>
To: Mostafa Saleh <smostafa@...gle.com>
Cc: linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] KVM: arm64: Dump instruction on hyp panic
Hi Mostafa,
On 2025/7/31 21:05, Mostafa Saleh wrote:
> Hi Kunwu,
>
> On Thu, Jul 31, 2025 at 1:59 PM Kunwu Chan <kunwu.chan@...ux.dev> wrote:
>> Hi Mostafa,
>> On 2025/7/18 07:47, Mostafa Saleh wrote:
>>
>> ... ....
>>
>>> + /* Dump the faulting instruction */
>>> + if (!is_protected_kvm_enabled() ||
>>> + IS_ENABLED(CONFIG_NVHE_EL2_DEBUG))
>>> + dump_instr(panic_addr + kaslr_offset());
>>> +
>> This part seem like unnecessary, cause it'll be remove in patch 2(Only
>> the comment left).
>>
> Yes, the idea is that the first patch adds that only for CONFIG_NVHE_EL2_DEBUG
> while the second does that for all configs, I split it this way as
> doing that with stage-2
> requires intrusive changes, so at least this patch can be picked
> separately if needed.
>
>>> /*
>>> * Hyp has panicked and we're going to handle that by panicking the
>>> * kernel. The kernel offset will be revealed in the panic so we're
>> Another confusion is that no similar wording to what you mentioned in
>> the cover—specifically "Cannot dump pKVM nVHE stacktrace:
>> !CONFIG_PROTECTED_NVHE_STACKTRACE"—has been found in the code.
>>
> I am not sure I follow, this has nothing to do with
> "CONFIG_PROTECTED_NVHE_STACKTRACE"
> This series added the print for for instructions as:
> [ 12.016044] Code: a8c17bfd d50323bf d65f03c0 d503245f (d4210000)
>
> All other prints are from already existing code.
Got it—I see what happened now. Turns out the confusion was caused
by my CONFIG_PROTECTED_NVHE_STACKTRACE being enabled.
After turning that off and testing Patch 1 standalone, everything works
exactly as you described.
The test results:
1: disable CONFIG_NVHE_EL2_DEBUG
--> "kvm [5375]: Hyp Offset: 0xfffec95693400000"
2: enable CONFIG_NVHE_EL2_DEBUG
--> "[ 684.715883][ T5525] Code: d51d991f d51d9901 d5159001 00000000
(d4210000)
[ 684.715974][ T5525] kvm [5525]: Hyp Offset:
0xfffe992b13400000"
3: without this patch :
--> "kvm [5497]: Hyp Offset: 0xfffedd4993400000"
Thanks for the clarification—really appreciate your help!
>
> Thanks,
> Mostafa
Feel free to add :
Tested-by: Kunwu Chan <chentao@...inos.cn>
Reviewed-by: Kunwu Chan <chentao@...inos.cn>
--
Thanks,
Kunwu Chan.
Powered by blists - more mailing lists