1. 29 1月, 2018 1 次提交
  2. 25 1月, 2018 1 次提交
    • L
      accel/tcg: add size paremeter in tlb_fill() · 98670d47
      Laurent Vivier 提交于
      The MC68040 MMU provides the size of the access that
      triggers the page fault.
      
      This size is set in the Special Status Word which
      is written in the stack frame of the access fault
      exception.
      
      So we need the size in m68k_cpu_unassigned_access() and
      m68k_cpu_handle_mmu_fault().
      
      To be able to do that, this patch modifies the prototype of
      handle_mmu_fault handler, tlb_fill() and probe_write().
      do_unassigned_access() already includes a size parameter.
      
      This patch also updates handle_mmu_fault handlers and
      tlb_fill() of all targets (only parameter, no code change).
      Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
      Reviewed-by: NDavid Hildenbrand <david@redhat.com>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Message-Id: <20180118193846.24953-2-laurent@vivier.eu>
      98670d47
  3. 20 1月, 2018 4 次提交
  4. 17 1月, 2018 6 次提交
  5. 10 1月, 2018 1 次提交
  6. 30 12月, 2017 1 次提交
  7. 18 12月, 2017 1 次提交
  8. 15 12月, 2017 4 次提交
  9. 05 12月, 2017 1 次提交
    • R
      target/ppc: Fix system lockups caused by interrupt_request state corruption · 044897ef
      Richard Purdie 提交于
      Occasionally in Linux guests on x86_64 we're seeing logs like:
      
      ppc_set_irq: 0x55b4e0d562f0 n_IRQ 8 level 1 => pending 00000100req 00000004
      
      when they should read:
      
      ppc_set_irq: 0x55b4e0d562f0 n_IRQ 8 level 1 => pending 00000100req 00000002
      
      The "00000004" is CPU_INTERRUPT_EXITTB yet the code calls
      cpu_interrupt(cs, CPU_INTERRUPT_HARD) ("00000002") in this function
      just before the log message. Something is causing the HARD bit setting
      to get lost.
      
      The knock on effect of losing that bit is the decrementer timer interrupts
      don't get delivered which causes the guest to sit idle in its idle handler
      and 'hang'.
      
      The issue occurs due to races from code which sets CPU_INTERRUPT_EXITTB.
      
      Rather than poking directly into cs->interrupt_request, that code needs to:
      
      a) hold BQL
      b) use the cpu_interrupt() helper
      
      This patch fixes the call sites to do this, fixing the hang. The calls
      are made from a variety of contexts so a helper function is added to handle
      the necessary locking. This can likely be improved and optimised in the future
      but it ensures the code is correct and doesn't lockup as it stands today.
      Signed-off-by: NRichard Purdie <richard.purdie@linuxfoundation.org>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      044897ef
  10. 30 11月, 2017 1 次提交
  11. 27 11月, 2017 1 次提交
    • S
      target/ppc: Fix setting of cpu->compat_pvr on incoming migration · e07cc192
      Suraj Jitindar Singh 提交于
      cpu->compat_pvr is used to store the current compat mode of the cpu.
      
      On the receiving side during incoming migration we check compatibility
      with the compat mode by calling ppc_set_compat(). However we fail to set
      the compat mode with the hypervisor since the "new" compat mode doesn't
      differ from the current (due to a "cpu->compat_pvr != compat_pvr" check).
      This means that kvm runs the vcpus without a compat mode, which is the
      incorrect behaviour. The implication being that a compatibility mode
      will never be in effect after migration.
      
      To fix this so that the compat mode is correctly set with the
      hypervisor, store the desired compat mode and reset cpu->compat_pvr to
      zero before calling ppc_set_compat().
      
      Fixes: 5dfaa532 ("ppc: fix ppc_set_compat() with KVM PR")
      Signed-off-by: NSuraj Jitindar Singh <sjitindarsingh@gmail.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      e07cc192
  12. 22 11月, 2017 1 次提交
    • L
      ppc: fix VTB migration · 6dd836f5
      Laurent Vivier 提交于
      Migration of a system under stress (for example, with
      "stress-ng --numa 2") triggers on the destination
      some kernel watchdog messages like:
      
      NMI watchdog: BUG: soft lockup - CPU#0 stuck for 3489660870s!
      NMI watchdog: BUG: soft lockup - CPU#1 stuck for 3489660884s!
      
      This problem appears with the changes introduced by
          42043e4f spapr: clock should count only if vm is running
      
      I think this commit only triggers the problem.
      
      Kernel computes the soft lockup duration using the
      Virtual Timebase register (VTB), not using the Timebase
      Register (TBR, the one 42043e4f stops).
      
      It appears VTB is not migrated, so this patch adds it in
      the list of the SPRs to migrate, and fixes the problem.
      
      For the migration, I've tested a migration from qemu-2.8.0 and
      pseries-2.8.0 to a patched master (qemu-2.11.0-rc1). The received
      VTB is 0 (as is it not initialized by qemu-2.8.0), but the value
      seems to be ignored by KVM and a non zero VTB is used by the kernel.
      I have no explanation for that, but as the original problem appears
      only with SMP system under stress I suspect some problems in KVM
      (I think because VTB is shared by all threads of a core).
      Signed-off-by: NLaurent Vivier <lvivier@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      6dd836f5
  13. 08 11月, 2017 1 次提交
    • G
      ppc: fix setting of compat mode · e4f0c6bb
      Greg Kurz 提交于
      While trying to make KVM PR usable again, commit 5dfaa532ae introduced a
      regression: the current compat_pvr value is passed to KVM instead of the
      new one. This means that we always pass 0 instead of the max-cpu-compat
      PVR during the initial machine reset. And at CAS time, we either pass
      the PVR from the command line or even don't call kvmppc_set_compat() at
      all, ie, the PCR will not be set as expected.
      
      For example if we start a big endian fedora26 guest in power7 compat
      mode on a POWER8 host, we get this in the guest:
      
      $ cat /proc/cpuinfo
      processor       : 0
      cpu             : POWER7 (architected), altivec supported
      clock           : 4024.000000MHz
      revision        : 2.0 (pvr 004d 0200)
      
      timebase        : 512000000
      platform        : pSeries
      model           : IBM pSeries (emulated by qemu)
      machine         : CHRP IBM pSeries (emulated by qemu)
      MMU             : Hash
      
      but the guest can still execute POWER8 instructions, and the following
      program succeeds:
      
      int main()
      {
              asm("vncipher 0,0,0"); // ISA 2.07 instruction
      }
      
      Let's pass the new compat_pvr to kvmppc_set_compat() and the program fails
      with SIGILL as expected.
      Reported-by: NNageswara R Sastry <rnsastry@linux.vnet.ibm.com>
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      e4f0c6bb
  14. 27 10月, 2017 1 次提交
  15. 25 10月, 2017 8 次提交
  16. 17 10月, 2017 7 次提交