1. 15 8月, 2018 7 次提交
  2. 30 7月, 2018 1 次提交
  3. 23 7月, 2018 1 次提交
    • P
      target/arm: Correctly handle overlapping small MPU regions · 9d2b5a58
      Peter Maydell 提交于
      To correctly handle small (less than TARGET_PAGE_SIZE) MPU regions,
      we must correctly handle the case where the address being looked
      up hits in an MPU region that is not small but the address is
      in the same page as a small region. For instance if MPU region
      1 covers an entire page from 0x2000 to 0x2400 and MPU region
      2 is small and covers only 0x2200 to 0x2280, then for an access
      to 0x2000 we must not return a result covering the full page
      even though we hit the page-sized region 1. Otherwise we will
      then cache that result in the TLB and accesses that should
      hit region 2 will incorrectly find the region 1 information.
      
      Check for the case where we miss an MPU region but it is still
      within the same page, and in that case narrow the size we will
      pass to tlb_set_page_with_attrs() for whatever the final
      outcome is of the MPU lookup.
      Reported-by: NAdithya Baglody <adithya.nagaraj.baglody@intel.com>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20180716133302.25989-1-peter.maydell@linaro.org
      9d2b5a58
  4. 10 7月, 2018 1 次提交
  5. 29 6月, 2018 5 次提交
  6. 27 6月, 2018 2 次提交
    • P
      target/arm: Handle small regions in get_phys_addr_pmsav8() · 72042435
      Peter Maydell 提交于
      Allow ARMv8M to handle small MPU and SAU region sizes, by making
      get_phys_add_pmsav8() set the page size to the 1 if the MPU or
      SAU region covers less than a TARGET_PAGE_SIZE.
      
      We choose to use a size of 1 because it makes no difference to
      the core code, and avoids having to track both the base and
      limit for SAU and MPU and then convert into an artificially
      restricted "page size" that the core code will then ignore.
      
      Since the core TCG code can't handle execution from small
      MPU regions, we strip the exec permission from them so that
      any execution attempts will cause an MPU exception, rather
      than allowing it to end up with a cpu_abort() in
      get_page_addr_code().
      
      (The previous code's intention was to make any small page be
      treated as having no permissions, but unfortunately errors
      in the implementation meant that it didn't behave that way.
      It's possible that some binaries using small regions were
      accidentally working with our old behaviour and won't now.)
      
      We also retain an existing bug, where we ignored the possibility
      that the SAU region might not cover the entire page, in the
      case of executable regions. This is necessary because some
      currently-working guest code images rely on being able to
      execute from addresses which are covered by a page-sized
      MPU region but a smaller SAU region. We can remove this
      workaround if we ever support execution from small regions.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20180620130619.11362-4-peter.maydell@linaro.org
      72042435
    • P
      target/arm: Set page (region) size in get_phys_addr_pmsav7() · e5e40999
      Peter Maydell 提交于
      We want to handle small MPU region sizes for ARMv7M. To do this,
      make get_phys_addr_pmsav7() set the page size to the region
      size if it is less that TARGET_PAGE_SIZE, rather than working
      only in TARGET_PAGE_SIZE chunks.
      
      Since the core TCG code con't handle execution from small
      MPU regions, we strip the exec permission from them so that
      any execution attempts will cause an MPU exception, rather
      than allowing it to end up with a cpu_abort() in
      get_page_addr_code().
      
      (The previous code's intention was to make any small page be
      treated as having no permissions, but unfortunately errors
      in the implementation meant that it didn't behave that way.
      It's possible that some binaries using small regions were
      accidentally working with our old behaviour and won't now.)
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20180620130619.11362-3-peter.maydell@linaro.org
      e5e40999
  7. 08 6月, 2018 1 次提交
  8. 31 5月, 2018 2 次提交
    • P
      Correct CPACR reset value for v7 cores · 5deac39c
      Peter Maydell 提交于
      In commit f0aff255 we made cpacr_write() enforce that some CPACR
      bits are RAZ/WI and some are RAO/WI for ARMv7 cores. Unfortunately
      we forgot to also update the register's reset value. The effect
      was that (a) a guest that read CPACR on reset would not see ones in
      the RAO bits, and (b) if you did a migration before the guest did
      a write to the CPACR then the migration would fail because the
      destination would enforce the RAO bits and then complain that they
      didn't match the zero value from the source.
      
      Implement reset for the CPACR using a custom reset function
      that just calls cpacr_write(), to avoid having to duplicate
      the logic for which bits are RAO.
      
      This bug would affect migration for TCG CPUs which are ARMv7
      with VFP but without one of Neon or VFPv3.
      Reported-by: NCédric Le Goater <clg@kaod.org>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Tested-by: NCédric Le Goater <clg@kaod.org>
      Message-id: 20180522173713.26282-1-peter.maydell@linaro.org
      5deac39c
    • R
      tcg: Fix helper function vs host abi for float16 · 6c2be133
      Richard Henderson 提交于
      Depending on the host abi, float16, aka uint16_t, values are
      passed and returned either zero-extended in the host register
      or with garbage at the top of the host register.
      
      The tcg code generator has so far been assuming garbage, as that
      matches the x86 abi, but this is incorrect for other host abis.
      Further, target/arm has so far been assuming zero-extended results,
      so that it may store the 16-bit value into a 32-bit slot with the
      high 16-bits already clear.
      
      Rectify both problems by mapping "f16" in the helper definition
      to uint32_t instead of (a typedef for) uint16_t.  This forces
      the host compiler to assume garbage in the upper 16 bits on input
      and to zero-extend the result on output.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Tested-by: NLaurent Desnogues <laurent.desnogues@gmail.com>
      Message-id: 20180522175629.24932-1-richard.henderson@linaro.org
      Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      6c2be133
  9. 19 5月, 2018 3 次提交
  10. 18 5月, 2018 4 次提交
  11. 15 5月, 2018 1 次提交
  12. 11 5月, 2018 1 次提交
  13. 05 5月, 2018 1 次提交
  14. 26 4月, 2018 8 次提交
  15. 10 4月, 2018 1 次提交
  16. 24 3月, 2018 1 次提交