[Devel] [PATCH hci-8.1 02/14] ms/KVM: x86: Conditionally resched when restarting REP string emulation

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Tue Dec 1 03:34:41 MSK 2026


> From: Sean Christopherson <seanjc at google.com>
> 
> [ Upstream commit ae85ac25eb671d174811cc3101549448671fd505 ]
> 
> When restarting emulation, e.g. of a REP-prefixed string instruction,
> conditionally reschedule as emulating guest writes can be deceptively slow
> and expensive, e.g. when shadow paging is in use and each write can trigger
> write tracking.
> 
> In a perfect world, restarting emulation (or not) would be less arbitrary,
> e.g. would honor not only host events (NEED_RESCHED, signals, etc.) but
> also guest events (e.g. by checking kvm_vcpu_has_events()).  Unfortunately,
> as pointed out by Sashiko, pio_in_emulated()'s read-ahead logic is baked
> into the restart logic, as KVM relies on restarting emulation to drain the
> cache and avoid duplicate reads from the I/O port.  I.e. re-entering the
> [ ... ]
> (cherry picked from commit c1293d2134c2d63741b197a1e5a6363894ed4bce)
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-157287
> Feature: fix ms/kvm
> Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>

Sashiko has reviewed this patch and found no issues.

Carry the trailer below into the next revision and Sashiko will not review this patch again.

Reviewed-by: Sashiko <no-reply at sashiko.virtuozzo.com>

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261126-khorenko-vstor-157133-klp-and-kvm-fixes-v1-0-0ec8eaadf1bc@virtuozzo.com?part=2




More information about the Devel mailing list