From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eIAvz-00054J-5i for qemu-devel@nongnu.org; Fri, 24 Nov 2017 05:10:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eIAvv-0002qK-Dx for qemu-devel@nongnu.org; Fri, 24 Nov 2017 05:10:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36944) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eIAvv-0002pV-6h for qemu-devel@nongnu.org; Fri, 24 Nov 2017 05:10:07 -0500 References: <20171122084157.11480-1-quintela@redhat.com> <4e926520-1b21-5aad-6a5c-3a8d11a8ea80@linaro.org> From: Paolo Bonzini Message-ID: Date: Fri, 24 Nov 2017 11:09:58 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] tcg: Fix complilation with TCG List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Richard Henderson , Laurent Vivier , Peter Xu , QEMU Developers , "Dr. David Alan Gilbert" , Juan Quintela On 24/11/2017 11:07, Peter Maydell wrote: > On 23 November 2017 at 22:08, Paolo Bonzini wrote: >> On 22/11/2017 13:14, Peter Maydell wrote: >>>> We do this all of the time for more regular tests that are obviously >>>> compile-time. I am a really big fan of this, because it makes sure that the >>>> (usually 32-bit) else branch continues to compile. >>> I'm happy with code that is "we assume the compiler is going to >>> be sensible here so we don't have to use #ifdefs in the name >>> of performance". I just don't think we should write code that >>> can't compile at all if the compiler happens to not identify >>> the codepath as dead. There's no guarantee by the compiler >>> that it's going to do that. >> There's plenty of cases where "if (kvm_enabled())" code would fail to >> link if the compiler didn't do that optimization. > > I think that's a step less weird than "assert(kvm_enabled())", > but I tend to think of that kind of thing as "if the compiler > ever did decide not to link it we'd add missing stub functions". I'll take a look at moving all the notdirty_* stuff under #ifdef CONFIG_TCG then, for now we can proceed with Juan's patch. Thanks, Paolo