Re: [PATCH v2 2/3] KVM: PPC: Book3S HV: Add preempt_disable() around virtual-mode HPTE bit-lock users
From: Shrikanth Hegde
Date: Mon Oct 05 2026 - 23:02:17 EST
On 10/5/26 11:57 PM, Amit Machhiwal wrote:
Hi Shrikanth,
Thanks for the review. Please find my responses inline below.
I don't like this sprinkling of preempt disable/enable.
Is there not a way to embedd this in try_lock_hpte/unlock_hpte?
I understand the scattering of preempt_disable()/preempt_enable() looks ugly.
But there are two blockers for that approach:
1. The real-mode hcall dispatch table (hcall_real_table in
book3s_hv_rmhandlers.S) calls kvmppc_h_enter(), kvmppc_h_remove(),
kvmppc_h_bulk_remove() and others in book3s_hv_rm_mmu.c, which all call
try_lock_hpte() from real mode. Adding preempt_disable() inside
try_lock_hpte() would affect those real-mode callers, which brings us to your
second point.
Fair enough.
Reviewed-by: Shrikanth Hegde <sshegde@xxxxxxxxxxxxx>