1. 09 2月, 2018 4 次提交
    • P
      target/arm: Add ignore_stackfaults argument to v7m_exception_taken() · 0094ca70
      Peter Maydell 提交于
      In the v8M architecture, if the process of taking an exception
      results in a further exception this is called a derived exception
      (for example, an MPU exception when writing the exception frame to
      memory). If the derived exception happens while pushing the initial
      stack frame, we must ignore any subsequent possible exception
      pushing the callee-saves registers.
      
      In preparation for making the stack writes check for exceptions,
      add a return value from v7m_push_stack() and a new parameter to
      v7m_exception_taken(), so that the former can tell the latter that
      it needs to ignore failures to write to the stack. We also plumb
      the argument through to v7m_push_callee_stack(), which is where
      the code to ignore the failures will be.
      
      (Note that the v8M ARM pseudocode structures this slightly differently:
      derived exceptions cause the attempt to process the original
      exception to be abandoned; then at the top level it calls
      DerivedLateArrival to prioritize the derived exception and call
      TakeException from there. We choose to let the NVIC do the prioritization
      and continue forward with a call to TakeException which will then
      take either the original or the derived exception. The effect is
      the same, but this structure works better for QEMU because we don't
      have a convenient top level place to do the abandon-and-retry logic.)
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Message-id: 1517324542-6607-4-git-send-email-peter.maydell@linaro.org
      0094ca70
    • P
      target/arm: Split "get pending exception info" from "acknowledge it" · 6c948518
      Peter Maydell 提交于
      Currently armv7m_nvic_acknowledge_irq() does three things:
       * make the current highest priority pending interrupt active
       * return a bool indicating whether that interrupt is targeting
         Secure or NonSecure state
       * implicitly tell the caller which is the highest priority
         pending interrupt by setting env->v7m.exception
      
      We need to split these jobs, because v7m_exception_taken()
      needs to know whether the pending interrupt targets Secure so
      it can choose to stack callee-saves registers or not, but it
      must not make the interrupt active until after it has done
      that stacking, in case the stacking causes a derived exception.
      Similarly, it needs to know the number of the pending interrupt
      so it can read the correct vector table entry before the
      interrupt is made active, because vector table reads might
      also cause a derived exception.
      
      Create a new armv7m_nvic_get_pending_irq_info() function which simply
      returns information about the highest priority pending interrupt, and
      use it to rearrange the v7m_exception_taken() code so we don't
      acknowledge the exception until we've done all the things which could
      possibly cause a derived exception.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-id: 1517324542-6607-3-git-send-email-peter.maydell@linaro.org
      6c948518
    • P
      target/arm: Add armv7m_nvic_set_pending_derived() · 5ede82b8
      Peter Maydell 提交于
      In order to support derived exceptions (exceptions generated in
      the course of trying to take an exception), we need to be able
      to handle prioritizing whether to take the original exception
      or the derived exception.
      
      We do this by introducing a new function
      armv7m_nvic_set_pending_derived() which the exception-taking code in
      helper.c will call when a derived exception occurs.  Derived
      exceptions are dealt with mostly like normal pending exceptions, so
      we share the implementation with the armv7m_nvic_set_pending()
      function.
      
      Note that the way we structure this is significantly different
      from the v8M Arm ARM pseudocode: that does all the prioritization
      logic in the DerivedLateArrival() function, whereas we choose to
      let the existing "identify highest priority exception" logic
      do the prioritization for us. The effect is the same, though.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Message-id: 1517324542-6607-2-git-send-email-peter.maydell@linaro.org
      5ede82b8
    • P
      Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20180208' into staging · 04bb7fe2
      Peter Maydell 提交于
      tcg generic vectors
      
      # gpg: Signature made Thu 08 Feb 2018 16:47:16 GMT
      # gpg:                using RSA key 64DF38E8AF7E215F
      # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>"
      # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F
      
      * remotes/rth/tags/pull-tcg-20180208:
        tcg/aarch64: Add vector operations
        tcg/i386: Add vector operations
        target/arm: Use vector infrastructure for aa64 orr/bic immediate
        target/arm: Use vector infrastructure for aa64 multiplies
        target/arm: Use vector infrastructure for aa64 compares
        target/arm: Use vector infrastructure for aa64 constant shifts
        target/arm: Use vector infrastructure for aa64 dup/movi
        target/arm: Use vector infrastructure for aa64 mov/not/neg
        target/arm: Use vector infrastructure for aa64 add/sub/logic
        target/arm: Align vector registers
        tcg/optimize: Handle vector opcodes during optimize
        tcg: Add generic vector helpers with a scalar operand
        tcg: Add generic helpers for saturating arithmetic
        tcg: Add generic vector ops for multiplication
        tcg: Add generic vector ops for comparisons
        tcg: Add generic vector ops for constant shifts
        tcg: Add generic vector expanders
        tcg: Standardize integral arguments to expanders
        tcg: Add types and basic operations for host vectors
        tcg: Allow multiple word entries into the constant pool
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      04bb7fe2
  2. 08 2月, 2018 36 次提交