All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/8] Travis fixes
@ 2019-05-02  6:55 Alexander Graf
  2019-05-02  6:55 ` [PATCH v2 1/8] travis: Run bootstrap instead of autogen.sh Alexander Graf
                   ` (8 more replies)
  0 siblings, 9 replies; 22+ messages in thread
From: Alexander Graf @ 2019-05-02  6:55 UTC (permalink / raw)
  To: grub-devel

This patch set collects a few fixes for Travis CI since the initial
commit was applied:

  - catch up with the tree
  - fix targets that need a board specified
  - make mkimage loop more robust
  - add QEMU tests for ARM and AArch64 EFI targets
  - add ARM Thumb mode tests
  - verify that on demand module and config loading from TFTP works

That way we should hopefully catch even more problems going forward.

v1 -> v2:

  - add ARM Thumb mode tests
  - verify that on demand module and config loading from TFTP works
  - use local gnulib (saves ~3m git checkout time)

Alexander Graf (8):
  travis: Run bootstrap instead of autogen.sh
  travis: Fix sparc64 test
  travis: Fix mips QEMU target
  travis: Fix arm coreboot test and make loop more robus
  arm coreboot: Use common directory path
  travis: Add smoke tests for arm and aarch64
  travis: Add ARM thumb target to tests
  travis: Test module loading from tftp as well

 .travis.yml    | 45 +++++++++++++++++++++++++++++++++++++--------
 util/mkimage.c |  4 ++--
 2 files changed, 39 insertions(+), 10 deletions(-)

-- 
2.16.4



^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v2 1/8] travis: Run bootstrap instead of autogen.sh
  2019-05-02  6:55 [PATCH v2 0/8] Travis fixes Alexander Graf
@ 2019-05-02  6:55 ` Alexander Graf
  2019-05-10 11:03   ` Daniel Kiper
  2019-05-02  6:55 ` [PATCH v2 2/8] travis: Fix sparc64 test Alexander Graf
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 22+ messages in thread
From: Alexander Graf @ 2019-05-02  6:55 UTC (permalink / raw)
  To: grub-devel

Commit 35b909062e7b3 ("gnulib: Upgrade Gnulib and switch to bootstrap tool")
changed the build flow from running ./autogen.sh to running ./bootstrap
but missed to update .travis.yml. Adapt it accordingly.

Fixes: 35b909062e7b3 ("gnulib: Upgrade Gnulib and switch to bootstrap tool")
Signed-off-by: Alexander Graf <agraf@csgraf.de>

---

v1 -> v2:

  - use local gnulib copy (saves ~3m git checkout time)
---
 .travis.yml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 81de20fa3..6b8f97830 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,6 +18,7 @@ addons:
     - python
     - qemu-system
     - unifont
+    - gnulib
 
 env:
   global:
@@ -35,7 +36,11 @@ before_script:
 script:
   # Comments must be outside the command strings below, or the Travis parser
   # will get confused.
-  - ./autogen.sh
+
+  # The Ubuntu gnulib does not compile with gcc8, so only use it with the system compiler
+  - if [ ! "$CROSS_TARGETS" ]; then rm -rf gnulib; ln -s /usr/share/gnulib; fi
+  # Initialize build system
+  - ./bootstrap
 
   # Build all selected GRUB targets.
   - for target in $GRUB_TARGETS; do
-- 
2.16.4



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v2 2/8] travis: Fix sparc64 test
  2019-05-02  6:55 [PATCH v2 0/8] Travis fixes Alexander Graf
  2019-05-02  6:55 ` [PATCH v2 1/8] travis: Run bootstrap instead of autogen.sh Alexander Graf
@ 2019-05-02  6:55 ` Alexander Graf
  2019-05-02  6:55 ` [PATCH v2 3/8] travis: Fix mips QEMU target Alexander Graf
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 22+ messages in thread
From: Alexander Graf @ 2019-05-02  6:55 UTC (permalink / raw)
  To: grub-devel

For sparc64, we were not selecting the correct mkimage output type. Just
pick aout at random. Also, make sure the rest of the variable logic can
deal with the 3rd element.

Signed-off-by: Alexander Graf <agraf@csgraf.de>
---
 .travis.yml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 6b8f97830..f3ac88036 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -45,7 +45,8 @@ script:
   # Build all selected GRUB targets.
   - for target in $GRUB_TARGETS; do
       plat=${target#*-};
-      arch=${target%-*};
+      plat=${plat%-*};
+      arch=${target%%-*};
       [ "$arch" = "arm64" ] && arch=aarch64-linux;
       [ "$arch" = "arm" ] && arch=arm-linux-gnueabi;
       [ "$arch" = "ia64" ] && arch=ia64-linux;
@@ -85,7 +86,7 @@ matrix:
         - CROSS_TARGETS="powerpc64-linux"
     - name: "sparc64"
       env:
-        - GRUB_TARGETS="sparc64-ieee1275"
+        - GRUB_TARGETS="sparc64-ieee1275-aout"
         - CROSS_TARGETS="sparc64-linux"
     - name: "ia64"
       env:
-- 
2.16.4



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v2 3/8] travis: Fix mips QEMU target
  2019-05-02  6:55 [PATCH v2 0/8] Travis fixes Alexander Graf
  2019-05-02  6:55 ` [PATCH v2 1/8] travis: Run bootstrap instead of autogen.sh Alexander Graf
  2019-05-02  6:55 ` [PATCH v2 2/8] travis: Fix sparc64 test Alexander Graf
@ 2019-05-02  6:55 ` Alexander Graf
  2019-05-02  6:55 ` [PATCH v2 4/8] travis: Fix arm coreboot test and make loop more robus Alexander Graf
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 22+ messages in thread
From: Alexander Graf @ 2019-05-02  6:55 UTC (permalink / raw)
  To: grub-devel

The MIPS QEMU targets can be built as either elf binary or flash image.
Build one each for BE/LE and make sure we pass the correct one into
mkimage.

Signed-off-by: Alexander Graf <agraf@csgraf.de>
---
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index f3ac88036..3f23e9a72 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -94,7 +94,7 @@ matrix:
         - CROSS_TARGETS="ia64-linux"
     - name: "mips"
       env:
-        - GRUB_TARGETS="mips-arc mipsel-arc mipsel-qemu_mips mips-qemu_mips"
+        - GRUB_TARGETS="mips-arc mipsel-arc mipsel-qemu_mips-elf mips-qemu_mips-flash"
         - CROSS_TARGETS="mips64-linux"
     - name: "arm"
       env:
-- 
2.16.4



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v2 4/8] travis: Fix arm coreboot test and make loop more robus
  2019-05-02  6:55 [PATCH v2 0/8] Travis fixes Alexander Graf
                   ` (2 preceding siblings ...)
  2019-05-02  6:55 ` [PATCH v2 3/8] travis: Fix mips QEMU target Alexander Graf
@ 2019-05-02  6:55 ` Alexander Graf
  2019-05-02  6:55 ` [PATCH v2 5/8] arm coreboot: Use common directory path Alexander Graf
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 22+ messages in thread
From: Alexander Graf @ 2019-05-02  6:55 UTC (permalink / raw)
  To: grub-devel

