1. 19 9月, 2019 5 次提交
  2. 17 9月, 2019 8 次提交
    • P
      target/sparc: Switch to do_transaction_failed() hook · f8c3db33
      Peter Maydell 提交于
      Switch the SPARC target from the old unassigned_access hook to the
      new do_transaction_failed hook.
      
      This will cause the "if transaction failed" code paths added in
      the previous commits to become active if the access is to an
      unassigned address. In particular we'll now handle bus errors
      during page table walks correctly (generating a translation
      error with the right kind of fault status).
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Tested-by: NMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Message-id: 20190801183012.17564-8-peter.maydell@linaro.org
      f8c3db33
    • P
      target/sparc: Remove unused ldl_phys from dump_mmu() · 9dffeec2
      Peter Maydell 提交于
      The dump_mmu() function does a ldl_phys() at the start, but
      then never uses the value it loads at all. Remove the
      unused code.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Tested-by: NMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Message-id: 20190801183012.17564-7-peter.maydell@linaro.org
      9dffeec2
    • P
      target/sparc: Handle bus errors in mmu_probe() · d86a9ad3
      Peter Maydell 提交于
      Convert the mmu_probe() function to using address_space_ldl()
      rather than ldl_phys(), so we can explicitly detect memory
      transaction failures.
      
      This makes no practical difference at the moment, because
      ldl_phys() will return 0 on a transaction failure, and we
      treat transaction failures and 0 PDEs identically. However
      the spec says that MMU probe operations are supposed to
      update the fault status registers, and if we ever implement
      that we'll want to distinguish the difference. For the
      moment, just add a TODO comment about the bug.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Tested-by: NMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Message-id: 20190801183012.17564-6-peter.maydell@linaro.org
      d86a9ad3
    • P
      target/sparc: Correctly handle bus errors in page table walks · 3c818dfc
      Peter Maydell 提交于
      Currently we use the ldl_phys() function to read page table entries.
      With the unassigned_access hook in place, if these hit an unassigned
      area of memory then the hook will cause us to wrongly generate
      an exception with a fault address matching the address of the
      page table entry.
      
      Change to using address_space_ldl() so we can detect and correctly
      handle bus errors and give them their correct behaviour of
      causing a translation error with a suitable fault status register.
      
      Note that this won't actually take effect until we switch the
      over to using the do_translation_failed hook.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Tested-by: NMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Message-id: 20190801183012.17564-5-peter.maydell@linaro.org
      3c818dfc
    • P
      target/sparc: Check for transaction failures in MXCC stream ASI accesses · 776095d3
      Peter Maydell 提交于
      Currently the ld/st_asi helper functions make calls to the
      ld*_phys() and st*_phys() functions for those ASIs which
      imply direct accesses to physical addresses. These implicitly
      rely on the unassigned_access hook to cause them to generate
      an MMU fault if the access fails.
      
      Switch to using the address_space_* functions instead, which
      return a MemTxResult that we can check. This means that when
      we switch SPARC over to using the do_transaction_failed hook
      we'll still get the same MMU faults we did before.
      
      This commit converts the ASIs which do MXCC stream source
      and destination accesses.
      
      It's not clear to me whether raising an MMU fault like this
      is the correct behaviour if we encounter a bus error, but
      we retain the same behaviour that the old unassigned_access
      hook would implement.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Tested-by: NMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Message-id: 20190801183012.17564-4-peter.maydell@linaro.org
      776095d3
    • P
      target/sparc: Check for transaction failures in MMU passthrough ASIs · b9f5fdad
      Peter Maydell 提交于
      Currently the ld/st_asi helper functions make calls to the
      ld*_phys() and st*_phys() functions for those ASIs which
      imply direct accesses to physical addresses. These implicitly
      rely on the unassigned_access hook to cause them to generate
      an MMU fault if the access fails.
      
      Switch to using the address_space_* functions instead, which
      return a MemTxResult that we can check. This means that when
      we switch SPARC over to using the do_transaction_failed hook
      we'll still get the same MMU faults we did before.
      
      This commit converts the ASIs which do "MMU passthrough".
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Tested-by: NMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Message-id: 20190801183012.17564-3-peter.maydell@linaro.org
      b9f5fdad
    • P
      target/sparc: Factor out the body of sparc_cpu_unassigned_access() · c9d793f4
      Peter Maydell 提交于
      Currently the SPARC target uses the old-style do_unassigned_access
      hook.  We want to switch it over to do_transaction_failed, but to do
      this we must first remove all the direct calls in ldst_helper.c to
      cpu_unassigned_access().  Factor out the body of the hook function's
      code into a new sparc_raise_mmu_fault() and call it from the hook and
      from the various places that used to call cpu_unassigned_access().
      
      In passing, this fixes a bug where the code that raised the
      MMU exception was directly calling GETPC() from a function that
      was several levels deep in the callstack from the original
      helper function: the new sparc_raise_mmu_fault() instead takes
      the return address as an argument.
      
      Other than the use of retaddr rather than GETPC() and a comment
      format fixup, the body of the new function has no changes from
      that of the old hook function.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Tested-by: NMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Message-id: 20190801183012.17564-2-peter.maydell@linaro.org
      c9d793f4
    • P
      Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging · 186c0ab9
      Peter Maydell 提交于
      * Fix Patchew CI failures (myself)
      * i386 fw_cfg refactoring (Philippe)
      * pmem bugfix (Stefan)
      * Support for accessing cstate MSRs (Wanpeng)
      * exec.c cleanups (Wei Yang)
      * Improved throttling (Yury)
      * elf-ops.h coverity fix (Stefano)
      
      # gpg: Signature made Mon 16 Sep 2019 16:13:12 BST
      # gpg:                using RSA key BFFBD25F78C7AE83
      # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
      # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
      # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
      #      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83
      
      * remotes/bonzini/tags/for-upstream: (29 commits)
        hw/i386/pc: Extract the x86 generic fw_cfg code
        hw/i386/pc: Rename pc_build_feature_control() as generic fw_cfg_build_*
        hw/i386/pc: Let pc_build_feature_control() take a MachineState argument
        hw/i386/pc: Let pc_build_feature_control() take a FWCfgState argument
        hw/i386/pc: Rename pc_build_smbios() as generic fw_cfg_build_smbios()
        hw/i386/pc: Let pc_build_smbios() take a generic MachineState argument
        hw/i386/pc: Let pc_build_smbios() take a FWCfgState argument
        hw/i386/pc: Replace PCMachineState argument with MachineState in fw_cfg_arch_create
        hw/i386/pc: Pass the CPUArchIdList array by argument
        hw/i386/pc: Pass the apic_id_limit value by argument
        hw/i386/pc: Pass the boot_cpus value by argument
        hw/i386/pc: Rename bochs_bios_init as more generic fw_cfg_arch_create
        hw/i386/pc: Use address_space_memory in place
        hw/i386/pc: Extract e820 memory layout code
        hw/i386/pc: Use e820_get_num_entries() to access e820_entries
        cpus: Fix throttling during vm_stop
        qemu-thread: Add qemu_cond_timedwait
        memory: inline and optimize devend_memop
        memory: fetch pmem size in get_file_size()
        elf-ops.h: fix int overflow in load_elf()
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      186c0ab9
  3. 16 9月, 2019 27 次提交