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
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html