[Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
The updated version of this patch has landed in xenial (but synced, so no automatic bug closure). ** Changed in: edk2 (Ubuntu) Status: Fix Committed => Fix Released ** Changed in: gcc-5 (Ubuntu) Status: New => Invalid -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
Great. Then I think the bug should be closed against GCC and the edk2 patch updated. Best regards. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
@Thomas: I can confirm that replacing -fno-expensive-optimizations with -mstrict-align does work. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
I built edk2 with and without the arm64-no-expensive-optimizations patch, dumping the trees in both case (with -fdump-tree-bswap with the patch and -fdump-tree-sincos without). Fortunately, the diff is quite small and I could review it all. Transformations all look sound and indeed there is a few transformations that wasn't done before the patch mentionned in the initial bug report. One thing that it does and could pose problem is transforming a serie of byte load into a single unaligned 32bit load. This is allowed for this target by default so nothing wrong here but maybe in this case unaligned load should not be done. If that is the case, -mstrict-align should be used when compiling all files. Dann, could you try compiling with this flag instead of -mno-expensive-optimizations and see if you still hit the bug? Unfortunately I don't have access to an aarch64 machine with KVM available. Best regards. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
** Changed in: edk2 (Ubuntu) Status: New => Fix Committed -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
Re: [Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
On Wed, Sep 2, 2015 at 5:57 PM, Steve Langasek wrote: > On Wed, Sep 02, 2015 at 04:44:35PM -, dann frazier wrote: > >> I tested that and can confirm it is sufficient (see attached patch). > > This adjusts the build flags for all platforms using gcc, for gcc 4.4 and > above, which is overbroad. > > Could you test adding this as a patch to the ARMGCC build flags instead? Yep, here you go. ** Patch added: "arm64-no-expensive-optimizations.patch" https://bugs.launchpad.net/bugs/1489560/+attachment/4456909/+files/arm64-no-expensive-optimizations.patch -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
Re: [Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
On Wed, Sep 02, 2015 at 04:44:35PM -, dann frazier wrote: > I tested that and can confirm it is sufficient (see attached patch). This adjusts the build flags for all platforms using gcc, for gcc 4.4 and above, which is overbroad. Could you test adding this as a patch to the ARMGCC build flags instead? -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
** Tags added: patch -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
Re: [Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
On Mon, Aug 31, 2015 at 8:24 PM, Thomas Preud'homme wrote: > The commit mentionned in the description concern the bswap pass which is > enabled at O2 and Os. No need to resort to -O1 though, -fno-expensive- > optimizations should be enough to disable it. I tested that and can confirm it is sufficient (see attached patch). ** Patch added: "fno-expensive-optimizations.patch" https://bugs.launchpad.net/bugs/1489560/+attachment/4456242/+files/fno-expensive-optimizations.patch -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
Re: [Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
On Tue, Sep 1, 2015 at 1:56 AM, Thomas Preud'homme wrote: > grep -E '[cC]{2}[ "].*' ../edk2.log | grep -Ev " (-E|(-x assembler > (-with-cpp)?)) " | grep -v -- "-fdump-tree-bswap" shows that all > invocation of cc or gcc for compiling had a -fdump-tree-bswap in it. > This confuses me because the only "found at" I could find in the bswap > dumps are for: > > ./Build/Shell/RELEASE_ARMGCC/AARCH64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/SwapBytes16.c.090t.bswap:16 > bit bswap implementation found at: _7 = _4 | _6; > ./Build/ArmVirtualizationQemu-AARCH64/RELEASE_ARMGCC/AARCH64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/SwapBytes16.c.090t.bswap:16 > bit bswap implementation found at: _7 = _4 | _6; > ./Build/Fat/RELEASE_ARMGCC/AARCH64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/SwapBytes16.c.090t.bswap:16 > bit bswap implementation found at: _7 = _4 | _6; > > All these conversion are fine and should have triggered with GCC 4.9 as > well. > > Can you add -fdump-tree-bswap to CFLAGS in: > BaseTools/Conf/tools_def.template > BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile > BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile.cygwin > BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile > BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile.cygwin > BaseTools/Source/C/Makefiles/header.makefile > > and tell me the result of: > find -name \*.bswap -exec grep -H "found at" {} \; > ? dannf@mustang:~/edk2-0~20150106.5c2d456b$ gcc --version gcc (Ubuntu 5.2.1-15ubuntu2) 4.10.0 20140523 (experimental) Copyright (C) 2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. dannf@mustang:~/edk2-0~20150106.5c2d456b$ find -name \*.bswap -exec grep -H "found at" {} \; ./Build/ArmVirtualizationQemu-AARCH64/RELEASE_GCC49/AARCH64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/SwapBytes16.c.091t.bswap:16 bit bswap implementation found at: _7 = _4 | _6; ./Build/Shell/RELEASE_GCC49/AARCH64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/SwapBytes16.c.091t.bswap:16 bit bswap implementation found at: _7 = _4 | _6; ./Build/Fat/RELEASE_GCC49/AARCH64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/SwapBytes16.c.091t.bswap:16 bit bswap implementation found at: _7 = _4 | _6; -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
grep -E '[cC]{2}[ "].*' ../edk2.log | grep -Ev " (-E|(-x assembler (-with-cpp)?)) " | grep -v -- "-fdump-tree-bswap" shows that all invocation of cc or gcc for compiling had a -fdump-tree-bswap in it. This confuses me because the only "found at" I could find in the bswap dumps are for: ./Build/Shell/RELEASE_ARMGCC/AARCH64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/SwapBytes16.c.090t.bswap:16 bit bswap implementation found at: _7 = _4 | _6; ./Build/ArmVirtualizationQemu-AARCH64/RELEASE_ARMGCC/AARCH64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/SwapBytes16.c.090t.bswap:16 bit bswap implementation found at: _7 = _4 | _6; ./Build/Fat/RELEASE_ARMGCC/AARCH64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/SwapBytes16.c.090t.bswap:16 bit bswap implementation found at: _7 = _4 | _6; All these conversion are fine and should have triggered with GCC 4.9 as well. Can you add -fdump-tree-bswap to CFLAGS in: BaseTools/Conf/tools_def.template BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile.cygwin BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile.cygwin BaseTools/Source/C/Makefiles/header.makefile and tell me the result of: find -name \*.bswap -exec grep -H "found at" {} \; ? -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
The commit mentionned in the description concern the bswap pass which is enabled at O2 and Os. No need to resort to -O1 though, -fno-expensive- optimizations should be enough to disable it. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
Here's the script I used to reproduce it. Note that it is using KVM, so it needs to run natively on an arm64 system. The trusty image I used is just a download from cloud-images.ubuntu.com. But you could just use an empty file for that since the hang occurs way before the disk would be accessed. ** Attachment added: "testit.sh" https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+attachment/4455135/+files/testit.sh -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
Re: [Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
On Sun, Aug 30, 2015 at 8:17 AM, Matthias Klose wrote: > looks like a build is a mix of no opt, -O and -Os. So maybe experiment with > -O2 instead of -Os? > also we are shipping a snapshot which predates the GCC 5 release. Please > could you check with a recent edk2 snapshot as well? I tested a build of edk2 trunk last week and the issue persists. -dann -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
Ok, I'll build edk2 with bswap dumps enabled and check all the cases this pass optimizes. There might be many of them so if you manage to pinpoint it to some specific file or testcase please let me know as it would make debugging easier. Best regards -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
Re: [Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
On Sun, Aug 30, 2015 at 02:04:17PM -, Matthias Klose wrote: > is building using GCC 4.9 a good enough work around? This bug was discovered in the process of trying to transition the qemu-efi binary package to be Architecture: all and built using a cross-compiler, which in Debian we only have for gcc-5 and above. So that's not a very good workaround in this case. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
looks like a build is a mix of no opt, -O and -Os. So maybe experiment with -O2 instead of -Os? also we are shipping a snapshot which predates the GCC 5 release. Please could you check with a recent edk2 snapshot as well? -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
CCed Thomas does this go away when building edk2 with lowered optimization? without optimization? is building using GCC 4.9 a good enough work around? please could you describe how to reproduce this issue? -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
Matthias, please have a look at this when you can ** Changed in: gcc-5 (Ubuntu) Assignee: (unassigned) => Matthias Klose (doko) -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
if this is a code generation bug, then it should be a high priority to fix in gcc. ** Changed in: gcc-5 (Ubuntu) Importance: Undecided => High -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1489560] Re: qemu-efi: hangs in kvm mode when built w/ gcc-5
** Also affects: gcc-5 (Ubuntu) Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1489560 Title: qemu-efi: hangs in kvm mode when built w/ gcc-5 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1489560/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs