From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azn9g-0007WF-IS for qemu-devel@nongnu.org; Mon, 09 May 2016 11:31:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azn9b-000760-6a for qemu-devel@nongnu.org; Mon, 09 May 2016 11:31:31 -0400 Received: from mail-vk0-x235.google.com ([2607:f8b0:400c:c05::235]:33554) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azn9b-00075v-2j for qemu-devel@nongnu.org; Mon, 09 May 2016 11:31:27 -0400 Received: by mail-vk0-x235.google.com with SMTP id o133so70299327vka.0 for ; Mon, 09 May 2016 08:31:26 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20160509132449.GF3372@stefanha-x1.localdomain> References: <1461600281-23048-1-git-send-email-rjones@redhat.com> <20160509132449.GF3372@stefanha-x1.localdomain> Date: Mon, 9 May 2016 16:31:26 +0100 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v6] Add optionrom compatible with fw_cfg DMA version List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Richard W.M. Jones" Cc: qemu-devel , =?UTF-8?Q?Marc_Mar=C3=AD?= , Eduardo Habkost , "Michael S. Tsirkin" , Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , Laszlo Ersek , Richard Henderson On Mon, May 9, 2016 at 2:24 PM, Stefan Hajnoczi wrote: > On Mon, Apr 25, 2016 at 05:04:40PM +0100, Richard W.M. Jones wrote: >> v5 -> v6: >> >> - Changed the xen_load_linux assertion as suggested by Stefan. >> >> - I renamed the variables in get_e801_addr function, since the >> registers were really (16 bit 8086-style) AX, not EAX etc. Also I >> changed the GCC asm to make it a little bit more efficient. I >> verified by disassembling the function that GCC is still generating >> the right code after this change. >> >> - Re-tested with small (342K) libguestfs initramfs and with large >> (20M) Fedora initramfs, and works fine in both cases. > > No one has picked this up, so I have (for QEMU 2.7). > > Thanks, applied to my block tree: > https://github.com/stefanha/qemu/commits/block The bad news is this patch breaks the build under clang: CC optionrom/linuxboot_dma.o :29:1: error: unexpected directive .code16gcc .code16gcc ^ :29:11: error: .code16gcc not supported yet .code16gcc ^ linuxboot_dma.c:104:9: error: unexpected token in argument list asm("addr32 movw %%es:(%1), %0" : "=r"(val) : "r"((uint32_t)offset)); ^ :1:17: note: instantiated into assembly here addr32 movw %es:(%eax), %cx ^ linuxboot_dma.c:120:9: error: invalid instruction mnemonic 'addr32' asm("addr32 movl %0, %%es:(%1)" : : "r"(val), "r"((uint32_t)offset)); ^ :1:2: note: instantiated into assembly here addr32 movl %eax, %es:(%edx) ^~~~~~ linuxboot_dma.c:112:9: error: unexpected token in argument list asm("addr32 movl %%es:(%1), %0" : "=r"(val) : "r"((uint32_t)offset)); ^ :1:17: note: instantiated into assembly here addr32 movl %es:(%eax), %eax ^ The .code16gcc issue can probably be resolved with -m16 (which gcc 4.9+ also supports!). I haven't looked into the other issues though. Dropped from my block tree. Stefan