From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPCMR-0006dD-SH for qemu-devel@nongnu.org; Mon, 08 Apr 2013 09:44:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPCMM-0000Ao-87 for qemu-devel@nongnu.org; Mon, 08 Apr 2013 09:43:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38327) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPCMM-0000AZ-0o for qemu-devel@nongnu.org; Mon, 08 Apr 2013 09:43:46 -0400 Message-ID: <5162C98B.1090501@redhat.com> Date: Mon, 08 Apr 2013 15:43:39 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1363984637-18132-1-git-send-email-pbonzini@redhat.com> <1363984637-18132-2-git-send-email-pbonzini@redhat.com> <20130402132932.GF3889@redhat.com> <20130408121950.GA9425@redhat.com> In-Reply-To: <20130408121950.GA9425@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH uq/master v2 1/2] kvm: reset state from the CPU's reset method List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org, Alexander Graf Il 08/04/2013 14:19, Gleb Natapov ha scritto: >> > Does this compile with kvm support disabled? Oops, sorry, I thought I had replied to this email (with "hmm, let me check"). > Well, it does not: > CC s390x-softmmu/target-s390x/cpu.o > /users/gleb/work/qemu/target-s390x/cpu.c: In function 's390_cpu_reset': > /users/gleb/work/qemu/target-s390x/cpu.c:89:9: error: implicit > declaration of function 'kvm_arch_reset_vcpu' > [-Werror=implicit-function-declaration] > /users/gleb/work/qemu/target-s390x/cpu.c:89:9: error: nested extern > declaration of 'kvm_arch_reset_vcpu' [-Werror=nested-externs] > cc1: all warnings being treated as errors > > I wonder if it is portable between compilers to rely on code in if(0){} to > be dropped in all levels of optimizations. It generally is okay to assume it (I think early GCC 3.x releases had no -O0 dead-code optimization, but it was a long time ago). However: * in QEMU only some files have kvm_enabled() as 0 when KVM is disabled. Files that are shared among multiple targets have it defined to kvm_allowed. This is not the problem here. * you still need to define the prototypes for anything you call, of course. Paolo