From patchwork Fri Jun 25 08:01:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 56988 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5232DB6F04 for ; Sat, 26 Jun 2010 07:16:40 +1000 (EST) Received: from localhost ([127.0.0.1]:53261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OSGAt-0002YB-Od for incoming@patchwork.ozlabs.org; Fri, 25 Jun 2010 17:10:59 -0400 Received: from [140.186.70.92] (port=44299 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OSD6x-0002Hf-6X for qemu-devel@nongnu.org; Fri, 25 Jun 2010 13:54:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OS3qg-0007cX-GC for qemu-devel@nongnu.org; Fri, 25 Jun 2010 04:01:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7541) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OS3qg-0007cB-9T for qemu-devel@nongnu.org; Fri, 25 Jun 2010 04:01:18 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5P81DhO026355 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 25 Jun 2010 04:01:14 -0400 Received: from yakj.usersys.redhat.com (dhcp-30-119.brq.redhat.com [10.34.30.119]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5P81Bwv014906; Fri, 25 Jun 2010 04:01:12 -0400 Message-ID: <4C246246.8030903@redhat.com> Date: Fri, 25 Jun 2010 10:01:10 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100621 Fedora/3.0.5-1.fc13 Lightning/1.0b2pre Thunderbird/3.0.5 MIME-Version: 1.0 To: Isaku Yamahata References: <20100625030240.GJ4498@valinux.co.jp> In-Reply-To: <20100625030240.GJ4498@valinux.co.jp> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: amit.shah@redhat.com, blauwirbel@gmail.com, qemu-devel@nongnu.org, rth@twiddle.net Subject: [Qemu-devel] Re: [PATCH v2] Makefile: poison TARGET_xxx for compile once. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org On 06/25/2010 05:02 AM, Isaku Yamahata wrote: > poison TARGET_xxx for compile once object > to prevent those ifdef from creeping in again. > > didn't poison env which is used as function argument as void *env. > Although it would be possible to sort it out, for now just not poison it. > > qemu-malloc.c didn't compile, so I make it non compile-once for now. > It is linked via block-obj-y in Makefile.obj and common-obj-y in > Makefile.objs through block-obj-y. So qemu-malloc.o is explicitly > added to rules. I'm still skeptical, not about the goal but about the means. I'm going to push again for my patch to make CPUState opaque for non-per-target files. I haven't heard good reasons against it. The main objection was that hw files would have no reason for accessing CPUState. But this makes no sense if CPUState is opaque, and on the other hand we have now a proliferation of void* arguments and fields (e.g. in qemu_cpu_kick). Which I am taught is a very bad thing. If that patch was accepted, we'd just need this to implement your proposal: /* bottom halves */ I'll put this together in a complete patch series and post. Paolo diff --git a/cpu-common.h b/cpu-common.h index f325e60..78f8b12 100644 --- a/cpu-common.h +++ b/cpu-common.h @@ -11,10 +11,6 @@ #include "targphys.h" #endif -#ifndef NEED_CPU_H -#include "poison.h" -#endif - #include "bswap.h" #include "qemu-queue.h" diff --git a/qemu-common.h b/qemu-common.h index 3fb2f0b..3f92d40 100644 --- a/qemu-common.h +++ b/qemu-common.h @@ -90,15 +90,12 @@ static inline char *realpath(const char *path, char *resolved_path) /* FIXME: Remove NEED_CPU_H. */ #ifndef NEED_CPU_H - #include #include "osdep.h" #include "bswap.h" - +#include "poison.h" #else - #include "cpu.h" - #endif /* !defined(NEED_CPU_H) */