Skip to contentSkip to conversation

vmcall time

DISCUSSION Omar Khan 3 participants 5 messages Mar 10, 2007 – Mar 11, 2007 3 messages not in the archive KVM

lore
Share & tools
lore

Omar Khan

author
#0 lore raw

hi,

What is an easy way to approximately measure the time it takes to make a
vmcall? If I make let us say 100,000 vmcalls from the guest os and print jiffies in kvm for the first and last call would that do the job?

Thanks

Omar

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

#2 lore raw
In reply to a message not in the archive
Quoted 6 lines · Omar Khan

hi,

What is an easy way to approximately measure the time it takes to make a
vmcall? If I make let us say 100,000 vmcalls from the guest os and print jiffies in kvm for the first and last call would that do the job?

There is currently a test in virtbench that will measure PIO time. That is going to be a fair bit higher than vmcall but definitely within the right ballpark.

I've got a patch that should appear in virtbench soon that actually measures vmcall latency.

http://ozlabs.org/~rusty/virtbench

Regards,

Anthony Liguori

Quoted 5 lines

Thanks

Omar

Quoted 11 lines

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

author
#3 lore raw
Quoted 6 lines · Anthony Liguori

I've got a patch that should appear in virtbench soon that actually measures vmcall latency.

http://ozlabs.org/~rusty/virtbench

Thanks Anthony. I have a newbie question though. In the vmcall function in the patch:

+static int vmcall(unsigned int cmd)
+{
+ signal(SIGILL, illegal_instruction);
+ asm volatile(".byte 0x0F,0x01,0xC1,0xC3\n" ::"a"(cmd));
+ signal(SIGILL, SIG_DFL);
+
+ return 0;
+}

Why do you have the ret opcode '0xC3' with the vmcall?

Thanks

Omar

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

#5 lore raw
In reply to a message not in the archive
Quoted 22 lines · Omar Khan
Quoted 6 lines · Anthony Liguori

I've got a patch that should appear in virtbench soon that actually measures vmcall latency.

http://ozlabs.org/~rusty/virtbench

Thanks Anthony. I have a newbie question though. In the vmcall function in the patch:

(quoted diff) +8 -0
+static int vmcall(unsigned int cmd)
+{
+	signal(SIGILL, illegal_instruction);
+	asm volatile(".byte 0x0F,0x01,0xC1,0xC3\n" ::"a"(cmd));
+	signal(SIGILL, SIG_DFL);
+
+	return 0;
+}
Quoted 2 lines

Why do you have the ret opcode '0xC3' with the vmcall?

Because I lazily copied from KVM instead of looking them up. I figured 0xC3 was a NOP. Will fix.

Quoted 5 lines

Thanks

Omar

Quoted 11 lines

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

#7 lore raw
In reply to a message not in the archive
Quoted 5 lines
Quoted 3 lines · Omar Khan

Anthony Liguori <anthony@...> writes:

Quoted 8 lines
Quoted 8 lines
Quoted 6 lines

I've got a patch that should appear in virtbench soon that actually measures vmcall latency.

http://ozlabs.org/~rusty/virtbench

Thanks Anthony. I have a newbie question though. In the vmcall

function

Quoted 12 lines

in the

Quoted 11 lines

patch:

(quoted diff) +8 -0
+static int vmcall(unsigned int cmd)
+{
+	signal(SIGILL, illegal_instruction);
+	asm volatile(".byte 0x0F,0x01,0xC1,0xC3\n" ::"a"(cmd));
+	signal(SIGILL, SIG_DFL);
+
+	return 0;
+}
Quoted 5 lines
Quoted 2 lines

Why do you have the ret opcode '0xC3' with the vmcall?

Because I lazily copied from KVM instead of looking them up. I figured 0xC3 was a NOP. Will fix.

0xC3 is return from the hypercall.
Btw 0x90 is nop.

Quoted 1 line

From looking in the code I saw that you fork a process and wait for him

to finish. Isn't that increases the time counted for the vmmcall? Maybe somewhere the process overhead is measured and afterwards this time is decreased?

Quoted 7 lines
Quoted 7 lines

Thanks

Omar

------------------------------------------------------------------------
-

Quoted 2 lines
Quoted 2 lines

Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to

share

Quoted 3 lines

your

Quoted 2 lines

opinions on IT & business topics through brief surveys-and earn cash

http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
V

Quoted 9 lines
Quoted 6 lines

_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-----------------------------------------------------------------------

--

Quoted 5 lines

Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVD

EV

Quoted 4 lines

_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV