Skip to content
Snippets Groups Projects
  1. Apr 06, 2022
  2. Apr 04, 2022
    • Frederic Barrat's avatar
      ppc/pnv: Fix number of registers in the PCIe controller on POWER9 · 7e515769
      Frederic Barrat authored
      
      The spec defines 3 registers, even though only index 0 and 2 are valid
      on POWER9. The same model is used on POWER10. Register 1 is defined
      there but we currently don't use it in skiboot. So we can keep
      reporting an error on write.
      
      Reported by Coverity (CID 1487176).
      
      Fixes: 4f9924c4 ("ppc/pnv: Add models for POWER9 PHB4 PCIe Host bridge")
      Suggested-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarFrederic Barrat <fbarrat@linux.ibm.com>
      Reviewed-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
      Message-Id: <20220401091925.770803-1-fbarrat@linux.ibm.com>
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      7e515769
    • Daniel Henrique Barboza's avatar
      hw/ppc: free env->tb_env in spapr_unrealize_vcpu() · ef95a244
      Daniel Henrique Barboza authored
      
      The timebase is allocated during spapr_realize_vcpu() and it's not
      freed. This results in memory leaks when doing vcpu unplugs:
      
      ==636935==
      ==636935== 144 (96 direct, 48 indirect) bytes in 1 blocks are definitely lost in loss record 6
      ,461 of 8,135
      ==636935==    at 0x4897468: calloc (vg_replace_malloc.c:760)
      ==636935==    by 0x5077213: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.6400.4)
      ==636935==    by 0x507757F: g_malloc0_n (in /usr/lib64/libglib-2.0.so.0.6400.4)
      ==636935==    by 0x93C3FB: cpu_ppc_tb_init (ppc.c:1066)
      ==636935==    by 0x97BC2B: spapr_realize_vcpu (spapr_cpu_core.c:268)
      ==636935==    by 0x97C01F: spapr_cpu_core_realize (spapr_cpu_core.c:337)
      ==636935==    by 0xD4626F: device_set_realized (qdev.c:531)
      ==636935==    by 0xD55273: property_set_bool (object.c:2273)
      ==636935==    by 0xD523DF: object_property_set (object.c:1408)
      ==636935==    by 0xD588B7: object_property_set_qobject (qom-qobject.c:28)
      ==636935==    by 0xD52897: object_property_set_bool (object.c:1477)
      ==636935==    by 0xD4579B: qdev_realize (qdev.c:333)
      ==636935==
      
      This patch adds a cpu_ppc_tb_free() helper in hw/ppc/ppc.c to allow us
      to free the timebase. This leak is then solved by calling
      cpu_ppc_tb_free() in spapr_unrealize_vcpu().
      
      Fixes: 6f4b5c3e ("spapr: CPU hot unplug support")
      Signed-off-by: default avatarDaniel Henrique Barboza <danielhb413@gmail.com>
      Reviewed-by: default avatarCédric Le Goater <clg@kaod.org>
      Reviewed-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Message-Id: <20220329124545.529145-2-danielhb413@gmail.com>
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      ef95a244
  3. Mar 29, 2022
  4. Mar 28, 2022
    • Philippe Mathieu-Daudé's avatar
      main-loop: Disable block backend global state assertion on Cocoa · 47281859
      Philippe Mathieu-Daudé authored
      
      Since commit 0439c5a4 ("block/block-backend.c: assertions for
      block-backend") QEMU crashes when using Cocoa on Darwin hosts.
      
      Example on macOS:
      
        $ qemu-system-i386
        Assertion failed: (qemu_in_main_thread()), function blk_all_next, file block-backend.c, line 552.
        Abort trap: 6
      
      Looking with lldb:
      
        Assertion failed: (qemu_in_main_thread()), function blk_all_next, file block-backend.c, line 552.
        Process 76914 stopped
        * thread #1, queue = 'com.apple.main-thread', stop reason = hit program assert
           frame #4: 0x000000010057c2d4 qemu-system-i386`blk_all_next.cold.1
        at block-backend.c:552:5 [opt]
            549    */
            550   BlockBackend *blk_all_next(BlockBackend *blk)
            551   {
        --> 552       GLOBAL_STATE_CODE();
            553       return blk ? QTAILQ_NEXT(blk, link)
            554                  : QTAILQ_FIRST(&block_backends);
            555   }
        Target 1: (qemu-system-i386) stopped.
      
        (lldb) bt
        * thread #1, queue = 'com.apple.main-thread', stop reason = hit program assert
           frame #0: 0x00000001908c99b8 libsystem_kernel.dylib`__pthread_kill + 8
           frame #1: 0x00000001908fceb0 libsystem_pthread.dylib`pthread_kill + 288
           frame #2: 0x000000019083a314 libsystem_c.dylib`abort + 164
           frame #3: 0x000000019083972c libsystem_c.dylib`__assert_rtn + 300
         * frame #4: 0x000000010057c2d4 qemu-system-i386`blk_all_next.cold.1 at block-backend.c:552:5 [opt]
           frame #5: 0x00000001003c00b4 qemu-system-i386`blk_all_next(blk=<unavailable>) at block-backend.c:552:5 [opt]
           frame #6: 0x00000001003d8f04 qemu-system-i386`qmp_query_block(errp=0x0000000000000000) at qapi.c:591:16 [opt]
           frame #7: 0x000000010003ab0c qemu-system-i386`main [inlined] addRemovableDevicesMenuItems at cocoa.m:1756:21 [opt]
           frame #8: 0x000000010003ab04 qemu-system-i386`main(argc=<unavailable>, argv=<unavailable>) at cocoa.m:1980:5 [opt]
           frame #9: 0x00000001012690f4 dyld`start + 520
      
      As we are in passed release 7.0 hard freeze, disable the block
      backend assertion which, while being valuable during development,
      is not helpful to users. We'll restore this assertion immediately
      once 7.0 is released and work on a fix.
      
      Suggested-by: default avatarAkihiko Odaki <akihiko.odaki@gmail.com>
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: default avatarAkihiko Odaki <akihiko.odaki@gmail.com>
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-Id: <20220325183707.85733-1-philippe.mathieu.daude@gmail.com>
      47281859
  5. Mar 22, 2022
Loading