From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH kvm-unit-tests 1/2] VMX: checks for validity of vmxon region Date: Thu, 05 Jun 2014 12:35:41 +0200 Message-ID: <539047FD.9070002@redhat.com> References: <1401916675-1568-1-git-send-email-bsd@redhat.com> <1401916675-1568-2-git-send-email-bsd@redhat.com> <53901573.4020004@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit To: Jan Kiszka , Bandan Das , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:49685 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751539AbaFEKfq (ORCPT ); Thu, 5 Jun 2014 06:35:46 -0400 In-Reply-To: <53901573.4020004@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: Il 05/06/2014 09:00, Jan Kiszka ha scritto: >> > + rflags = read_rflags() | X86_EFLAGS_CF | X86_EFLAGS_ZF; >> > + write_rflags(rflags); >> > + ret1 = vmx_on(); > Can we ensure that the compiler doesn't inject any ops between > write_rflags and the vmxon that overwrite CF or ZF? No, in fact if vmx_on were not inlined, building the stack frame with "sub" would overwrite the flags. Paolo > If you want those > flags in a specific state, maybe it's better to pass that to vmx_on and > do this in the assembly block with vmxon. >