qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 1/2] target/arm: allow DC CVA[D]P in user mode emulation


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v4 1/2] target/arm: allow DC CVA[D]P in user mode emulation
Date: Fri, 2 Jun 2023 12:27:22 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

On 2/6/23 00:11, Zhuojia Shen wrote:
DC CVAP and DC CVADP instructions can be executed in EL0 on Linux,
either directly when SCTLR_EL1.UCI == 1 or emulated by the kernel (see
user_cache_maint_handler() in arch/arm64/kernel/traps.c).

This patch enables execution of the two instructions in user mode
emulation.

Signed-off-by: Zhuojia Shen <chaosdefinition@hotmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
  target/arm/helper.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)


-#ifndef CONFIG_USER_ONLY
  static void dccvap_writefn(CPUARMState *env, const ARMCPRegInfo *opaque,
                            uint64_t value)
  {
@@ -7420,6 +7419,7 @@ static void dccvap_writefn(CPUARMState *env, const 
ARMCPRegInfo *opaque,
      /* This won't be crossing page boundaries */
      haddr = probe_read(env, vaddr, dline_size, mem_idx, GETPC());
      if (haddr) {
+#ifndef CONFIG_USER_ONLY

This ifdef'ry placement is odd. Is it to silent a
unused-but-set-variable warning?

          ram_addr_t offset;
          MemoryRegion *mr;
@@ -7430,6 +7430,7 @@ static void dccvap_writefn(CPUARMState *env, const 
ARMCPRegInfo *opaque,
          if (mr) {
              memory_region_writeback(mr, offset, dline_size);
          }
+#endif /*CONFIG_USER_ONLY*/
      }
  }
@@ -7448,7 +7449,6 @@ static const ARMCPRegInfo dcpodp_reg[] = {
        .fgt = FGT_DCCVADP,
        .accessfn = aa64_cacheop_poc_access, .writefn = dccvap_writefn },
  };
-#endif /*CONFIG_USER_ONLY*/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]