Skip to content

Commit 019057b

Browse files
committed
KVM: SEV-ES: fix length of string I/O
The size of the data in the scratch buffer is not divided by the size of each port I/O operation, so vcpu->arch.pio.count ends up being larger than it should be by a factor of size. Cc: [email protected] Fixes: 7ed9abf ("KVM: SVM: Support string IO operations for an SEV-ES guest") Acked-by: Tom Lendacky <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 2353e59 commit 019057b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/svm/sev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2583,7 +2583,7 @@ int sev_es_string_io(struct vcpu_svm *svm, int size, unsigned int port, int in)
25832583
return -EINVAL;
25842584

25852585
return kvm_sev_es_string_io(&svm->vcpu, size, port,
2586-
svm->ghcb_sa, svm->ghcb_sa_len, in);
2586+
svm->ghcb_sa, svm->ghcb_sa_len / size, in);
25872587
}
25882588

25892589
void sev_es_init_vmcb(struct vcpu_svm *svm)

0 commit comments

Comments
 (0)