On Fri, 5 Aug 2022 19:00:12 -0700, Nadav Amit nadav.amit@gmail.com wrote:
On Aug 5, 2022, at 12:59 PM, Sean Christopherson seanjc@google.com wrote:
On Fri, Aug 05, 2022, Michal Luczaj wrote:
On Fri, 5 Aug 2022 13:42:40 +0200, Paolo Bonzini pbonzini@redhat.com wrote:
The original reason was to test Linux using MOVBE even on non-Atom machines, when MOVBE was only on Atoms. :)
So the emulator's logic for MOVBE is meant to be tested only when the guest supports MOVBE while the host does not?
Ah, I see what you're asking. No, it's perfectly legal to test MOVBE emulation on hosts that support MOVBE, i.e. using FEP is allowed. But because KVM emulates MOVBE on #UD and the KUT testcase is guaranteed to generate a #UD (barring a hardware bug), there's no need to use FEP. And not using FEP is advantageous because it avoids depending on an opt-in non-production module param.
If history is discussed, the test was created long before FEP. Without FEP, the way to force the emulator to emulate an instruction was to set the instruction in memory that is not mapped to the guest. But, as Sean stated, this test always triggers #UD, so it was not necessary.
The purpose of this test was to check a KVM fix for a bug that was found during fuzzing:
https://lore.kernel.org/all/5475DC42.6000201@redhat.com/T/#m3a0da02d7c750c28...
OK, I think I finally get it. Thank you, guys, for all the details.
Michal