1. 22 8月, 2017 3 次提交
    • G
      ppc: fix ppc_set_compat() with KVM PR · 5dfaa532
      Greg Kurz 提交于
      When running in KVM PR mode, kvmppc_set_compat() always fail because the
      current PR implementation doesn't handle KVM_REG_PPC_ARCH_COMPAT. Now that
      the machine code inconditionally calls ppc_set_compat_all() at reset time
      to restore the compat mode default value (commit 66d5c492), it is
      impossible to start a guest with PR:
      
      qemu-system-ppc64: Unable to set CPU compatibility mode in KVM:
       Invalid argument
      
      A tentative patch [1] was recently sent by Suraj to address the issue, but
      it would prevent the compat mode to be turned off on reset. And we really
      don't want to explicitely check for KVM PR. During the patch's review,
      David suggested that we should only call the KVM ioctl() if the compat
      PVR changes. This allows at least to run with KVM PR, provided no compat
      mode is requested from the command line (which should be the case when
      running PR nested). This is what this patch does.
      
      While here, we also fix the side effect where KVM would fail but we would
      change the CPU state in QEMU anyway.
      
      [1] http://patchwork.ozlabs.org/patch/782039/Signed-off-by: NGreg Kurz <groug@kaod.org>
      Reviewed-by: NSuraj Jitindar Singh <sjitindarsingh@gmail.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      5dfaa532
    • D
      target/ppc: 'PVR != host PVR' in KVM_SET_SREGS workaround · c363a37a
      Daniel Henrique Barboza 提交于
      Commit d5fc133e ("ppc: Rework CPU compatibility testing
      across migration") changed the way cpu_post_load behaves with
      the PVR setting, causing an unexpected bug in KVM-HV migrations
      between hosts that are compatible (POWER8 and POWER8E, for example).
      Even with pvr_match() returning true, the guest freezes right after
      cpu_post_load. The reason is that the guest kernel can't handle a
      different PVR value other that the running host in KVM_SET_SREGS.
      
      In [1] it was discussed the possibility of a new KVM capability
      that would indicate that the guest kernel can handle a different
      PVR in KVM_SET_SREGS. Even if such feature is implemented, there is
      still the problem with older kernels that will not have this capability
      and will fail to migrate.
      
      This patch implements a workaround for that scenario. If running
      with KVM, check if the guest kernel does not have the capability
      (named here as 'cap_ppc_pvr_compat'). If it doesn't, calls
      kvmppc_is_pr() to see if the guest is running in KVM-HV. If all this
      happens, set env->spr[SPR_PVR] to the same value as the current
      host PVR. This ensures that we allow migrations with 'close enough'
      PVRs to still work in KVM-HV but also makes the code ready for
      this new KVM capability when it is done.
      
      A new function called 'kvmppc_pvr_workaround_required' was created
      to encapsulate the conditions said above and to avoid calling too
      many kvm.c internals inside cpu_post_load.
      
      [1] https://lists.gnu.org/archive/html/qemu-ppc/2017-06/msg00503.htmlSigned-off-by: NDaniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
      [dwg: Fix for the case of using TCG on a PPC host]
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      c363a37a
    • C
      boot-serial-test: prefer tcg accelerator · b96919d7
      Cornelia Huck 提交于
      Prefer to use the tcg accelarator if it is available: This is our only
      real smoke test for tcg, and fast enough to use it for that.
      
      Fixes: 480bc11e ("boot-serial-test: fallback to kvm accelerator")
      Reported-by: NRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: NCornelia Huck <cohuck@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      b96919d7
  2. 16 8月, 2017 5 次提交
  3. 15 8月, 2017 20 次提交
  4. 14 8月, 2017 12 次提交