From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [Qemu-devel] [PATCH uq/master v2 1/2] kvm: reset state from the CPU's reset method Date: Mon, 8 Apr 2013 20:07:03 +0300 Message-ID: <20130408170703.GC15035@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> <5162D5FF.8040800@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Paolo Bonzini , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org, Alexander Graf To: Andreas =?utf-8?Q?F=C3=A4rber?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:7836 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933751Ab3DHRHu convert rfc822-to-8bit (ORCPT ); Mon, 8 Apr 2013 13:07:50 -0400 Content-Disposition: inline In-Reply-To: <5162D5FF.8040800@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Apr 08, 2013 at 04:36:47PM +0200, Andreas F=C3=A4rber wrote: > Am 08.04.2013 14:19, schrieb Gleb Natapov: > > On Tue, Apr 02, 2013 at 04:29:32PM +0300, Gleb Natapov wrote: > >>> static void kvm_sw_tlb_put(PowerPCCPU *cpu) > >>> { > >>> CPUPPCState *env =3D &cpu->env; > >>> diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c > >>> index 23fe51f..6321384 100644 > >>> --- a/target-s390x/cpu.c > >>> +++ b/target-s390x/cpu.c > >>> @@ -84,6 +84,10 @@ static void s390_cpu_reset(CPUState *s) > >>> * after incrementing the cpu counter */ > >>> #if !defined(CONFIG_USER_ONLY) > >>> s->halted =3D 1; > >>> + > >>> + if (kvm_enabled()) { > >>> + kvm_arch_reset_vcpu(s); > >> Does this compile with kvm support disabled? > >> > > Well, it does not: > > CC s390x-softmmu/target-s390x/cpu.o > > /users/gleb/work/qemu/target-s390x/cpu.c: In function 's390_cpu_res= et': > > /users/gleb/work/qemu/target-s390x/cpu.c:89:9: error: implicit > > declaration of function 'kvm_arch_reset_vcpu' > > [-Werror=3Dimplicit-function-declaration] > > /users/gleb/work/qemu/target-s390x/cpu.c:89:9: error: nested extern > > declaration of 'kvm_arch_reset_vcpu' [-Werror=3Dnested-externs] > > cc1: all warnings being treated as errors > >=20 > > I wonder if it is portable between compilers to rely on code in if(= 0){} to > > be dropped in all levels of optimizations. >=20 > No, we had a previous case where --enable-debug broke if (kvm_enabled= ()) > {...} but regular builds worked. >=20 Can you recall what compiler was it with? 4.7.2 works with -O0. -- Gleb.