Skip to contentSkip to conversation

kvm: Use the proper mask to check for the LAZY bit.

PATCH New Sebastian Andrzej Siewior 1 participant 1 message Oct 25, 2024 Generic entry code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm: Use the proper mask to check for the LAZY bit.

To check for the LAZY bit in ti_work, it is needed to use _TIF_NEED_RESCHED_LAZY which contains the shifted bit (the mask) instead of TIF_NEED_RESCHED_LAZY which contains the bit number.

This broke while switch from the old PREEMPT_LAZY code to PREEMPT_AUTO.

Use _TIF_NEED_RESCHED_LAZY instead of TIF_NEED_RESCHED_LAZY.

---
 kernel/entry/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/entry/kvm.c +1 -1
index d952fa5ee8801..5253d3d2d0139 100644
@@ -13,7 +13,7 @@ static int xfer_to_guest_mode_work(struct kvm_vcpu *vcpu, unsigned long ti_work)
 			return -EINTR;
 		}
 
-		if (ti_work & (_TIF_NEED_RESCHED | TIF_NEED_RESCHED_LAZY))
+		if (ti_work & (_TIF_NEED_RESCHED | _TIF_NEED_RESCHED_LAZY))
 			schedule();
 
 		if (ti_work & _TIF_NOTIFY_RESUME)
Signature · 1 line
2.45.2