From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v3] kvm-unit-tests : Basic architecture of VMX nested test case Date: Tue, 30 Jul 2013 16:59:44 +0200 Message-ID: <51F7D4E0.8000903@redhat.com> References: <1375020009-6225-1-git-send-email-yzt356@gmail.com> <51F7D381.107@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: kvm , Jan Kiszka , Gleb Natapov To: Arthur Chunqi Li Return-path: Received: from mx1.redhat.com ([209.132.183.28]:18316 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754900Ab3G3PA2 (ORCPT ); Tue, 30 Jul 2013 11:00:28 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Il 30/07/2013 16:57, Arthur Chunqi Li ha scritto: > On Tue, Jul 30, 2013 at 10:53 PM, Paolo Bonzini wrote: >> Il 28/07/2013 16:00, Arthur Chunqi Li ha scritto: >>> + >>> + while (1) { >>> + asm volatile ( >>> + "mov %%rsp, %%rsi\n\t" >>> + "mov %2, %%rdi\n\t" >>> + "vmwrite %%rsi, %%rdi\n\t" >>> + >>> + LOAD_GPR_C >>> + "cmpl $0, %1\n\t" >>> + "jne 1f\n\t" >>> + LOAD_RFLAGS >>> + "vmlaunch\n\t" >>> + "jmp 2f\n\t" >>> + "1: " >>> + "vmresume\n\t" >>> + "2: " >>> + "setbe %0\n\t" >> >> Perhaps here add >> >> jbe vmx_return >> ud2 >> >> but it can be added in a follow-up. >> >>> + "vmx_return:\n\t" >>> + SAVE_GPR_C >>> + SAVE_RFLAGS >>> + : "=m"(fail) >>> + : "m"(launched), "i"(HOST_RSP) >>> + : "rdi", "rsi", "memory", "cc" >>> + >>> + ); >> >> Nice! :) >> >> I pushed the patch. > Hi Paolo, > Slow down pushing it. There's something wrong with host_rflags > handling. I will commit another version as well as your suggestion, > you could push that version. Well, too late... anyway I prefer follow-up patches because they make the differences clearer. With a single 1200-line patch it is a bit complicated to follow. Paolo