public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* some question in function do_vmx_vcpu_run, if anyone knows , please tell me,thanks.
@ 2010-10-31  8:50 jemmy858585
  0 siblings, 0 replies; only message in thread
From: jemmy858585 @ 2010-10-31  8:50 UTC (permalink / raw)
  To: kvm

in the function do_vmx_vcpu_run ,  there are some code which i didn't understand.

question one:
		".Lkvm_vmx_return: "
		/* Save guest registers, load host registers, keep flags */
		"xchg %0,     (%%"R"sp) \n\t"
		"mov %%"R"ax, %c[rax](%0) \n\t"
		"mov %%"R"bx, %c[rbx](%0) \n\t"
		"push"Q" (%%"R"sp); pop"Q" %c[rcx](%0) \n\t"
		"mov %%"R"dx, %c[rdx](%0) \n\t"
		"mov %%"R"si, %c[rsi](%0) \n\t"
		"mov %%"R"di, %c[rdi](%0) \n\t"
		"mov %%"R"bp, %c[rbp](%0) \n\t"

why need 
"xchg %0,     (%%"R"sp) \n\t" 
and 
"push"Q" (%%"R"sp); pop"Q" %c[rcx](%0) \n\t"
I think rsp will restore when vm exits, why we change it?

question two:
before vm entry
		/* Store host registers */
		"push %%"R"dx; push %%"R"bp;"
		"push %%"R"cx \n\t"
and  after vm exit
		"pop  %%"R"bp; pop  %%"R"bp; pop  %%"R"dx \n\t"

why we need push rdx,rbp,rcx, and didn't pop rcx; and why we didn't save other register?


			
--------------
jemmy858585
2010-10-31


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-10-31  8:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-31  8:50 some question in function do_vmx_vcpu_run, if anyone knows , please tell me,thanks jemmy858585

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox