From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjZgY-0005nk-C9 for qemu-devel@nongnu.org; Wed, 20 Jul 2011 12:31:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjZgT-00011v-9I for qemu-devel@nongnu.org; Wed, 20 Jul 2011 12:31:46 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:46740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjZgS-00011Y-TQ for qemu-devel@nongnu.org; Wed, 20 Jul 2011 12:31:41 -0400 Message-ID: <4E2702E7.4090006@mail.berlios.de> Date: Wed, 20 Jul 2011 18:31:35 +0200 From: Stefan Weil MIME-Version: 1.0 References: <1311153246-24803-1-git-send-email-avi@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] xen: fix xen-mapcache build on non-Xen capable targets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini Cc: "qemu-devel@nongnu.org" , Jan Kiszka , Avi Kivity , Alexander Graf Am 20.07.2011 13:01, schrieb Stefano Stabellini: > On Wed, 20 Jul 2011, Avi Kivity wrote: >> Signed-off-by: Avi Kivity > > Alex sent another patch few days ago to do the same thing: > > http://marc.info/?l=qemu-devel&m=131099500331906&w=2 > > it hasn't been merged yet but it is in Alex's xen-next branch. So there are now at least 3 solutions (because I also had prepared a patch which is still unpublished). The last time I had sent a patch for the same problem with conditionalcompilation (so no stubs were needed): http://patchwork.ozlabs.org/patch/96204/. Jan then proposed using static inline stub functions. IMHO, static inline stub functions (Avi's patch) are better than stub functions (Alex' patch) because they avoid dead code for the stub functions. As far as I know most linkers don't remove dead code. In Avi's patch, there remain some questions: * CONFIG_XEN needs config.h. Is it also included (indirectly) in xen-all.c? I don't know that up to now, that's the reason why I did not publish my patch. * I only needed three inline stub functions: static inline uint8_t *xen_map_cache(target_phys_addr_t phys_addr, target_phys_addr_t size, uint8_t lock) { return NULL; } static inline ram_addr_t xen_ram_addr_from_mapcache(void *ptr) { return 0; } static void xen_invalidate_map_cache_entry(uint8_t *buffer) { } * Do we need abort() and the related include statement? Maybe assert(!"unexpected function call") would be a better replacement for abort(), or simply do nothing. No matter which solution is applied, I'd appreciate that it is applied soon because the current builds are broken for compilations without optimization. Cheers, Stefan Weil