Question about EMULATE_DO_MMIO
Hi Avi,
I was trying to avoid vm86 mode completely, by using emulation for
all the real mode code emulation. It is doing better than vm86 mode, but I am seeing one issue with this approch.
The emulator is failing due to this code. Seems like the execution
need to go back to qemu to finish some pending MMIO.
if (vcpu->mmio_is_write) {
vcpu->mmio_needed = 0;
return EMULATE_DO_MMIO;
}Do you have how should it be handled? I am not clear what needs to be done to handle this situation properly.
Signature · 5 lines
Thanks & Regards, Nitin Open Source Technology Center, Intel Corporation ----------------------------------------------------------------- The mind is like a parachute; it works much better when it's open
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel
Quoted 3 lines · Nitin A Kamble
Hi Avi,
I was trying to avoid vm86 mode completely, by using emulation for
all the real mode code emulation. It is doing better than vm86 mode,
Why do you think it is better? I would have thought that vm86 is much faster.
I thought of doing it this way:
- try to run normally
- if vm entry failed due to invalid guest state (the famous 0x80000021), then emulate 50 instructions
- repeat
That will also handle the few cases where VT can't handle protected mode.
Quoted 6 lines
but
I am seeing one issue with this approch.The emulator is failing due to this code. Seems like the execution
need to go back to qemu to finish some pending MMIO.
Quoted 8 lines
if (vcpu->mmio_is_write) { vcpu->mmio_needed = 0; return EMULATE_DO_MMIO; }Do you have how should it be handled? I am not clear what needs to be done to handle this situation properly.
It should exit to userspace, same as the non-emulating case. However it shouldn't happen for normal writes.
Signature · 8 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
Quoted 3 lines · Avi Kivity
Why do you think it is better? I would have thought that vm86 is much faster.
I am seeing execution going to strange places in vm86 mode. That issue is not coming in the emulation.
Quoted 7 lines
I thought of doing it this way:
- try to run normally
- if vm entry failed due to invalid guest state (the famous0x80000021),
then emulate 50 instructions
- repeat
This may be better, I will give it a try.
Quoted 7 lines
That will also handle the few cases where VT can't handle protected mode.
It should exit to userspace, same as the non-emulating case. However it
shouldn't happen for normal writes.
Only thing is if it in the real mode, then returning back to user mode will setup the cpu state as real mode, and because of that vmenter will fail.
Quoted 6 lines
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Thanks a lot for your input.
Signature · 5 lines
Thanks & Regards, Nitin Open Source Technology Center, Intel Corporation ----------------------------------------------------------------- The mind is like a parachute; it works much better when it's open
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel
Quoted 11 lines · Nitin A Kamble
Quoted 4 lines · Avi Kivity
Why do you think it is better? I would have thought that vm86 is much faster.
I am seeing execution going to strange places in vm86 mode. That issue is not coming in the emulation.
That means there's a bug somewhere. We need to fix it.
Quoted 12 lines
Quoted 8 lines
That will also handle the few cases where VT can't handle protected mode.
It should exit to userspace, same as the non-emulating case. However it
shouldn't happen for normal writes.Only thing is if it in the real mode, then returning back to user mode will setup the cpu state as real mode, and because of that vmenter will fail.
It will fail, and we'll see it and go back to emulation.
Signature · 8 lines
Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/