From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [Qemu-devel] [PATCH uq/master v2 1/2] kvm: reset state from the CPU's reset method Date: Mon, 08 Apr 2013 15:43:39 +0200 Message-ID: <5162C98B.1090501@redhat.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org, Alexander Graf To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:62000 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935972Ab3DHNo2 (ORCPT ); Mon, 8 Apr 2013 09:44:28 -0400 In-Reply-To: <20130408121950.GA9425@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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