Skip to content
Snippets Groups Projects
  1. Jun 20, 2023
  2. Mar 07, 2023
  3. Feb 28, 2023
    • Daniel Henrique Barboza's avatar
      accel/tcg: Add 'size' param to probe_access_flags() · 1770b2f2
      Daniel Henrique Barboza authored
      
      probe_access_flags() as it is today uses probe_access_full(), which in
      turn uses probe_access_internal() with size = 0. probe_access_internal()
      then uses the size to call the tlb_fill() callback for the given CPU.
      This size param ('fault_size' as probe_access_internal() calls it) is
      ignored by most existing .tlb_fill callback implementations, e.g.
      arm_cpu_tlb_fill(), ppc_cpu_tlb_fill(), x86_cpu_tlb_fill() and
      mips_cpu_tlb_fill() to name a few.
      
      But RISC-V riscv_cpu_tlb_fill() actually uses it. The 'size' parameter
      is used to check for PMP (Physical Memory Protection) access. This is
      necessary because PMP does not make any guarantees about all the bytes
      of the same page having the same permissions, i.e. the same page can
      have different PMP properties, so we're forced to make sub-page range
      checks. To allow RISC-V emulation to do a probe_acess_flags() that
      covers PMP, we need to either add a 'size' param to the existing
      probe_acess_flags() or create a new interface (e.g.
      probe_access_range_flags).
      
      There are quite a few probe_* APIs already, so let's add a 'size' param
      to probe_access_flags() and re-use this API. This is done by open coding
      what probe_access_full() does inside probe_acess_flags() and passing the
      'size' param to probe_acess_internal(). Existing probe_access_flags()
      callers use size = 0 to not change their current API usage. 'size' is
      asserted to enforce single page access like probe_access() already does.
      
      No behavioral changes intended.
      
      Signed-off-by: default avatarDaniel Henrique Barboza <dbarboza@ventanamicro.com>
      Message-Id: <20230223234427.521114-2-dbarboza@ventanamicro.com>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      1770b2f2
  4. Feb 02, 2023
  5. Jan 09, 2023
  6. Dec 14, 2022
    • Markus Armbruster's avatar
      cleanup: Tweak and re-run return_directly.cocci · 66997c42
      Markus Armbruster authored
      
      Tweak the semantic patch to drop redundant parenthesis around the
      return expression.
      
      Coccinelle drops a comment in hw/rdma/vmw/pvrdma_cmd.c; restored
      manually.
      
      Coccinelle messes up vmdk_co_create(), not sure why.  Change dropped,
      will be done manually in the next commit.
      
      Line breaks in target/avr/cpu.h and hw/rdma/vmw/pvrdma_cmd.c tidied up
      manually.
      
      Whitespace in tools/virtiofsd/fuse_lowlevel.c tidied up manually.
      
      checkpatch.pl complains "return of an errno should typically be -ve"
      two times for hw/9pfs/9p-synth.c.  Preexisting, the patch merely makes
      it visible to checkpatch.pl.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20221122134917.1217307-2-armbru@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Acked-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      66997c42
  7. Oct 31, 2022
  8. Oct 06, 2022
  9. Sep 13, 2022
    • Peter Maydell's avatar
      semihosting: Allow optional use of semihosting from userspace · 5202861b
      Peter Maydell authored
      
      Currently our semihosting implementations generally prohibit use of
      semihosting calls in system emulation from the guest userspace.  This
      is a very long standing behaviour justified originally "to provide
      some semblance of security" (since code with access to the
      semihosting ABI can do things like read and write arbitrary files on
      the host system).  However, it is sometimes useful to be able to run
      trusted guest code which performs semihosting calls from guest
      userspace, notably for test code.  Add a command line suboption to
      the existing semihosting-config option group so that you can
      explicitly opt in to semihosting from guest userspace with
       -semihosting-config userspace=on
      
      (There is no equivalent option for the user-mode emulator, because
      there by definition all code runs in userspace and has access to
      semihosting already.)
      
      This commit adds the infrastructure for the command line option and
      adds a bool 'is_user' parameter to the function
      semihosting_userspace_enabled() that target code can use to check
      whether it should be permitting the semihosting call for userspace.
      It mechanically makes all the callsites pass 'false', so they
      continue checking "is semihosting enabled in general".  Subsequent
      commits will make each target that implements semihosting honour the
      userspace=on option by passing the correct value and removing
      whatever "don't do this for userspace" checking they were doing by
      hand.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Acked-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-Id: <20220822141230.3658237-2-peter.maydell@linaro.org>
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      5202861b
  10. Jul 29, 2022
  11. Jul 12, 2022
  12. Jun 27, 2022
Loading