We missed the fact that the coreboot target did not succeed on mkimage.
Properly abort the loop if we see a failure and fix the coreboot target
to also indicate the board target.

Signed-off-by: Alexander Graf <agraf@csgraf.de>
---
 .travis.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 3f23e9a72..2722f3a3a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -66,7 +66,7 @@ script:
   - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > grub.cfg
 
   # Assemble images and possibly run them.
-  - for target in $GRUB_TARGETS; do grub-mkimage -c grub.cfg -p / -O $target -o grub-$target echo reboot normal; done
+  - ( for target in $GRUB_TARGETS; do grub-mkimage -c grub.cfg -p / -O $target -o grub-$target echo reboot normal || exit; done )
 
   # Run images we know how to run.
   - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-x86_64-efi | tee grub.log && grep "hello world" grub.log; fi
@@ -98,7 +98,7 @@ matrix:
         - CROSS_TARGETS="mips64-linux"
     - name: "arm"
       env:
-        - GRUB_TARGETS="arm-coreboot arm-efi arm-uboot"
+        - GRUB_TARGETS="arm-coreboot-vexpress arm-efi arm-uboot"
         - CROSS_TARGETS="arm-linux-gnueabi"
     - name: "arm64"
       env:
-- 
2.16.4



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v2 5/8] arm coreboot: Use common directory path
  2019-05-02  6:55 [PATCH v2 0/8] Travis fixes Alexander Graf
                   ` (3 preceding siblings ...)
  2019-05-02  6:55 ` [PATCH v2 4/8] travis: Fix arm coreboot test and make loop more robus Alexander Graf
@ 2019-05-02  6:55 ` Alexander Graf
  2019-05-02  6:55 ` [PATCH v2 6/8] travis: Add smoke tests for arm and aarch64 Alexander Graf
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 22+ messages in thread
From: Alexander Graf @ 2019-05-02  6:55 UTC (permalink / raw)
  To: grub-devel

The ARM coreboot target supports multiple boards, but they are all built
using the same object path. The only difference in target boards is done
in mkimage to determine the load address.

Currently, mkimage is looking at a board specific path
(/usr/lib/grub/arm-coreboot-vexpress) for modules while it installs it
at a non-specific path (/usr/lib/grub/arm-coreboot).

So let's sync the two up again and tell mkimage to look for coreboot
modules at a board agnostic path, syncing it up with all other targets.

Signed-off-by: Alexander Graf <agraf@csgraf.de>
---
 util/mkimage.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/util/mkimage.c b/util/mkimage.c
index 37d6249f1..f1a9c9c86 100644
--- a/util/mkimage.c
+++ b/util/mkimage.c
@@ -553,7 +553,7 @@ static const struct grub_install_image_target_desc image_targets[] =
     },
     /* For coreboot versions that don't support self-relocating images. */
     {
-      .dirname = "arm-coreboot-vexpress",
+      .dirname = "arm-coreboot",
       .names = { "arm-coreboot-vexpress", NULL },
       .voidp_sizeof = 4,
       .bigendian = 0,
@@ -572,7 +572,7 @@ static const struct grub_install_image_target_desc image_targets[] =
       .link_addr = 0x62000000,
     },
     {
-      .dirname = "arm-coreboot-veyron",
+      .dirname = "arm-coreboot",
       .names = { "arm-coreboot-veyron", NULL },
       .voidp_sizeof = 4,
       .bigendian = 0,
-- 
2.16.4



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v2 6/8] travis: Add smoke tests for arm and aarch64
  2019-05-02  6:55 [PATCH v2 0/8] Travis fixes Alexander Graf
                   ` (4 preceding siblings ...)
  2019-05-02  6:55 ` [PATCH v2 5/8] arm coreboot: Use common directory path Alexander Graf
@ 2019-05-02  6:55 ` Alexander Graf
  2019-05-14  9:37   ` Leif Lindholm
  2019-05-02  6:55 ` [PATCH v2 7/8] travis: Add ARM thumb target to tests Alexander Graf
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 22+ messages in thread
From: Alexander Graf @ 2019-05-02  6:55 UTC (permalink / raw)
  To: grub-devel

We've had an arm regression in grub recently where grub would not even
be able to boot up anymore. So let's include arm and aarch64 in our
simple "hello world" smoke tests as well.

For OVMF on ARM to work, we need a newer version of QEMU, add a PPA
dependency for it.

Signed-off-by: Alexander Graf <agraf@csgraf.de>
---
 .travis.yml | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 2722f3a3a..8571d9f1c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,6 +11,8 @@ language: c
 
 addons:
   apt:
+    sources:
+    - sourceline: 'ppa:jacob/virtualisation'
     packages:
     - libsdl1.2-dev
     - lzop
@@ -32,6 +34,8 @@ before_script:
   - for i in $CROSS_TARGETS; do
         ( cd /tmp/cross; wget -t 3 -O - https://mirrors.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.1.0/x86_64-gcc-8.1.0-nolibc-$i.tar.xz | tar xJ );
     done
+  - if [[ "$GRUB_TARGETS" == *"arm64-efi"* ]]; then wget http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/3525/QEMU-AARCH64/RELEASE_GCC5/QEMU_EFI.fd -O QEMU_EFI.aarch64.fd; fi
+  - if [[ "$GRUB_TARGETS" == *"arm-efi"* ]]; then wget http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/3525/QEMU-ARM/RELEASE_GCC5/QEMU_EFI.fd -O QEMU_EFI.arm.fd; fi
 
 script:
   # Comments must be outside the command strings below, or the Travis parser
@@ -69,7 +73,9 @@ script:
   - ( for target in $GRUB_TARGETS; do grub-mkimage -c grub.cfg -p / -O $target -o grub-$target echo reboot normal || exit; done )
 
   # Run images we know how to run.
-  - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-x86_64-efi | tee grub.log && grep "hello world" grub.log; fi
+  - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64                          -bios /usr/share/ovmf/OVMF.fd -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-x86_64-efi | tee grub.log && grep "hello world" grub.log; fi
+  - if [[ "$GRUB_TARGETS" == *"arm64-efi"* ]];  then qemu-system-aarch64 -M virt -cpu cortex-a57 -bios QEMU_EFI.aarch64.fd     -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-arm64-efi  | tee grub.log && grep "hello world" grub.log; fi
+  - if [[ "$GRUB_TARGETS" == *"arm-efi"* ]];    then qemu-system-arm     -M virt -cpu cortex-a15 -bios QEMU_EFI.arm.fd         -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-arm-efi    | tee grub.log && grep "hello world" grub.log; fi
 
 matrix:
   include:
-- 
2.16.4



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v2 7/8] travis: Add ARM thumb target to tests
  2019-05-02  6:55 [PATCH v2 0/8] Travis fixes Alexander Graf
                   ` (5 preceding siblings ...)
  2019-05-02  6:55 ` [PATCH v2 6/8] travis: Add smoke tests for arm and aarch64 Alexander Graf
@ 2019-05-02  6:55 ` Alexander Graf
  2019-05-14 10:05   ` Leif Lindholm
  2019-05-02  6:55 ` [PATCH v2 8/8] travis: Test module loading from tftp as well Alexander Graf
  2019-05-10 11:25 ` [PATCH v2 0/8] Travis fixes Daniel Kiper
  8 siblings, 1 reply; 22+ messages in thread
From: Alexander Graf @ 2019-05-02  6:55 UTC (permalink / raw)
  To: grub-devel

We hit an error case which only got triggered on ARM Thumb code. So
let's make sure we test that combination as well.

Signed-off-by: Alexander Graf <agraf@csgraf.de>
---
 .travis.yml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index 8571d9f1c..d8f6170e6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -106,6 +106,11 @@ matrix:
       env:
         - GRUB_TARGETS="arm-coreboot-vexpress arm-efi arm-uboot"
         - CROSS_TARGETS="arm-linux-gnueabi"
+    - name: "arm_thumb"
+      env:
+        - GRUB_TARGETS="arm-coreboot-vexpress arm-efi arm-uboot"
+        - CROSS_TARGETS="arm-linux-gnueabi"
+        - TARGET_CFLAGS="-mthumb"
     - name: "arm64"
       env:
         - GRUB_TARGETS="arm64-efi"
-- 
2.16.4



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH v2 8/8] travis: Test module loading from tftp as well
  2019-05-02  6:55 [PATCH v2 0/8] Travis fixes Alexander Graf
                   ` (6 preceding siblings ...)
  2019-05-02  6:55 ` [PATCH v2 7/8] travis: Add ARM thumb target to tests Alexander Graf
@ 2019-05-02  6:55 ` Alexander Graf
  2019-05-10 11:24   ` Daniel Kiper
  2019-05-10 11:25 ` [PATCH v2 0/8] Travis fixes Daniel Kiper
  8 siblings, 1 reply; 22+ messages in thread
From: Alexander Graf @ 2019-05-02  6:55 UTC (permalink / raw)
  To: grub-devel

The travis test today only uses modules that are delivered with the
grub.efi binary. Let's drop echo and reboot and see if grub can load
them dynamically.

For this, we need to ensure that all modules required to load additional
modules are included in the grub binary. Some of these are target
specific (like efinet), so only include them conditionally.

Furthermore, the iPXE option rom included in Ubuntu Xenial seems to be
broken, so we need to ensure that we only use the OVMF built-in network
driver and not pass in an option rom.

Signed-off-by: Alexander Graf <agraf@csgraf.de>

---

v1 -> v2:

  - new patch
---
 .travis.yml | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index d8f6170e6..9bed42ac5 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -67,15 +67,27 @@ script:
     done
 
   # Our test canary.
-  - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > grub.cfg
+  - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > /tmp/grub/lib/grub/grub.cfg
 
   # Assemble images and possibly run them.
-  - ( for target in $GRUB_TARGETS; do grub-mkimage -c grub.cfg -p / -O $target -o grub-$target echo reboot normal || exit; done )
+  - ( for target in $GRUB_TARGETS; do
+        pushd /tmp/grub/lib/grub/;
+        if [ -f $target/efinet.mod ]; then
+          EXTMODULES="efinet";
+        else
+          EXTMODULES="";
+        fi;
+        grub-mkimage -p / -O $target -o grub-$target normal tftp $EXTMODULES || exit;
+        popd;
+      done )
 
   # Run images we know how to run.
-  - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64                          -bios /usr/share/ovmf/OVMF.fd -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-x86_64-efi | tee grub.log && grep "hello world" grub.log; fi
-  - if [[ "$GRUB_TARGETS" == *"arm64-efi"* ]];  then qemu-system-aarch64 -M virt -cpu cortex-a57 -bios QEMU_EFI.aarch64.fd     -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-arm64-efi  | tee grub.log && grep "hello world" grub.log; fi
-  - if [[ "$GRUB_TARGETS" == *"arm-efi"* ]];    then qemu-system-arm     -M virt -cpu cortex-a15 -bios QEMU_EFI.arm.fd         -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-arm-efi    | tee grub.log && grep "hello world" grub.log; fi
+  - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64                          -bios /usr/share/ovmf/OVMF.fd
+                         -m 512 -no-reboot -nographic -net none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-x86_64-efi -device virtio-net-pci,netdev=nd,romfile="" | tee grub.log && grep "hello world" grub.log; fi
+  - if [[ "$GRUB_TARGETS" == *"arm64-efi"* ]];  then qemu-system-aarch64 -M virt -cpu cortex-a57 -bios QEMU_EFI.aarch64.fd
+                         -m 512 -no-reboot -nographic -net none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-arm64-efi  -device virtio-net-pci,netdev=nd,romfile="" | tee grub.log && grep "hello world" grub.log; fi
+  - if [[ "$GRUB_TARGETS" == *"arm-efi"* ]];    then qemu-system-arm     -M virt -cpu cortex-a15 -bios QEMU_EFI.arm.fd
+                         -m 512 -no-reboot -nographic -net none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-arm-efi    -device virtio-net-pci,netdev=nd,romfile="" | tee grub.log && grep "hello world" grub.log; fi
 
 matrix:
   include:
-- 
2.16.4



^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 1/8] travis: Run bootstrap instead of autogen.sh
  2019-05-02  6:55 ` [PATCH v2 1/8] travis: Run bootstrap instead of autogen.sh Alexander Graf
@ 2019-05-10 11:03   ` Daniel Kiper
  2019-05-14 13:17     ` Alexander Graf
  0 siblings, 1 reply; 22+ messages in thread
From: Daniel Kiper @ 2019-05-10 11:03 UTC (permalink / raw)
  To: Alexander Graf; +Cc: grub-devel

On Thu, May 02, 2019 at 08:55:30AM +0200, Alexander Graf wrote:
> Commit 35b909062e7b3 ("gnulib: Upgrade Gnulib and switch to bootstrap tool")
> changed the build flow from running ./autogen.sh to running ./bootstrap
> but missed to update .travis.yml. Adapt it accordingly.
>
> Fixes: 35b909062e7b3 ("gnulib: Upgrade Gnulib and switch to bootstrap tool")
> Signed-off-by: Alexander Graf <agraf@csgraf.de>
>
> ---
>
> v1 -> v2:
>
>   - use local gnulib copy (saves ~3m git checkout time)
> ---
>  .travis.yml | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/.travis.yml b/.travis.yml
> index 81de20fa3..6b8f97830 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -18,6 +18,7 @@ addons:
>      - python
>      - qemu-system
>      - unifont
> +    - gnulib
>
>  env:
>    global:
> @@ -35,7 +36,11 @@ before_script:
>  script:
>    # Comments must be outside the command strings below, or the Travis parser
>    # will get confused.
> -  - ./autogen.sh
> +
> +  # The Ubuntu gnulib does not compile with gcc8, so only use it with the system compiler
> +  - if [ ! "$CROSS_TARGETS" ]; then rm -rf gnulib; ln -s /usr/share/gnulib; fi

I would not depend on it at all. Could you drop this and gnulib package
addition above?

Daniel


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 8/8] travis: Test module loading from tftp as well
  2019-05-02  6:55 ` [PATCH v2 8/8] travis: Test module loading from tftp as well Alexander Graf
