Hi Gleb and Paolo,
What about organizing vmx_run() as follows:
static int vmx_run()
{
u32 eax;
bool ret;
vmcs_write(HOST_RSP, get_rsp());
ret = vmlaunch();
while (!ret) {
asm volatile(
vmx_return:\n\t
SAVE_GPR
);
eax =
Il 24/07/2013 08:11, Arthur Chunqi Li ha scritto:
static int vmx_run()
{
u32 eax;
bool ret;
vmcs_write(HOST_RSP, get_rsp());
ret = vmlaunch();
The compiler can still change rsp between here...
while (!ret) {
asm volatile(
vmx_return:\n\t
...
On Wed, Jul 24, 2013 at 2:40 PM, Paolo Bonzini pbonz...@redhat.com wrote:
Il 24/07/2013 08:11, Arthur Chunqi Li ha scritto:
static int vmx_run()
{
u32 eax;
bool ret;
vmcs_write(HOST_RSP, get_rsp());
ret = vmlaunch();
The compiler can still change rsp between here...
Il 24/07/2013 08:46, Arthur Chunqi Li ha scritto:
On Wed, Jul 24, 2013 at 2:40 PM, Paolo Bonzini pbonz...@redhat.com wrote:
Il 24/07/2013 08:11, Arthur Chunqi Li ha scritto:
static int vmx_run()
{
u32 eax;
bool ret;
vmcs_write(HOST_RSP, get_rsp());
ret = vmlaunch();
The
So as what Gleb said, what about the following codes:
static int vmx_run2()
{
u32 eax;
bool ret;
asm volatile(
mov %%rsp, %%rsi\n\t
mov %2, %%edi\n\t
call vmcs_write\n\t
vmlaunch\n\t
setbe %0\n\t
jne 4f\n\t
vmx_return:\n\t
On 2013-07-24 10:48, Arthur Chunqi Li wrote:
So as what Gleb said, what about the following codes:
static int vmx_run2()
{
u32 eax;
bool ret;
asm volatile(
mov %%rsp, %%rsi\n\t
mov %2, %%edi\n\t
call vmcs_write\n\t
vmlaunch\n\t
Just like
Il 24/07/2013 10:48, Arthur Chunqi Li ha scritto:
So as what Gleb said, what about the following codes:
static int vmx_run2()
{
u32 eax;
bool ret;
asm volatile(
mov %%rsp, %%rsi\n\t
mov %2, %%edi\n\t
call vmcs_write\n\t
vmlaunch\n\t
So what about this one. I merged all the exit reason to ret and
remove the flag detection after vmlaunch/vmresume (because I think
this detection is useless). Currently we support only one guest, so
variant launched is located in vmx_run(). If we want to support
multiple guest, we could move it to
On 2013-07-24 11:56, Arthur Chunqi Li wrote:
So what about this one. I merged all the exit reason to ret and
remove the flag detection after vmlaunch/vmresume (because I think
this detection is useless). Currently we support only one guest, so
variant launched is located in vmx_run(). If we
On Wed, Jul 24, 2013 at 6:03 PM, Jan Kiszka jan.kis...@web.de wrote:
On 2013-07-24 11:56, Arthur Chunqi Li wrote:
So what about this one. I merged all the exit reason to ret and
remove the flag detection after vmlaunch/vmresume (because I think
this detection is useless). Currently we support
On 2013-07-24 12:16, Arthur Chunqi Li wrote:
On Wed, Jul 24, 2013 at 6:03 PM, Jan Kiszka jan.kis...@web.de wrote:
On 2013-07-24 11:56, Arthur Chunqi Li wrote:
So what about this one. I merged all the exit reason to ret and
remove the flag detection after vmlaunch/vmresume (because I think
And what about this version:
static int vmx_run()
{
u32 ret = 0;
asm volatile(
mov %%rsp, %%rsi\n\t
mov %2, %%edi\n\t
call vmcs_write\n\t
0:
LOAD_GPR_C
cmpl $0, %1\n\t
jne 1f\n\t
vmlaunch;seta %1\n\t
/* vmlaunch
On 2013-07-24 13:20, Arthur Chunqi Li wrote:
And what about this version:
static int vmx_run()
{
u32 ret = 0;
asm volatile(
mov %%rsp, %%rsi\n\t
mov %2, %%edi\n\t
call vmcs_write\n\t
0:
LOAD_GPR_C
cmpl $0, %1\n\t
Il 18/07/2013 21:57, Gleb Natapov ha scritto:
On Thu, Jul 18, 2013 at 02:08:51PM +0200, Paolo Bonzini wrote:
Il 18/07/2013 13:06, Gleb Natapov ha scritto:
On Thu, Jul 18, 2013 at 12:47:46PM +0200, Paolo Bonzini wrote:
and for a testsuite I'd prefer the latter---which means I'd still favor
On Fri, Jul 19, 2013 at 08:42:20AM +0200, Paolo Bonzini wrote:
Il 18/07/2013 21:57, Gleb Natapov ha scritto:
On Thu, Jul 18, 2013 at 02:08:51PM +0200, Paolo Bonzini wrote:
Il 18/07/2013 13:06, Gleb Natapov ha scritto:
On Thu, Jul 18, 2013 at 12:47:46PM +0200, Paolo Bonzini wrote:
and for
Il 19/07/2013 11:40, Gleb Natapov ha scritto:
Because this is written in C, and I know trying to fool the compiler is
a losing game. So my reaction is okay, HOST_RIP must be set so that
code will not jump around. If I see
asm(vmlaunch)
exit(-1)
the reaction is the opposite: hmm,
On Thu, Jul 18, 2013 at 07:52:21AM +0200, Paolo Bonzini wrote:
Il 17/07/2013 20:54, Arthur Chunqi Li ha scritto:
+ .globl entry_sysenter\n\t
+ entry_sysenter:\n\t
+ SAVE_GPR
+ and $0xf, %rax\n\t
+ push%rax\n\t
push should be wrong here, the first
Il 18/07/2013 09:26, Gleb Natapov ha scritto:
I had written a long explanation here about why I don't trust the
compiler to do the right thing, and ideas about how to fix that. But in
the end the only workable solution is a single assembly blob like vmx.c
in KVM to do vmlaunch/vmresume,
On Thu, Jul 18, 2013 at 12:47:46PM +0200, Paolo Bonzini wrote:
and for a testsuite I'd prefer the latter---which means I'd still favor
setjmp/longjmp.
Now, here is the long explanation.
I must admit that the code looks nice. There are some nits I'd like to
see done
Il 18/07/2013 13:06, Gleb Natapov ha scritto:
On Thu, Jul 18, 2013 at 12:47:46PM +0200, Paolo Bonzini wrote:
and for a testsuite I'd prefer the latter---which means I'd still favor
setjmp/longjmp.
Now, here is the long explanation.
I must admit that the code looks nice. There are some nits
On Thu, Jul 18, 2013 at 8:08 PM, Paolo Bonzini pbonz...@redhat.com wrote:
Il 18/07/2013 13:06, Gleb Natapov ha scritto:
On Thu, Jul 18, 2013 at 12:47:46PM +0200, Paolo Bonzini wrote:
and for a testsuite I'd prefer the latter---which means I'd still favor
setjmp/longjmp.
Now, here is the long
On Thu, Jul 18, 2013 at 02:08:51PM +0200, Paolo Bonzini wrote:
Il 18/07/2013 13:06, Gleb Natapov ha scritto:
On Thu, Jul 18, 2013 at 12:47:46PM +0200, Paolo Bonzini wrote:
and for a testsuite I'd prefer the latter---which means I'd still favor
setjmp/longjmp.
Now, here is the long
This is the first version of VMX nested environment. It contains the
basic VMX instructions test cases, including VMXON/VMXOFF/VMXPTRLD/
VMXPTRST/VMCLEAR/VMLAUNCH/VMRESUME/VMCALL. This patchalso tests the
basic execution routine in VMX nested environment andlet the VM print
Hello World to inform
Il 17/07/2013 20:54, Arthur Chunqi Li ha scritto:
+/* entry_sysenter */
+asm(
+ .align 4, 0x90\n\t
+ .globl entry_sysenter\n\t
+ entry_sysenter:\n\t
+ SAVE_GPR
+and $0xf, %rax\n\t
+push%rax\n\t
push should be wrong here, the first argument
24 matches
Mail list logo