1. 25 9月, 2018 6 次提交
  2. 05 9月, 2018 1 次提交
  3. 03 9月, 2018 1 次提交
    • J
      Fix a deadlock case in the CPU hotplug flow · b12a4efb
      Jose Ricardo Ziviani 提交于
      We need to set cs->halted to 1 before calling ppc_set_compat. The reason
      is that ppc_set_compat kicks up the new thread created to manage the
      hotplugged KVM virtual CPU and the code drives directly to KVM_RUN
      ioctl. When cs->halted is 1, the code:
      
      int kvm_cpu_exec(CPUState *cpu)
      ...
           if (kvm_arch_process_async_events(cpu)) {
               atomic_set(&cpu->exit_request, 0);
               return EXCP_HLT;
           }
      ...
      
      returns before it reaches KVM_RUN, giving time to the main thread to
      finish its job. Otherwise we can fall in a deadlock because the KVM
      thread will issue the KVM_RUN ioctl while the main thread is setting up
      KVM registers. Depending on how these jobs are scheduled we'll end up
      freezing QEMU.
      
      The following output shows kvm_vcpu_ioctl sleeping because it cannot get
      the mutex and never will.
      PS: kvm_vcpu_ioctl was triggered kvm_set_one_reg - compat_pvr.
      
      STATE: TASK_UNINTERRUPTIBLE|TASK_WAKEKILL
      
      PID: 61564  TASK: c000003e981e0780  CPU: 48  COMMAND: "qemu-system-ppc"
       #0 [c000003e982679a0] __schedule at c000000000b10a44
       #1 [c000003e98267a60] schedule at c000000000b113a8
       #2 [c000003e98267a90] schedule_preempt_disabled at c000000000b11910
       #3 [c000003e98267ab0] __mutex_lock at c000000000b132ec
       #4 [c000003e98267bc0] kvm_vcpu_ioctl at c00800000ea03140 [kvm]
       #5 [c000003e98267d20] do_vfs_ioctl at c000000000407d30
       #6 [c000003e98267dc0] ksys_ioctl at c000000000408674
       #7 [c000003e98267e10] sys_ioctl at c0000000004086f8
       #8 [c000003e98267e30] system_call at c00000000000b488
      
      crash> struct -x kvm.vcpus 0xc000003da0000000
      vcpus = {0xc000003db4880000, 0xc000003d52b80000, 0xc0000039e9c80000, 0xc000003d0e200000, 0xc000003d58280000, 0x0, 0x0, ...}
      
      crash> struct -x kvm_vcpu.mutex.owner 0xc000003d58280000
        mutex.owner = {
          counter = 0xc000003a23a5c881 <- flag 1: waiters
        },
      
      crash> bt 0xc000003a23a5c880
      PID: 61579  TASK: c000003a23a5c880  CPU: 9   COMMAND: "CPU 4/KVM"
      (active)
      
      crash> struct -x kvm_vcpu.mutex.wait_list 0xc000003d58280000
        mutex.wait_list = {
          next = 0xc000003e98267b10,
          prev = 0xc000003e98267b10
        },
      
      crash> struct -x mutex_waiter.task 0xc000003e98267b10
        task = 0xc000003e981e0780
      
      The following command-line was used to reproduce the problem (note: gdb
      and trace can change the results).
      
       $ qemu-ppc/build/ppc64-softmmu/qemu-system-ppc64 -cpu host \
           -enable-kvm -m 4096 \
           -smp 4,maxcpus=8,sockets=1,cores=2,threads=4 \
           -display none -nographic \
           -drive file=disk1.qcow2,format=qcow2
       ...
       (qemu) device_add host-spapr-cpu-core,core-id=4
      [no interaction is possible after it, only SIGKILL to take the terminal
      back]
      Signed-off-by: NJose Ricardo Ziviani <joserz@linux.ibm.com>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      b12a4efb
  4. 30 8月, 2018 6 次提交
  5. 29 8月, 2018 1 次提交
  6. 28 8月, 2018 3 次提交
  7. 24 8月, 2018 3 次提交
  8. 23 8月, 2018 1 次提交
    • T
      hw/timer/mc146818rtc: Fix introspection problem · 29551fdc
      Thomas Huth 提交于
      There is currently a funny problem with the "mc146818rtc" device:
      1) Start QEMU like this:
         qemu-system-ppc64 -M pseries -S
      2) At the HMP monitor, enter "info qom-tree". Note that there is an
         entry for "/rtc (spapr-rtc)".
      3) Introspect the mc146818rtc device like this:
         device_add mc146818rtc,help
      4) Run "info qom-tree" again. The "/rtc" entry is gone now!
      
      The rtc_finalize() function of the mc146818rtc device has two bugs: First,
      it tries to remove a "rtc" property, while the rtc_realizefn() added a
      "rtc-time" property instead. And second, it should have been done in an
      unrealize function, not in a finalize function, to avoid that this causes
      problems during introspection.
      
      But since adding aliases to the global machine state should not be done
      from a device's realize function anyway, let's rather fix this issue
      by moving the creation of the alias to the code that creates the device
      (and thus is run from the machine init functions instead), i.e. the
      mc146818_rtc_init() function for most machines. The prep machines are
      special, since the mc146818rtc device is created here in the realize
      function of the i82378 device. Since we certainly don't want to add the
      alias there, we add it to some code that is called from the ibm_40p_init()
      machine init function instead.
      Since the alias is now only created during the machine init, we can remove
      the object_property_del() completely.
      
      Fixes: 654a36d8Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Message-Id: <1534419358-10932-5-git-send-email-thuth@redhat.com>
      Reviewed-by: NJuan Quintela <quintela@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      29551fdc
  9. 21 8月, 2018 12 次提交
  10. 17 8月, 2018 1 次提交
  11. 01 8月, 2018 1 次提交
  12. 16 7月, 2018 2 次提交
  13. 09 7月, 2018 2 次提交