From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43352) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eDCl6-0002K7-Ci for qemu-devel@nongnu.org; Fri, 10 Nov 2017 12:06:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eDCl1-0000oj-6U for qemu-devel@nongnu.org; Fri, 10 Nov 2017 12:06:24 -0500 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:36303) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eDCl0-0000mx-Uk for qemu-devel@nongnu.org; Fri, 10 Nov 2017 12:06:19 -0500 Received: by mail-wm0-x243.google.com with SMTP id r68so4060108wmr.1 for ; Fri, 10 Nov 2017 09:06:18 -0800 (PST) References: <9b2efc90-3b0e-b13b-27bb-117473c8b41b@advancedtelematic.com> <2fd2077a-9823-41e0-0deb-4142b20259d5@advancedtelematic.com> From: Anton Gerasimov Message-ID: <1cc32460-6067-0c1c-0182-eb17933293d9@advancedtelematic.com> Date: Fri, 10 Nov 2017 18:04:52 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US Subject: Re: [Qemu-devel] [U-Boot] Support of latest qemux86-64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bin Meng , Igor Mammedov Cc: U-Boot Mailing List , qemu-devel@nongnu.org New guess: in the most safe configuration of u-boot (CONFIG_SMP=3Dn, lacpi disabled)= with Igor's patch applied `qemu-system-i386 -bios /path/to/uboot.rom` fails on the first 'ret' instruction. GDB shows that memory at $esp (0xdfffc at the entrance to board_init_f_mem) and everything around it is zero despite 'call' and 'push' instructions executed. If you go one commit before the breaking one it works fine, stuff gets put onto stack. Could it that be that stack itself is in this 'readonly' area? Thanks, Anton Gerasimov On 11/09/2017 02:58 AM, Bin Meng wrote: > On Wed, Nov 8, 2017 at 9:05 PM, Anton Gerasimov > wrote: >> Adding Igor Mammedov to the loop. >> > Really add Igor Mammedov. > > Igor, can you help look at this? > >> On 11/08/2017 01:59 PM, Anton Gerasimov wrote: >>> To whoever might be interested: I've bisected qemu and the breaking >>> commit is 208fa0e43645edd0b0d8f838857dfc79daff40a8 (pc: make 'pc.rom'= >>> readonly when machine has PCI enabled). It's just three lines added, >>> I'll paste the whole patch here. Not quite sure what can we do here t= hough. >>> >>> >>> diff --git a/hw/i386/pc.c b/hw/i386/pc.c >>> index 22e16031b0..59435390ba 100644 >>> --- a/hw/i386/pc.c >>> +++ b/hw/i386/pc.c >>> @@ -1443,6 +1443,9 @@ void pc_memory_init(PCMachineState *pcms, >>> option_rom_mr =3D g_malloc(sizeof(*option_rom_mr)); >>> memory_region_init_ram(option_rom_mr, NULL, "pc.rom", PC_ROM_S= IZE, >>> &error_fatal); >>> + if (pcmc->pci_enabled) { >>> + memory_region_set_readonly(option_rom_mr, true); >>> + } >>> memory_region_add_subregion_overlap(rom_memory, >>> PC_ROM_MIN_VGA, >>> option_rom_mr, >>> >>> > Regards, > Bin --=20 Anton Gerasimov, ATS Advanced Telematic Systems GmbH Kantstrasse 162, 10623 Berlin Managing Directors: Dirk P=C3=B6schl, Armin G. Schmidt Register Court: HRB 151501 B, Amtsgericht Charlottenburg