Kernel KVM-PPC virtualization development
 help / color / mirror / Atom feed
From: Shrikanth Hegde <sshegde@linux.ibm.com>
To: Christian Zigotzky <chzigotzky@xenosoft.de>
Cc: "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	harshpb@linux.ibm.com, "Gautam Menghani" <gautam@linux.ibm.com>,
	amachhiw@linux.ibm.com,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	"kvm-ppc@vger.kernel.org" <kvm-ppc@vger.kernel.org>,
	"Madhavan Srinivasan" <maddy@linux.ibm.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"R.T.Dickinson" <rtd2@xtra.co.nz>,
	hypexed@yahoo.com.au, "mad skateman" <madskateman@gmail.com>,
	"Christian Zigotzky" <info@xenosoft.de>,
	"Samir M" <samir@linux.ibm.com>,
	"Venkat Rao Bagalkote" <venkat88@linux.ibm.com>,
	"Narayana Murty N" <nnmlinux@linux.ibm.com>,
	"Hari Bathini" <hbathini@linux.ibm.com>,
	"Michal Suchánek" <msuchanek@suse.de>
Subject: Re: [Linux PPC] Disable PREEMPT
Date: Thu, 24 Sep 2026 00:12:15 +0530	[thread overview]
Message-ID: <0fbc2522-791a-482b-a756-f3e6e61d2e29@linux.ibm.com> (raw)
In-Reply-To: <b8f82519-9ae5-c247-e020-e79c627e57df@xenosoft.de>

Hi

On 9/23/26 9:31 PM, Christian Zigotzky wrote:
> On 23/09/26 07:13, Shrikanth Hegde wrote:
>>
>>
>> On 9/23/26 10:39 AM, Christian Zigotzky wrote:
>>> On 21/09/26 07:12, Shrikanth Hegde wrote:
>>>> Hi Christian.
>>>>
>>>> On 9/20/26 6:34 PM, Christian Zigotzky wrote:
>>>>> On 09/20/2026 01:49 PM, Christian Zigotzky wrote:
>>>>>> On 09/18/2026 09:10 AM, Michal Suchánek wrote:
>>>>>>> On Fri, Sep 18, 2026 at 04:39:57AM +0200, Christian Zigotzky wrote:
>>>>>>>> On 17/09/26 16:15, Shrikanth Hegde wrote:
>>>>>>>>> Hi Michal,
>>>>>>>>>
>>>>>>>>>>> Give it a try.
>>>>>>>>>>>
>>>>>>>>>>> I am suspecting both lockup, stack corruptions are secondary
>>>>>>>>>>> symptoms here.
>>>>>>>>>>> While recreate, I have different type of traces.
>>>>>>>>>> Yes, it does work for the crash I see.
>>>>>>>>> Thanks. Give me sometime to see further on that. Didn't get any time
>>>>>>>>> today.
>>>>>>>>>
>>>>>>>>>> However, we hijacked the report
>>>>>>>>>> of KVM locking up on FSL Cyrus+, and that is likely a different problem
>>>>>>>>>> still not addressed.
>>>>>>>>>>
>>>>>>>>> Ah, that's what you meant. Yes, i still don't know where FSL Cyrus+ is
>>>>>>>>> stuck.
>>>>>>>>>
>>>>>>>>> I would need help from FSL Cyrus+ to get some logs or is there a way we
>>>>>>>>> can spin of
>>>>>>>>> a QEMU guest of it? We should have the log to start somewhere.
>>>>>>>>>
>>>>>>>>>
>>>>>>>> It's difficult to get a log because it freezes and can't write any error
>>>>>>>> messages to the log files. This bug is very old. We had this issue some
>>>>>>>> years ago but we was able to disable PREEMPT because we don't need it.
>>>>>>> I would expect serial console and sysrq could give something, depending
>>>>>>> on how much of the kernel is frozen.
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>> Michal
>>>>>> Here is a serial log: https://github.com/user-attachments/files/32433586/e5500_preempt_putty.log
>>>>>>
>>>>
>>>> Thanks Michal for helping to get the traces.
>>>>
>>>>> Another serial log with pcie_ports=compat: https://github.com/user-attachments/files/32434487/e5500_preempt_pcie_ports_compat_putty.log
>>>>>
>>>>
>>>> I see it is mostly busy with printing
>>>> WARNING: at .enable_kernel_fp+0x30/0x78, CPU#3: qemu-system-ppc/4884
>>>>
>>>> The path seems to be same also.
>>>>
>>>> [c000000085ca7700] [c00000000005de84] .kvmppc_load_guest_fp+0x30/0x80
>>>> [c000000085ca7780] [c00000000005f2a0] .kvmppc_handle_exit+0x5bc/0x5cc
>>>> [c000000085ca7830] [c00000000006204c] .kvmppc_resume_host+0xb8/0x10c
>>>>
>>>>
>>>> Does below help to boot or make it stable?
>>>> ---
>>>>  arch/powerpc/kvm/booke.c | 9 ++++++++-
>>>>  1 file changed, 8 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
>>>> index 13ad4cf5fa71..d4be7a306bfc 100644
>>>> --- a/arch/powerpc/kvm/booke.c
>>>> +++ b/arch/powerpc/kvm/booke.c
>>>> @@ -1404,10 +1404,17 @@ int kvmppc_handle_exit(struct kvm_vcpu *vcpu, unsigned int exit_nr)
>>>>          if (s <= 0)
>>>>              r = (s << 2) | RESUME_HOST | (r & RESUME_FLAG_NV);
>>>>          else {
>>>> -            /* interrupts now hard-disabled */
>>>> +            /*
>>>> +             * interrupts now hard-disabled. i.e EE=0
>>>> +             * But irqs_disabled relies on PACA entries
>>>> +             * and fixup below enables it.
>>>> +             * So irqs_disabled == false
>>>> +             */
>>>>              kvmppc_fix_ee_before_entry();
>>>> +            preempt_disable();
>>>>              kvmppc_load_guest_fp(vcpu);
>>>>              kvmppc_load_guest_altivec(vcpu);
>>>> +            preempt_enable_no_resched();
>>>>          }
>>>>      }
>>>>
>>>>
>>> Hi,
>>>
>>> Thanks a lot for your patch!
>>>
>>> I patched the 7.3-rc4 kernel sources with your new patch and compiled the kernel again yesterday. [1]
>>>
>>
>> Thanks for trying.
>>
>>> Unfortunately, the issue still exists.
>>>
>>
>> Can you share the console log of the kernel with the patch applied?
>> We need to see where it is stuck now. Has it made forward progress?
>>
>>> I tested it with a guest kernel with and without preempt support.
>>>
>>> Cheers,
>>> Christian
>>>
>>> [1] https://github.com/chzigotzky/kernels/releases/tag/v7.3.0-rc4-2-preempt
>>>
>>
> Here is a new serial log from the patched kernel: https://github.com/user-attachments/files/32570808/e5500_preempt_pcie_ports_compat_patched_putty.log
> 

That paca mismatch is independent of preemption modes.

It shows a few warnings and even after that a console message has come through.
Do warning continue forever?

To fix those warnings, can you try this diff on the top of the earlier ones?
(Igonore whitespace mangling if any, Also patch is UNTESTED. It is more of my
speculation.).

Sorry, I don't have any way to test it out locally.

---

diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 9194cf492d1c..0a014fa45b20 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -147,6 +147,19 @@ int kvmppc_prepare_to_enter(struct kvm_vcpu *vcpu)
                         continue;
                 }
  
+#ifdef CONFIG_PPC64
+               if (unlikely(local_paca->irq_happened != PACA_IRQ_HARD_DIS)) {
+               /*
+                * An interrupt arrived between the soft and hard
+                * disable. Replay it and retry guest entry.
+                */
+                       local_irq_enable();
+                       local_irq_disable();
+                       hard_irq_disable();
+                       continue;
+               }
+#endif
+
                 guest_enter_irqoff();
                 return 1;
         }


> Thanks
> 


  reply	other threads:[~2026-09-23 18:42 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-14 14:02 [Linux PPC] KVM PR and KVM HV do not work if the kernel was compiled with PREEMPT Christian Zigotzky
2026-02-17  5:02 ` Shrikanth Hegde
2026-02-17  8:52   ` Christian Zigotzky
2026-02-17  9:03     ` Shrikanth Hegde
2026-02-17  9:44       ` Christian Zigotzky
2026-02-17 10:17         ` Madhavan Srinivasan
2026-02-17 10:26           ` Christian Zigotzky
2026-02-17 11:34             ` Shrikanth Hegde
2026-02-21  5:30               ` Christian Zigotzky
2026-02-23  3:45                 ` Shrikanth Hegde
2026-02-23 16:48                   ` [Linux PPC] 7.0-rc1: e500_mmu.c:923:26: error: assignment to 'struct tlbe_priv *' from incompatible pointer type 'struct tlbe_ref *' Christian Zigotzky
2026-02-23 18:07                     ` Christophe Leroy (CS GROUP)
2026-02-23 19:38                       ` Christophe Leroy (CS GROUP)
2026-02-23 22:40                         ` Kees Cook
2026-02-24  6:30                           ` Christian Zigotzky
2026-02-24  7:18                           ` Christophe Leroy (CS GROUP)
2026-02-25  5:54               ` [Linux PPC] Disable PREEMPT Christian Zigotzky
2026-02-25  6:23                 ` Shrikanth Hegde
2026-02-25  7:16                 ` Christophe Leroy (CS GROUP)
2026-02-25 11:36                   ` Peter Zijlstra
2026-02-26  5:37                   ` Christian Zigotzky
2026-02-26 13:24                     ` Christophe Leroy (CS GROUP)
2026-09-03  9:53                       ` Michal Suchánek
2026-09-03 10:56                         ` Shrikanth Hegde
2026-09-03 11:25                           ` Michal Suchánek
2026-09-03 11:31                             ` Shrikanth Hegde
2026-09-03 11:40                               ` Michal Suchánek
2026-09-03 12:04                                 ` Shrikanth Hegde
2026-09-03 12:25                                   ` Michal Suchánek
2026-09-03 12:36                                     ` Harsh Prateek Bora
2026-09-03 12:55                                       ` Michal Suchánek
2026-09-03 15:17                                         ` Amit Machhiwal
2026-09-03 13:28                                       ` Michal Suchánek
2026-09-04  7:39                                         ` Michal Suchánek
2026-09-21  8:06                                         ` Michal Suchánek
2026-09-21 16:46                                           ` Michal Suchánek
2026-09-21 17:20                                             ` Shrikanth Hegde
2026-09-22  8:22                                               ` Michal Suchánek
2026-09-03 17:22                             ` Shrikanth Hegde
2026-09-04  7:35                               ` Michal Suchánek
2026-09-04  9:04                                 ` Shrikanth Hegde
2026-09-10  8:59                                   ` Michal Suchánek
2026-09-10 10:41                                     ` Shrikanth Hegde
2026-09-10 11:29                                       ` Michal Suchánek
2026-09-10 12:16                                         ` Michal Suchánek
2026-09-11 17:09                                           ` Shrikanth Hegde
2026-09-14 10:58                                             ` Michal Suchánek
2026-09-15  5:47                                               ` Narayana Murty N
2026-09-15  7:35                                                 ` Michal Suchánek
2026-09-15  9:08                                                   ` Shrikanth Hegde
2026-09-16 18:11                                                     ` Shrikanth Hegde
2026-09-17 10:14                                                       ` Michal Suchánek
2026-09-17 10:28                                                         ` Shrikanth Hegde
2026-09-17 13:12                                                           ` Michal Suchánek
2026-09-17 14:15                                                             ` Shrikanth Hegde
2026-09-18  2:39                                                               ` Christian Zigotzky
2026-09-18  7:10                                                                 ` Michal Suchánek
2026-09-20 11:49                                                                   ` Christian Zigotzky
2026-09-20 13:04                                                                     ` Christian Zigotzky
2026-09-21  5:12                                                                       ` Shrikanth Hegde
2026-09-23  5:09                                                                         ` Christian Zigotzky
2026-09-23  5:13                                                                           ` Shrikanth Hegde
2026-09-23 16:01                                                                             ` Christian Zigotzky
2026-09-23 18:42                                                                               ` Shrikanth Hegde [this message]
2026-09-24 17:47                                                                                 ` Christian Zigotzky
2026-09-25  6:40                                                                                   ` Shrikanth Hegde
2026-09-18  9:26                                                               ` Shrikanth Hegde
2026-09-18 11:52                                                                 ` Michal Suchánek
2026-09-04  8:55                               ` Christian Zigotzky
2026-09-04  9:20                                 ` Christian Zigotzky
2026-09-04  9:24                                   ` Shrikanth Hegde
2026-09-04  9:34                                     ` Christian Zigotzky
2026-09-05 13:07                                       ` Christian Zigotzky
2026-09-07  8:50                                         ` Michal Suchánek
2026-09-07 11:32                                           ` Christian Zigotzky
2026-09-10  8:54                                             ` Michal Suchánek
2026-09-10 10:31                                               ` Michal Suchánek
2026-09-10 11:31                                                 ` Michal Suchánek

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=0fbc2522-791a-482b-a756-f3e6e61d2e29@linux.ibm.com \
    --to=sshegde@linux.ibm.com \
    --cc=amachhiw@linux.ibm.com \
    --cc=chleroy@kernel.org \
    --cc=chzigotzky@xenosoft.de \
    --cc=gautam@linux.ibm.com \
    --cc=harshpb@linux.ibm.com \
    --cc=hbathini@linux.ibm.com \
    --cc=hypexed@yahoo.com.au \
    --cc=info@xenosoft.de \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=madskateman@gmail.com \
    --cc=mpe@ellerman.id.au \
    --cc=msuchanek@suse.de \
    --cc=nnmlinux@linux.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rtd2@xtra.co.nz \
    --cc=samir@linux.ibm.com \
    --cc=venkat88@linux.ibm.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