On 03 September 2026 at 07:23 Shrikanth Hegde [off-list ref] wrote:
Friendly LLM analysis says preemption is enabled too early and before
completing kvmppc_handle_exit_hv() / kvmppc_handle_nested_exit()
Below is ONLY a speculation and completely UNTESTED.
Maybe worth a try.
---
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 0409ac9e7b31..78d2b0618887 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -5049,8 +5049,6 @@ int kvmhv_run_single_vcpu(struct kvm_vcpu *vcpu, u64 time_limit,
powerpc_local_irq_pmu_restore(flags);
- preempt_enable();
-
/*
* cancel pending decrementer exception if DEC is now positive, or if
* entering a nested guest in which case the decrementer is now owned@@ -5072,6 +5070,8 @@ int kvmhv_run_single_vcpu(struct kvm_vcpu *vcpu, u64 time_limit,
}
vcpu->arch.ret = r;
+ preempt_enable();
+
if (is_kvmppc_resume_guest(r) && !kvmppc_vcpu_check_block(vcpu)) {
kvmppc_set_timer(vcpu);
Michal
- - -
Michal,
Is this patch also for the issues with KVM PR and KVM HV if PREEMPT is activated?
The entire FSL Cyrus+ board freezes when using KVM HV with PREEMPT.
The guest kernel doesn't boot if we use KVM PR with a PREEMPT kernel on
the PA Semi Nemo board.
Bug report: https://github.com/chzigotzky/kernels/issues/19
Thanks,
Christian