qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 46b21d: hw/loongarch: Fix loongarch fdt addr


From: Paolo Bonzini
Subject: [Qemu-commits] [qemu/qemu] 46b21d: hw/loongarch: Fix loongarch fdt addr confict
Date: Sun, 13 Nov 2022 03:30:21 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 46b21de238c643ea098f2dcffe493abd135f7d89
      
https://github.com/qemu/qemu/commit/46b21de238c643ea098f2dcffe493abd135f7d89
  Author: Song Gao <gaosong@loongson.cn>
  Date:   2022-11-12 (Sat, 12 Nov 2022)

  Changed paths:
    M hw/loongarch/virt.c

  Log Message:
  -----------
  hw/loongarch: Fix loongarch fdt addr confict

Fix LoongArch check-tcg error:
   TEST    hello on loongarch64
qemu-system-loongarch64: Some ROM regions are overlapping
These ROM regions might have been loaded by direct user request or by default.
They could be BIOS/firmware images, a guest kernel, initrd or some other file 
loaded into guest memory.
Check whether you intended to load all this guest code, and whether it has been 
built to load to the correct addresses.

The following two regions overlap (in the memory address space):
   hello ELF program header segment 0 (addresses 0x0000000000200000 - 
0x0000000000242000)
   fdt (addresses 0x0000000000200000 - 0x0000000000300000)
make[1]: *** [Makefile:177: run-hello] Error 1

Fixes: 021836936ef ("hw/loongarch: Load FDT table into dram memory space")
Reported-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20221109020449.978064-1-gaosong@loongson.cn>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 57bc6e40e82c0446a358ab01f9bbf0db0d9465e4
      
https://github.com/qemu/qemu/commit/57bc6e40e82c0446a358ab01f9bbf0db0d9465e4
  Author: Philippe Mathieu-Daudé <f4bug@amsat.org>
  Date:   2022-11-12 (Sat, 12 Nov 2022)

  Changed paths:
    M subprojects/libvduse/libvduse.c

  Log Message:
  -----------
  libvduse: Avoid warning about dangerous use of strncpy()

GCC 8 added a -Wstringop-truncation warning:

  The -Wstringop-truncation warning added in GCC 8.0 via r254630 for
  bug 81117 is specifically intended to highlight likely unintended
  uses of the strncpy function that truncate the terminating NUL
  character from the source string.

Here the next line indeed unconditionally zeroes the last byte, but
1/ the buffer has been calloc'd, so we don't need to add an extra
byte, and 2/ we called vduse_name_is_invalid() which checked the
string length, so we can simply call strcpy().

This fixes when using gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0:

  [42/666] Compiling C object subprojects/libvduse/libvduse.a.p/libvduse.c.o
  FAILED: subprojects/libvduse/libvduse.a.p/libvduse.c.o
  cc -m64 -mcx16 -Isubprojects/libvduse/libvduse.a.p -Isubprojects/libvduse 
-I../../subprojects/libvduse [...] -o 
subprojects/libvduse/libvduse.a.p/libvduse.c.o -c 
../../subprojects/libvduse/libvduse.c
  In file included from /usr/include/string.h:495,
                   from ../../subprojects/libvduse/libvduse.c:24:
  In function ‘strncpy’,
      inlined from ‘vduse_dev_create’ at 
../../subprojects/libvduse/libvduse.c:1312:5:
  /usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: 
‘__builtin_strncpy’ specified bound 256 equals destination size 
[-Werror=stringop-truncation]
    106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos 
(__dest));
        |          
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cc1: all warnings being treated as errors
  ninja: build stopped: cannot make progress due to previous errors.

Fixes: d9cf16c0be ("libvduse: Replace strcpy() with strncpy()")
Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Xie Yongji <xieyongji@bytedance.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Bin Meng <bmeng@tinylab.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20221111124550.35753-1-philmd@linaro.org>


  Commit: 305f6f62d9d250a32cdf090ddcb7e3a5b26a342e
      
https://github.com/qemu/qemu/commit/305f6f62d9d250a32cdf090ddcb7e3a5b26a342e
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2022-11-12 (Sat, 12 Nov 2022)

  Changed paths:
    M hw/loongarch/virt.c

  Log Message:
  -----------
  Merge tag 'pull-la-20221112' of https://gitlab.com/rth7680/qemu into staging

Fix loongarch make check-tcg failure.

# -----BEGIN PGP SIGNATURE-----
#
# iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmNu8aUdHHJpY2hhcmQu
# aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV90jAgAsaB0nU7YGzJRYRmK
# +QXtrQa5AmXf014X7OeOZyxdYCPCwri2rnCxc1eOKAIOeSbdFY54xjXXEV8qpej+
# ZiLbdvXFG519vJpZquEJm1wgk68NnKYy2wfeRuwBMcQD4E7yeE9y11IKtuN6vbcq
# sh/Zxh43KwzyZ1wrVQl8DUxesTcE4RwVDJ+t2q+uYKcgmUVRQJJd9aXLkOKpOb1f
# QU+6lJAGv293IbW5LUD8fIPNKVWqlVwDIsFVWhYYJFxvWfbL211NsJbX70RnKahr
# vJ6olGORlShNJEiV++9QTrgGr1v76KkVECaKNtohkYL/BkfNxoy4yWxcC7I9zds+
# 6oH9vQ==
# =7NI1
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 11 Nov 2022 20:06:45 EST
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" 
[full]
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* tag 'pull-la-20221112' of https://gitlab.com/rth7680/qemu:
  hw/loongarch: Fix loongarch fdt addr confict

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


Compare: https://github.com/qemu/qemu/compare/6a4cff8e1a80...305f6f62d9d2



reply via email to

[Prev in Thread] Current Thread [Next in Thread]