@ 2019-05-10 11:24   ` Daniel Kiper
  2019-05-14 13:18     ` Alexander Graf
  0 siblings, 1 reply; 22+ messages in thread
From: Daniel Kiper @ 2019-05-10 11:24 UTC (permalink / raw)
  To: agraf; +Cc: grub-devel

On Thu, May 02, 2019 at 08:55:37AM +0200, Alexander Graf wrote:
> The travis test today only uses modules that are delivered with the
> grub.efi binary. Let's drop echo and reboot and see if grub can load
> them dynamically.
>
> For this, we need to ensure that all modules required to load additional
> modules are included in the grub binary. Some of these are target
> specific (like efinet), so only include them conditionally.
>
> Furthermore, the iPXE option rom included in Ubuntu Xenial seems to be
> broken, so we need to ensure that we only use the OVMF built-in network
> driver and not pass in an option rom.
>
> Signed-off-by: Alexander Graf <agraf@csgraf.de>
>
> ---
>
> v1 -> v2:
>
>   - new patch
> ---
>  .travis.yml | 22 +++++++++++++++++-----
>  1 file changed, 17 insertions(+), 5 deletions(-)
>
> diff --git a/.travis.yml b/.travis.yml
> index d8f6170e6..9bed42ac5 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -67,15 +67,27 @@ script:
>      done
>
>    # Our test canary.
> -  - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > grub.cfg
> +  - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > /tmp/grub/lib/grub/grub.cfg
>
>    # Assemble images and possibly run them.
> -  - ( for target in $GRUB_TARGETS; do grub-mkimage -c grub.cfg -p / -O $target -o grub-$target echo reboot normal || exit; done )
> +  - ( for target in $GRUB_TARGETS; do
> +        pushd /tmp/grub/lib/grub/;
> +        if [ -f $target/efinet.mod ]; then
> +          EXTMODULES="efinet";
> +        else
> +          EXTMODULES="";
> +        fi;
> +        grub-mkimage -p / -O $target -o grub-$target normal tftp $EXTMODULES || exit;
> +        popd;
> +      done )
>
>    # Run images we know how to run.
> -  - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64                          -bios /usr/share/ovmf/OVMF.fd -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-x86_64-efi | tee grub.log && grep "hello world" grub.log; fi
> -  - if [[ "$GRUB_TARGETS" == *"arm64-efi"* ]];  then qemu-system-aarch64 -M virt -cpu cortex-a57 -bios QEMU_EFI.aarch64.fd     -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-arm64-efi  | tee grub.log && grep "hello world" grub.log; fi
> -  - if [[ "$GRUB_TARGETS" == *"arm-efi"* ]];    then qemu-system-arm     -M virt -cpu cortex-a15 -bios QEMU_EFI.arm.fd         -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-arm-efi    | tee grub.log && grep "hello world" grub.log; fi
> +  - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64                          -bios /usr/share/ovmf/OVMF.fd
> +                         -m 512 -no-reboot -nographic -net none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-x86_64-efi -device virtio-net-pci,netdev=nd,romfile="" | tee grub.log && grep "hello world" grub.log; fi
> +  - if [[ "$GRUB_TARGETS" == *"arm64-efi"* ]];  then qemu-system-aarch64 -M virt -cpu cortex-a57 -bios QEMU_EFI.aarch64.fd
> +                         -m 512 -no-reboot -nographic -net none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-arm64-efi  -device virtio-net-pci,netdev=nd,romfile="" | tee grub.log && grep "hello world" grub.log; fi
> +  - if [[ "$GRUB_TARGETS" == *"arm-efi"* ]];    then qemu-system-arm     -M virt -cpu cortex-a15 -bios QEMU_EFI.arm.fd
> +                         -m 512 -no-reboot -nographic -net none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-arm-efi    -device virtio-net-pci,netdev=nd,romfile="" | tee grub.log && grep "hello world" grub.log; fi

I am not sure why you do not use grep directly on the output.
Could you drop tee? If yes please drop it from all commands.

Daniel


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 0/8] Travis fixes
  2019-05-02  6:55 [PATCH v2 0/8] Travis fixes Alexander Graf
                   ` (7 preceding siblings ...)
  2019-05-02  6:55 ` [PATCH v2 8/8] travis: Test module loading from tftp as well Alexander Graf
@ 2019-05-10 11:25 ` Daniel Kiper
  8 siblings, 0 replies; 22+ messages in thread
From: Daniel Kiper @ 2019-05-10 11:25 UTC (permalink / raw)
  To: Alexander Graf; +Cc: grub-devel

On Thu, May 02, 2019 at 08:55:29AM +0200, Alexander Graf wrote:
> This patch set collects a few fixes for Travis CI since the initial
> commit was applied:
>
>   - catch up with the tree
>   - fix targets that need a board specified
>   - make mkimage loop more robust
>   - add QEMU tests for ARM and AArch64 EFI targets
>   - add ARM Thumb mode tests
>   - verify that on demand module and config loading from TFTP works
>
> That way we should hopefully catch even more problems going forward.
>
> v1 -> v2:
>
>   - add ARM Thumb mode tests
>   - verify that on demand module and config loading from TFTP works
>   - use local gnulib (saves ~3m git checkout time)
>
> Alexander Graf (8):
>   travis: Run bootstrap instead of autogen.sh
>   travis: Fix sparc64 test
>   travis: Fix mips QEMU target
>   travis: Fix arm coreboot test and make loop more robus
>   arm coreboot: Use common directory path
>   travis: Add smoke tests for arm and aarch64
>   travis: Add ARM thumb target to tests
>   travis: Test module loading from tftp as well
>
>  .travis.yml    | 45 +++++++++++++++++++++++++++++++++++++--------
>  util/mkimage.c |  4 ++--
>  2 files changed, 39 insertions(+), 10 deletions(-)

Except two patches you can add Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Daniel


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 6/8] travis: Add smoke tests for arm and aarch64
  2019-05-02  6:55 ` [PATCH v2 6/8] travis: Add smoke tests for arm and aarch64 Alexander Graf
@ 2019-05-14  9:37   ` Leif Lindholm
  0 siblings, 0 replies; 22+ messages in thread
From: Leif Lindholm @ 2019-05-14  9:37 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: Alexander Graf

Just noticed this hadn't been merged, so time for a comment :)

On Thu, May 02, 2019 at 08:55:35AM +0200, Alexander Graf wrote:
> We've had an arm regression in grub recently where grub would not even
> be able to boot up anymore. So let's include arm and aarch64 in our
> simple "hello world" smoke tests as well.
> 
> For OVMF on ARM to work, we need a newer version of QEMU, add a PPA
> dependency for it.
> 
> Signed-off-by: Alexander Graf <agraf@csgraf.de>
> ---
>  .travis.yml | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/.travis.yml b/.travis.yml
> index 2722f3a3a..8571d9f1c 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -11,6 +11,8 @@ language: c
>  
>  addons:
>    apt:
> +    sources:
> +    - sourceline: 'ppa:jacob/virtualisation'
>      packages:
>      - libsdl1.2-dev
>      - lzop
> @@ -32,6 +34,8 @@ before_script:
>    - for i in $CROSS_TARGETS; do
>          ( cd /tmp/cross; wget -t 3 -O - https://mirrors.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.1.0/x86_64-gcc-8.1.0-nolibc-$i.tar.xz | tar xJ );
>      done
> +  - if [[ "$GRUB_TARGETS" == *"arm64-efi"* ]]; then wget http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/3525/QEMU-AARCH64/RELEASE_GCC5/QEMU_EFI.fd -O QEMU_EFI.aarch64.fd; fi
> +  - if [[ "$GRUB_TARGETS" == *"arm-efi"* ]]; then wget http://snapshots.linaro.org/components/kernel/leg-virt-tianocore-edk2-upstream/3525/QEMU-ARM/RELEASE_GCC5/QEMU_EFI.fd -O QEMU_EFI.arm.fd; fi

Probably don't want to use images from snapshots - they get garbage
collected after a few months.
http://releases.linaro.org/reference-platform/enterprise/firmware/open-source/19.03/release/qemu-aarch64/QEMU_EFI.fd
and
http://releases.linaro.org/reference-platform/enterprise/firmware/open-source/19.03/release/qemu-arm/QEMU_EFI.fd
aren't going anywhere, so are possibly better options.

/
    Leif

>  
>  script:
>    # Comments must be outside the command strings below, or the Travis parser
> @@ -69,7 +73,9 @@ script:
>    - ( for target in $GRUB_TARGETS; do grub-mkimage -c grub.cfg -p / -O $target -o grub-$target echo reboot normal || exit; done )
>  
>    # Run images we know how to run.
> -  - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-x86_64-efi | tee grub.log && grep "hello world" grub.log; fi
> +  - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64                          -bios /usr/share/ovmf/OVMF.fd -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-x86_64-efi | tee grub.log && grep "hello world" grub.log; fi
> +  - if [[ "$GRUB_TARGETS" == *"arm64-efi"* ]];  then qemu-system-aarch64 -M virt -cpu cortex-a57 -bios QEMU_EFI.aarch64.fd     -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-arm64-efi  | tee grub.log && grep "hello world" grub.log; fi
> +  - if [[ "$GRUB_TARGETS" == *"arm-efi"* ]];    then qemu-system-arm     -M virt -cpu cortex-a15 -bios QEMU_EFI.arm.fd         -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-arm-efi    | tee grub.log && grep "hello world" grub.log; fi
>  
>  matrix:
>    include:
> -- 
> 2.16.4
> 
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 7/8] travis: Add ARM thumb target to tests
  2019-05-02  6:55 ` [PATCH v2 7/8] travis: Add ARM thumb target to tests Alexander Graf
@ 2019-05-14 10:05   ` Leif Lindholm
  2019-05-14 13:32     ` Alexander Graf
  0 siblings, 1 reply; 22+ messages in thread
From: Leif Lindholm @ 2019-05-14 10:05 UTC (permalink / raw)
  To: The development of GNU GRUB; +Cc: Alexander Graf

Comment here as well:

On Thu, May 02, 2019 at 08:55:36AM +0200, Alexander Graf wrote:
> We hit an error case which only got triggered on ARM Thumb code. So
> let's make sure we test that combination as well.

This is the default for at least several and possibly most ARMv7-A
distributions/prebuilt toolchains.

So while a good idea, if you want to specifically force instruction
set use, the opposite case needs to be set up with -marm.

> Signed-off-by: Alexander Graf <agraf@csgraf.de>
> ---
>  .travis.yml | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/.travis.yml b/.travis.yml
> index 8571d9f1c..d8f6170e6 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -106,6 +106,11 @@ matrix:
>        env:
>          - GRUB_TARGETS="arm-coreboot-vexpress arm-efi arm-uboot"
>          - CROSS_TARGETS="arm-linux-gnueabi"

But, wait...
arm-linux-gnueabi is the softfloat (v5te) toolchain - if we want to
test that, fine - but we definitely need to test arm-linux-gnueabihf.

First of all, I would expect that this toolchain will not use T32
(Thumb-2) instructions by default, so much of the code will end up
being compiled as A32 anyway.

/
    Leif

> +    - name: "arm_thumb"
> +      env:
> +        - GRUB_TARGETS="arm-coreboot-vexpress arm-efi arm-uboot"
> +        - CROSS_TARGETS="arm-linux-gnueabi"
> +        - TARGET_CFLAGS="-mthumb"
>      - name: "arm64"
>        env:
>          - GRUB_TARGETS="arm64-efi"
> -- 
> 2.16.4
> 
> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 1/8] travis: Run bootstrap instead of autogen.sh
  2019-05-10 11:03   ` Daniel Kiper
@ 2019-05-14 13:17     ` Alexander Graf
  2019-05-14 14:14       ` Daniel Kiper
  0 siblings, 1 reply; 22+ messages in thread
From: Alexander Graf @ 2019-05-14 13:17 UTC (permalink / raw)
  To: The development of GNU GRUB, Daniel Kiper


On 10.05.19 13:03, Daniel Kiper wrote:
> On Thu, May 02, 2019 at 08:55:30AM +0200, Alexander Graf wrote:
>> Commit 35b909062e7b3 ("gnulib: Upgrade Gnulib and switch to bootstrap tool")
>> changed the build flow from running ./autogen.sh to running ./bootstrap
>> but missed to update .travis.yml. Adapt it accordingly.
>>
>> Fixes: 35b909062e7b3 ("gnulib: Upgrade Gnulib and switch to bootstrap tool")
>> Signed-off-by: Alexander Graf <agraf@csgraf.de>
>>
>> ---
>>
>> v1 -> v2:
>>
>>   - use local gnulib copy (saves ~3m git checkout time)
>> ---
>>  .travis.yml | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/.travis.yml b/.travis.yml
>> index 81de20fa3..6b8f97830 100644
>> --- a/.travis.yml
>> +++ b/.travis.yml
>> @@ -18,6 +18,7 @@ addons:
>>      - python
>>      - qemu-system
>>      - unifont
>> +    - gnulib
>>
>>  env:
>>    global:
>> @@ -35,7 +36,11 @@ before_script:
>>  script:
>>    # Comments must be outside the command strings below, or the Travis parser
>>    # will get confused.
>> -  - ./autogen.sh
>> +
>> +  # The Ubuntu gnulib does not compile with gcc8, so only use it with the system compiler
>> +  - if [ ! "$CROSS_TARGETS" ]; then rm -rf gnulib; ln -s /usr/share/gnulib; fi
> I would not depend on it at all. Could you drop this and gnulib package
> addition above?


The gnulib package dependency gets us all the other dependencies that
gnulib pulls in - and is much more obvious than listing them explicitly.

The hack here shaves down compilation time by a few minutes for x86
targets - and latency is definitely important. I'd really prefer to
leave it in.


Alex




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 8/8] travis: Test module loading from tftp as well
  2019-05-10 11:24   ` Daniel Kiper
@ 2019-05-14 13:18     ` Alexander Graf
  2019-05-14 14:15       ` Daniel Kiper
  0 siblings, 1 reply; 22+ messages in thread
From: Alexander Graf @ 2019-05-14 13:18 UTC (permalink / raw)
  To: The development of GNU GRUB, Daniel Kiper


On 10.05.19 13:24, Daniel Kiper wrote:
> On Thu, May 02, 2019 at 08:55:37AM +0200, Alexander Graf wrote:
>> The travis test today only uses modules that are delivered with the
>> grub.efi binary. Let's drop echo and reboot and see if grub can load
>> them dynamically.
>>
>> For this, we need to ensure that all modules required to load additional
>> modules are included in the grub binary. Some of these are target
>> specific (like efinet), so only include them conditionally.
>>
>> Furthermore, the iPXE option rom included in Ubuntu Xenial seems to be
>> broken, so we need to ensure that we only use the OVMF built-in network
>> driver and not pass in an option rom.
>>
>> Signed-off-by: Alexander Graf <agraf@csgraf.de>
>>
>> ---
>>
>> v1 -> v2:
>>
>>   - new patch
>> ---
>>  .travis.yml | 22 +++++++++++++++++-----
>>  1 file changed, 17 insertions(+), 5 deletions(-)
>>
>> diff --git a/.travis.yml b/.travis.yml
>> index d8f6170e6..9bed42ac5 100644
>> --- a/.travis.yml
>> +++ b/.travis.yml
>> @@ -67,15 +67,27 @@ script:
>>      done
>>
>>    # Our test canary.
>> -  - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > grub.cfg
>> +  - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > /tmp/grub/lib/grub/grub.cfg
>>
>>    # Assemble images and possibly run them.
>> -  - ( for target in $GRUB_TARGETS; do grub-mkimage -c grub.cfg -p / -O $target -o grub-$target echo reboot normal || exit; done )
>> +  - ( for target in $GRUB_TARGETS; do
>> +        pushd /tmp/grub/lib/grub/;
>> +        if [ -f $target/efinet.mod ]; then
>> +          EXTMODULES="efinet";
>> +        else
>> +          EXTMODULES="";
>> +        fi;
>> +        grub-mkimage -p / -O $target -o grub-$target normal tftp $EXTMODULES || exit;
>> +        popd;
>> +      done )
>>
>>    # Run images we know how to run.
>> -  - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64                          -bios /usr/share/ovmf/OVMF.fd -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-x86_64-efi | tee grub.log && grep "hello world" grub.log; fi
>> -  - if [[ "$GRUB_TARGETS" == *"arm64-efi"* ]];  then qemu-system-aarch64 -M virt -cpu cortex-a57 -bios QEMU_EFI.aarch64.fd     -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-arm64-efi  | tee grub.log && grep "hello world" grub.log; fi
>> -  - if [[ "$GRUB_TARGETS" == *"arm-efi"* ]];    then qemu-system-arm     -M virt -cpu cortex-a15 -bios QEMU_EFI.arm.fd         -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-arm-efi    | tee grub.log && grep "hello world" grub.log; fi
>> +  - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64                          -bios /usr/share/ovmf/OVMF.fd
>> +                         -m 512 -no-reboot -nographic -net none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-x86_64-efi -device virtio-net-pci,netdev=nd,romfile="" | tee grub.log && grep "hello world" grub.log; fi
>> +  - if [[ "$GRUB_TARGETS" == *"arm64-efi"* ]];  then qemu-system-aarch64 -M virt -cpu cortex-a57 -bios QEMU_EFI.aarch64.fd
>> +                         -m 512 -no-reboot -nographic -net none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-arm64-efi  -device virtio-net-pci,netdev=nd,romfile="" | tee grub.log && grep "hello world" grub.log; fi
>> +  - if [[ "$GRUB_TARGETS" == *"arm-efi"* ]];    then qemu-system-arm     -M virt -cpu cortex-a15 -bios QEMU_EFI.arm.fd
>> +                         -m 512 -no-reboot -nographic -net none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-arm-efi    -device virtio-net-pci,netdev=nd,romfile="" | tee grub.log && grep "hello world" grub.log; fi
> I am not sure why you do not use grep directly on the output.
> Could you drop tee? If yes please drop it from all commands.


This way you can see the VM output on the log. Without that, it becomes
really hard to debug when something goes wrong.


Alex




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 7/8] travis: Add ARM thumb target to tests
  2019-05-14 10:05   ` Leif Lindholm
@ 2019-05-14 13:32     ` Alexander Graf
  2019-05-14 14:06       ` Leif Lindholm
  0 siblings, 1 reply; 22+ messages in thread
From: Alexander Graf @ 2019-05-14 13:32 UTC (permalink / raw)
  To: The development of GNU GRUB, Leif Lindholm


On 14.05.19 12:05, Leif Lindholm wrote:
> Comment here as well:
>
> On Thu, May 02, 2019 at 08:55:36AM +0200, Alexander Graf wrote:
>> We hit an error case which only got triggered on ARM Thumb code. So
>> let's make sure we test that combination as well.
> This is the default for at least several and possibly most ARMv7-A
> distributions/prebuilt toolchains.
>
> So while a good idea, if you want to specifically force instruction
> set use, the opposite case needs to be set up with -marm.
>
>> Signed-off-by: Alexander Graf <agraf@csgraf.de>
>> ---
>>  .travis.yml | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/.travis.yml b/.travis.yml
>> index 8571d9f1c..d8f6170e6 100644
>> --- a/.travis.yml
>> +++ b/.travis.yml
>> @@ -106,6 +106,11 @@ matrix:
>>        env:
>>          - GRUB_TARGETS="arm-coreboot-vexpress arm-efi arm-uboot"
>>          - CROSS_TARGETS="arm-linux-gnueabi"
> But, wait...
> arm-linux-gnueabi is the softfloat (v5te) toolchain - if we want to
> test that, fine - but we definitely need to test arm-linux-gnueabihf.
>
> First of all, I would expect that this toolchain will not use T32
> (Thumb-2) instructions by default, so much of the code will end up
> being compiled as A32 anyway.


Yeah, that's why we don't need to pass in -marm I guess. But I also
don't see an explicit hardfloat cross gcc on kernel.org?

  https://mirrors.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.1.0/


Alex




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 7/8] travis: Add ARM thumb target to tests
  2019-05-14 13:32     ` Alexander Graf
@ 2019-05-14 14:06       ` Leif Lindholm
  2019-05-29 15:41         ` Alexander Graf
  0 siblings, 1 reply; 22+ messages in thread
From: Leif Lindholm @ 2019-05-14 14:06 UTC (permalink / raw)
  To: Alexander Graf; +Cc: The development of GNU GRUB

On Tue, May 14, 2019 at 06:32:06AM -0700, Alexander Graf wrote:
> > But, wait...
> > arm-linux-gnueabi is the softfloat (v5te) toolchain - if we want to
> > test that, fine - but we definitely need to test arm-linux-gnueabihf.
> >
> > First of all, I would expect that this toolchain will not use T32
> > (Thumb-2) instructions by default, so much of the code will end up
> > being compiled as A32 anyway.
> 
> 
> Yeah, that's why we don't need to pass in -marm I guess. But I also
> don't see an explicit hardfloat cross gcc on kernel.org?
> 
>   https://mirrors.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.1.0/

