AMD VMMCALL and VM86 mode
Hello,
While working on XSA-192, I found a curious thing. On AMD hardware, the VMMCALL instruction appears to behave like a nop if executed in VM86 mode. All other processor modes work fine.
The documentation suggests it should be valid in any situation, but I never get a #VMEXIT from it. Thus, I would have thought it would fall into the un-intercepted category and raise a #UD fault, but I don't get that either.
Is this behaviour expected? The documentation would certainly seem to indicate not.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 8 lines · Andrew Cooper
Hello,
While working on XSA-192, I found a curious thing. On AMD hardware, the VMMCALL instruction appears to behave like a nop if executed in VM86 mode. All other processor modes work fine.
The documentation suggests it should be valid in any situation, but I never get a #VMEXIT from it.
And I assume GENERAL2_INTERCEPT_VMMCALL is set (which is what we have in Xen by default)?
What happens if you don't set it?
-boris
Quoted 6 lines
Thus, I would have thought it would fall
into the un-intercepted category and raise a #UD fault, but I don't get that either.Is this behaviour expected? The documentation would certainly seem to indicate not.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 11 lines · Boris Ostrovsky
Quoted 8 lines · Andrew Cooper
Hello,
While working on XSA-192, I found a curious thing. On AMD hardware, the VMMCALL instruction appears to behave like a nop if executed in VM86 mode. All other processor modes work fine.
The documentation suggests it should be valid in any situation, but I never get a #VMEXIT from it.
And I assume
GENERAL2_INTERCEPT_VMMCALLis set (which is what we have in Xen by default)?
Yes, because I have already used hypercalls to get text to the console before entering vm86 mode.
Quoted 1 line
What happens if you don't set it?
Let me do some hacking and see.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 10 lines · Andrew Cooper
Quoted 9 lines · Boris Ostrovsky
Quoted 8 lines · Andrew Cooper
Hello,
While working on XSA-192, I found a curious thing. On AMD hardware, the VMMCALL instruction appears to behave like a nop if executed in VM86 mode. All other processor modes work fine.
The documentation suggests it should be valid in any situation, but I never get a #VMEXIT from it.
Quoted 7 lines
Quoted 2 lines
And I assume
GENERAL2_INTERCEPT_VMMCALLis set (which is what we have in Xen by default)?Yes, because I have already used hypercalls to get text to the console before entering vm86 mode.
Quoted 1 line
What happens if you don't set it?
Let me do some hacking and see.
Outside of vm86 mode, VMMCALL raises #UD, which is expected as it wasn't intercepted.
From within vm86 mode, I now get #GP rather than #UD.
There is certainly an argument to be made that VMMCALL inside vm86 mode should trap to the vm86 monitor and #GP would be the expected way of that happening, but this also doesn't match the documentation.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel