kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* What's with all of the hardcoded instruction lengths in svm.c?
@ 2019-06-12 20:17 Jim Mattson
  2019-06-13 13:55 ` Vitaly Kuznetsov
  0 siblings, 1 reply; 4+ messages in thread
From: Jim Mattson @ 2019-06-12 20:17 UTC (permalink / raw)
  To: kvm list

Take the following code in rdmsr_interception, for example.

svm->next_rip = kvm_rip_read(&svm->vcpu) + 2;

Yes, the canonical rdmsr instruction is two bytes. However, there is
nothing in the architectural specification prohibiting useless or
redundant prefixes. So, for instance, 65 66 67 67 67 0f 32 is a
perfectly valid 7-byte rdmsr instruction.

It looks like this code was checked in with commit 6aa8b732ca01c
("kvm: userspace interface"), with nary a word of explanation.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-06-14 17:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-12 20:17 What's with all of the hardcoded instruction lengths in svm.c? Jim Mattson
2019-06-13 13:55 ` Vitaly Kuznetsov
2019-06-13 16:08   ` Jim Mattson
2019-06-14 17:01     ` Vitaly Kuznetsov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).