Urgh.
Yeah, so the default output of that toolchain gives
  File Attributes
  Tag_CPU_name: "5T"
  Tag_CPU_arch: v5T
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1

In theory, you should be OK just adding
"-mfloat-abi=hard -march=armv7-a+vfpv3-d16" to CFLAGS, since we're not
using any toolchain-provided libraries:

  Tag_CPU_name: "7-A"
  Tag_CPU_arch: v7
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-2
  Tag_FP_arch: VFPv3-D16
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_align_preserved: 8-byte, except leaf SP
  Tag_ABI_enum_size: int
  Tag_ABI_VFP_args: VFP registers

/
    Leif


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 1/8] travis: Run bootstrap instead of autogen.sh
  2019-05-14 13:17     ` Alexander Graf
@ 2019-05-14 14:14       ` Daniel Kiper
  0 siblings, 0 replies; 22+ messages in thread
From: Daniel Kiper @ 2019-05-14 14:14 UTC (permalink / raw)
  To: Alexander Graf; +Cc: The development of GNU GRUB

On Tue, May 14, 2019 at 06:17:58AM -0700, Alexander Graf wrote:
> On 10.05.19 13:03, Daniel Kiper wrote:
> > On Thu, May 02, 2019 at 08:55:30AM +0200, Alexander Graf wrote:
> >> Commit 35b909062e7b3 ("gnulib: Upgrade Gnulib and switch to bootstrap tool")
> >> changed the build flow from running ./autogen.sh to running ./bootstrap
> >> but missed to update .travis.yml. Adapt it accordingly.
> >>
> >> Fixes: 35b909062e7b3 ("gnulib: Upgrade Gnulib and switch to bootstrap tool")
> >> Signed-off-by: Alexander Graf <agraf@csgraf.de>
> >>
> >> ---
> >>
> >> v1 -> v2:
> >>
> >>   - use local gnulib copy (saves ~3m git checkout time)
> >> ---
> >>  .travis.yml | 7 ++++++-
> >>  1 file changed, 6 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/.travis.yml b/.travis.yml
> >> index 81de20fa3..6b8f97830 100644
> >> --- a/.travis.yml
> >> +++ b/.travis.yml
> >> @@ -18,6 +18,7 @@ addons:
> >>      - python
> >>      - qemu-system
> >>      - unifont
> >> +    - gnulib
> >>
> >>  env:
> >>    global:
> >> @@ -35,7 +36,11 @@ before_script:
> >>  script:
> >>    # Comments must be outside the command strings below, or the Travis parser
> >>    # will get confused.
> >> -  - ./autogen.sh
> >> +
> >> +  # The Ubuntu gnulib does not compile with gcc8, so only use it with the system compiler
> >> +  - if [ ! "$CROSS_TARGETS" ]; then rm -rf gnulib; ln -s /usr/share/gnulib; fi
> > I would not depend on it at all. Could you drop this and gnulib package
> > addition above?
>
>
> The gnulib package dependency gets us all the other dependencies that
> gnulib pulls in - and is much more obvious than listing them explicitly.
>
> The hack here shaves down compilation time by a few minutes for x86
> targets - and latency is definitely important. I'd really prefer to
> leave it in.

OK but please add somewhere a comment similar to above.

Daniel


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 8/8] travis: Test module loading from tftp as well
  2019-05-14 13:18     ` Alexander Graf
@ 2019-05-14 14:15       ` Daniel Kiper
  0 siblings, 0 replies; 22+ messages in thread
From: Daniel Kiper @ 2019-05-14 14:15 UTC (permalink / raw)
  To: Alexander Graf; +Cc: The development of GNU GRUB

On Tue, May 14, 2019 at 06:18:41AM -0700, Alexander Graf wrote:
> On 10.05.19 13:24, Daniel Kiper wrote:
> > On Thu, May 02, 2019 at 08:55:37AM +0200, Alexander Graf wrote:
> >> The travis test today only uses modules that are delivered with the
> >> grub.efi binary. Let's drop echo and reboot and see if grub can load
> >> them dynamically.
> >>
> >> For this, we need to ensure that all modules required to load additional
> >> modules are included in the grub binary. Some of these are target
> >> specific (like efinet), so only include them conditionally.
> >>
> >> Furthermore, the iPXE option rom included in Ubuntu Xenial seems to be
> >> broken, so we need to ensure that we only use the OVMF built-in network
> >> driver and not pass in an option rom.
> >>
> >> Signed-off-by: Alexander Graf <agraf@csgraf.de>
> >>
> >> ---
> >>
> >> v1 -> v2:
> >>
> >>   - new patch
> >> ---
> >>  .travis.yml | 22 +++++++++++++++++-----
> >>  1 file changed, 17 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/.travis.yml b/.travis.yml
> >> index d8f6170e6..9bed42ac5 100644
> >> --- a/.travis.yml
> >> +++ b/.travis.yml
> >> @@ -67,15 +67,27 @@ script:
> >>      done
> >>
> >>    # Our test canary.
> >> -  - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > grub.cfg
> >> +  - echo -e "insmod echo\\ninsmod reboot\\necho hello world\\nreboot" > /tmp/grub/lib/grub/grub.cfg
> >>
> >>    # Assemble images and possibly run them.
> >> -  - ( for target in $GRUB_TARGETS; do grub-mkimage -c grub.cfg -p / -O $target -o grub-$target echo reboot normal || exit; done )
> >> +  - ( for target in $GRUB_TARGETS; do
> >> +        pushd /tmp/grub/lib/grub/;
> >> +        if [ -f $target/efinet.mod ]; then
> >> +          EXTMODULES="efinet";
> >> +        else
> >> +          EXTMODULES="";
> >> +        fi;
> >> +        grub-mkimage -p / -O $target -o grub-$target normal tftp $EXTMODULES || exit;
> >> +        popd;
> >> +      done )
> >>
> >>    # Run images we know how to run.
> >> -  - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64                          -bios /usr/share/ovmf/OVMF.fd -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-x86_64-efi | tee grub.log && grep "hello world" grub.log; fi
> >> -  - if [[ "$GRUB_TARGETS" == *"arm64-efi"* ]];  then qemu-system-aarch64 -M virt -cpu cortex-a57 -bios QEMU_EFI.aarch64.fd     -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-arm64-efi  | tee grub.log && grep "hello world" grub.log; fi
> >> -  - if [[ "$GRUB_TARGETS" == *"arm-efi"* ]];    then qemu-system-arm     -M virt -cpu cortex-a15 -bios QEMU_EFI.arm.fd         -m 512 -no-reboot -nographic -net nic -net user,tftp=.,bootfile=grub-arm-efi    | tee grub.log && grep "hello world" grub.log; fi
> >> +  - if [[ "$GRUB_TARGETS" == *"x86_64-efi"* ]]; then qemu-system-x86_64                          -bios /usr/share/ovmf/OVMF.fd
> >> +                         -m 512 -no-reboot -nographic -net none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-x86_64-efi -device virtio-net-pci,netdev=nd,romfile="" | tee grub.log && grep "hello world" grub.log; fi
> >> +  - if [[ "$GRUB_TARGETS" == *"arm64-efi"* ]];  then qemu-system-aarch64 -M virt -cpu cortex-a57 -bios QEMU_EFI.aarch64.fd
> >> +                         -m 512 -no-reboot -nographic -net none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-arm64-efi  -device virtio-net-pci,netdev=nd,romfile="" | tee grub.log && grep "hello world" grub.log; fi
> >> +  - if [[ "$GRUB_TARGETS" == *"arm-efi"* ]];    then qemu-system-arm     -M virt -cpu cortex-a15 -bios QEMU_EFI.arm.fd
> >> +                         -m 512 -no-reboot -nographic -net none -netdev user,id=nd,tftp=/tmp/grub/lib/grub/,bootfile=grub-arm-efi    -device virtio-net-pci,netdev=nd,romfile="" | tee grub.log && grep "hello world" grub.log; fi
> > I am not sure why you do not use grep directly on the output.
> > Could you drop tee? If yes please drop it from all commands.
>
>
> This way you can see the VM output on the log. Without that, it becomes
> really hard to debug when something goes wrong.

OK, Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Daniel


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 7/8] travis: Add ARM thumb target to tests
  2019-05-14 14:06       ` Leif Lindholm
@ 2019-05-29 15:41         ` Alexander Graf
  2019-05-29 15:47           ` Leif Lindholm
  0 siblings, 1 reply; 22+ messages in thread
From: Alexander Graf @ 2019-05-29 15:41 UTC (permalink / raw)
  To: Leif Lindholm; +Cc: The development of GNU GRUB


On 14.05.19 16:06, Leif Lindholm wrote:
> On Tue, May 14, 2019 at 06:32:06AM -0700, Alexander Graf wrote:
>>> But, wait...
>>> arm-linux-gnueabi is the softfloat (v5te) toolchain - if we want to
>>> test that, fine - but we definitely need to test arm-linux-gnueabihf.
>>>
>>> First of all, I would expect that this toolchain will not use T32
>>> (Thumb-2) instructions by default, so much of the code will end up
>>> being compiled as A32 anyway.
>>
>> Yeah, that's why we don't need to pass in -marm I guess. But I also
>> don't see an explicit hardfloat cross gcc on kernel.org?
>>
>>   https://mirrors.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.1.0/
> Urgh.
> Yeah, so the default output of that toolchain gives
>   File Attributes
>   Tag_CPU_name: "5T"
>   Tag_CPU_arch: v5T
>   Tag_ARM_ISA_use: Yes
>   Tag_THUMB_ISA_use: Thumb-1
>
> In theory, you should be OK just adding
> "-mfloat-abi=hard -march=armv7-a+vfpv3-d16" to CFLAGS, since we're not
> using any toolchain-provided libraries:


In configure we're already forcing soft float, so there's little point
in adding these cflags :). In fact, when I do add them, I only get
configure errors because setting both -mhard-float and -msoft-float at
the same time confuses gcc.


Alex




^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v2 7/8] travis: Add ARM thumb target to tests
  2019-05-29 15:41         ` Alexander Graf
@ 2019-05-29 15:47           ` Leif Lindholm
  0 siblings, 0 replies; 22+ messages in thread
From: Leif Lindholm @ 2019-05-29 15:47 UTC (permalink / raw)
  To: Alexander Graf; +Cc: The development of GNU GRUB

On Wed, May 29, 2019 at 05:41:07PM +0200, Alexander Graf wrote:
> On 14.05.19 16:06, Leif Lindholm wrote:
> > On Tue, May 14, 2019 at 06:32:06AM -0700, Alexander Graf wrote:
> >>> But, wait...
> >>> arm-linux-gnueabi is the softfloat (v5te) toolchain - if we want to
> >>> test that, fine - but we definitely need to test arm-linux-gnueabihf.
> >>>
> >>> First of all, I would expect that this toolchain will not use T32
> >>> (Thumb-2) instructions by default, so much of the code will end up
> >>> being compiled as A32 anyway.
> >>
> >> Yeah, that's why we don't need to pass in -marm I guess. But I also
> >> don't see an explicit hardfloat cross gcc on kernel.org?
> >>
> >>   https://mirrors.kernel.org/pub/tools/crosstool/files/bin/x86_64/8.1.0/
> > Urgh.
> > Yeah, so the default output of that toolchain gives
> >   File Attributes
> >   Tag_CPU_name: "5T"
> >   Tag_CPU_arch: v5T
> >   Tag_ARM_ISA_use: Yes
> >   Tag_THUMB_ISA_use: Thumb-1
> >
> > In theory, you should be OK just adding
> > "-mfloat-abi=hard -march=armv7-a+vfpv3-d16" to CFLAGS, since we're not
> > using any toolchain-provided libraries:
> 
> In configure we're already forcing soft float, so there's little point
> in adding these cflags :). In fact, when I do add them, I only get
> configure errors because setting both -mhard-float and -msoft-float at
> the same time confuses gcc.

OK, that bit is less of an issue then.
We only need -march=armv7-a.

/
    Leif


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2019-05-29 15:47 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-02  6:55 [PATCH v2 0/8] Travis fixes Alexander Graf
2019-05-02  6:55 ` [PATCH v2 1/8] travis: Run bootstrap instead of autogen.sh Alexander Graf
2019-05-10 11:03   ` Daniel Kiper
2019-05-14 13:17     ` Alexander Graf
2019-05-14 14:14       ` Daniel Kiper
2019-05-02  6:55 ` [PATCH v2 2/8] travis: Fix sparc64 test Alexander Graf
2019-05-02  6:55 ` [PATCH v2 3/8] travis: Fix mips QEMU target Alexander Graf
2019-05-02  6:55 ` [PATCH v2 4/8] travis: Fix arm coreboot test and make loop more robus Alexander Graf
2019-05-02  6:55 ` [PATCH v2 5/8] arm coreboot: Use common directory path Alexander Graf
2019-05-02  6:55 ` [PATCH v2 6/8] travis: Add smoke tests for arm and aarch64 Alexander Graf
2019-05-14  9:37   ` Leif Lindholm
2019-05-02  6:55 ` [PATCH v2 7/8] travis: Add ARM thumb target to tests Alexander Graf
2019-05-14 10:05   ` Leif Lindholm
2019-05-14 13:32     ` Alexander Graf
2019-05-14 14:06       ` Leif Lindholm
2019-05-29 15:41         ` Alexander Graf
2019-05-29 15:47           ` Leif Lindholm
2019-05-02  6:55 ` [PATCH v2 8/8] travis: Test module loading from tftp as well Alexander Graf
2019-05-10 11:24   ` Daniel Kiper
2019-05-14 13:18     ` Alexander Graf
2019-05-14 14:15       ` Daniel Kiper
2019-05-10 11:25 ` [PATCH v2 0/8] Travis fixes Daniel Kiper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.