flat assembler
Message board for the users of flat assembler.

Index > Main > Request for Intel VMX (virtualization) Instructions

Author
Thread Post new topic Reply to topic
HyperVista



Joined: 18 Apr 2005
Posts: 691
Location: Virginia, USA
HyperVista
Tomasz - I know you've already included suport for AMD's SVM. Is it possible to include in future release of fasm the ten (10) Intel VMX Instructions? The ten instructions and their opcodes can be found in Intels Programmer's Manual 2B (Instructions N-Z, pages 384 - 413). The instructions are:

VMPTRLD
VMPTRST
VMCLEAR
VMREAD
VMWRITE
VMCALL
VMLAUNCH
VMRESUME
VMXOFF
VMXON

I'm making progress on my fasm based hypervisor and having these Intel VMX instructions included in fasm would be a great thing! Thank you for your consideration.
Post 21 Feb 2007, 03:42
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
HyperVista: don't you use some old version of FASM? These insruction ARE supported by FASM
Post 21 Feb 2007, 08:13
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
HyperVista



Joined: 18 Apr 2005
Posts: 691
Location: Virginia, USA
HyperVista
i've been using fasmw 1.67.12 (Oct 06). i get "invalid operand" on the VMX instructions i'm testing during compile. before writing my note last night, i checked the "what's new" file on the latest version and couldn't find reference to VMX instructions being included in any fasm version. i did see a reference to AMD SVM being added last year, but no mention of Intel VMX, and given my compile errors, assumed they weren't yet included.
i loaded up the newest version and had the same "invalid operand" error message .... hmmmm.
then i tried some of the other VMX instructions and they compile .... yeah .... Intel VMX is in fact included in fasm.... thank you very much Tomasz!!

it seems the VMX instructions i'm having difficulty with are those that require a 64-bit memory operand. Per the Intel Developer's Manual, the instructions should follow the format:

VMXON m64
VMCLEAR m64
VMPTRLD m64
etc.

the operands for these instructions are always 64-bit and always in memory. these 64-bit memory addresses are pointers to the VMCS region. these 64-bit pointers need to be 4Kb alligned (bits 11:0 must be zero).
my question is, how should i be providing this m64 operand in fasm? i've tried providing a 64-bit immediate hex adress but still get the "invalid operand" error message.

what's the recommended method in fasm to provide a 64-bit memory address as an operand?

thanks!

my question then is, how do i properly provide a 64-bit memory operand for these instructions.
Post 21 Feb 2007, 17:42
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7714
Location: Kraków, Poland
Tomasz Grysztar
The simplest examples:
Code:
vmxon [0]
vmxon [ebx]    

As for the WHATSNEW.TXT, it mentions the addition of VMX in version 1.62 (and it also notes that the syntax for those instructions is not yet documented, it's perhaps a high time for me to add those sections to manual).
Post 21 Feb 2007, 18:22
View user's profile Send private message Visit poster's website Reply with quote
HyperVista



Joined: 18 Apr 2005
Posts: 691
Location: Virginia, USA
HyperVista
Thank you very much Tomasz. That worked.

Yes, I found the inclusion of VMX way back in version 1.62 (Spring 2005!!!). Tomasz, you are truly a man ahead of your time.

It's very gracious of you to take your busy time to help me and I appreciate it very much.
Post 21 Feb 2007, 18:34
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
tomasz: maybe you could also check if operands are properly aligned...
Post 22 Feb 2007, 09:08
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
If aligment for those instructions is checked, then "movaps xmm0, [anyAddr or 1]" should throw error too. I'm not sure if that is a good feature, maybe for some reason I'm interested in generate a unaligment fault.
Post 22 Feb 2007, 13:53
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
I can't see why the assembler should check for alignment on these instructions - especially since it can't do it anyway as soon as there's a dynamic part in the instruction (ie., register usage), which is probably the form people will be using most of the time anyway.
Post 22 Feb 2007, 14:00
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
yes, you are right
Post 22 Feb 2007, 14:53
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.