qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/2] target/arm: allow DC CVA[D]P in user mode emulation
@ 2023-06-01 21:53 Zhuojia Shen
  2023-06-01 22:11 ` [PATCH v4 1/2] " Zhuojia Shen
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Zhuojia Shen @ 2023-06-01 21:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Richard Henderson, qemu-arm, Zhuojia Shen

This patch series enables executing DC CVAP and DC CVADP instructions in
AArch64 Linux user mode emulation and adds proper TCG tests.

Changes in v4:
- Add copyright and license header in new files

Changes in v3:
- Fix typo of HWCAP2_DCPODP
- Split tests into a separate patch
- Remove unnecessary handling of SIGILL in tests
- Merge 4 tests into 2

Changes in v2:
- Fix code to deal with unmapped address
- Add tests for DC'ing unmapped address

Zhuojia Shen (2):
  target/arm: allow DC CVA[D]P in user mode emulation
  tests/tcg/aarch64: add DC CVA[D]P tests

 target/arm/helper.c               |  6 +--
 tests/tcg/aarch64/Makefile.target | 11 ++++++
 tests/tcg/aarch64/dcpodp.c        | 63 +++++++++++++++++++++++++++++++
 tests/tcg/aarch64/dcpop.c         | 63 +++++++++++++++++++++++++++++++
 4 files changed, 139 insertions(+), 4 deletions(-)
 create mode 100644 tests/tcg/aarch64/dcpodp.c
 create mode 100644 tests/tcg/aarch64/dcpop.c

-- 
2.40.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v4 1/2] target/arm: allow DC CVA[D]P in user mode emulation
  2023-06-01 21:53 [PATCH v4 0/2] target/arm: allow DC CVA[D]P in user mode emulation Zhuojia Shen
@ 2023-06-01 22:11 ` Zhuojia Shen
  2023-06-02 10:27   ` Philippe Mathieu-Daudé
       [not found] ` <20230601221158.48705-1-chaosdefinition@hotmail.com>
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Zhuojia Shen @ 2023-06-01 22:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Richard Henderson, qemu-arm, Zhuojia Shen

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(-)

diff --git a/target/arm/helper.c b/target/arm/helper.c
index 0b7fd2e7e6..d4bee43bd0 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -7405,7 +7405,6 @@ static const ARMCPRegInfo rndr_reginfo[] = {
       .access = PL0_R, .readfn = rndr_readfn },
 };
 
-#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
 
         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*/
 
 static CPAccessResult access_aa64_tid5(CPUARMState *env, const ARMCPRegInfo *ri,
                                        bool isread)
@@ -9092,7 +9092,6 @@ void register_cp_regs_for_features(ARMCPU *cpu)
     if (cpu_isar_feature(aa64_tlbios, cpu)) {
         define_arm_cp_regs(cpu, tlbios_reginfo);
     }
-#ifndef CONFIG_USER_ONLY
     /* Data Cache clean instructions up to PoP */
     if (cpu_isar_feature(aa64_dcpop, cpu)) {
         define_one_arm_cp_reg(cpu, dcpop_reg);
@@ -9101,7 +9100,6 @@ void register_cp_regs_for_features(ARMCPU *cpu)
             define_one_arm_cp_reg(cpu, dcpodp_reg);
         }
     }
-#endif /*CONFIG_USER_ONLY*/
 
     /*
      * If full MTE is enabled, add all of the system registers.
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v4 2/2] tests/tcg/aarch64: add DC CVA[D]P tests
       [not found] ` <20230601221158.48705-1-chaosdefinition@hotmail.com>
@ 2023-06-01 22:11   ` Zhuojia Shen
  0 siblings, 0 replies; 8+ messages in thread
From: Zhuojia Shen @ 2023-06-01 22:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Richard Henderson, qemu-arm, Zhuojia Shen

Test execution of DC CVAP and DC CVADP instructions under user mode
emulation.

Signed-off-by: Zhuojia Shen <chaosdefinition@hotmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
 tests/tcg/aarch64/Makefile.target | 11 ++++++
 tests/tcg/aarch64/dcpodp.c        | 63 +++++++++++++++++++++++++++++++
 tests/tcg/aarch64/dcpop.c         | 63 +++++++++++++++++++++++++++++++
 3 files changed, 137 insertions(+)
 create mode 100644 tests/tcg/aarch64/dcpodp.c
 create mode 100644 tests/tcg/aarch64/dcpop.c

diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target
index 0315795487..3430fd3cd8 100644
--- a/tests/tcg/aarch64/Makefile.target
+++ b/tests/tcg/aarch64/Makefile.target
@@ -21,12 +21,23 @@ config-cc.mak: Makefile
 	$(quiet-@)( \
 	    $(call cc-option,-march=armv8.1-a+sve,          CROSS_CC_HAS_SVE); \
 	    $(call cc-option,-march=armv8.1-a+sve2,         CROSS_CC_HAS_SVE2); \
+	    $(call cc-option,-march=armv8.2-a,              CROSS_CC_HAS_ARMV8_2); \
 	    $(call cc-option,-march=armv8.3-a,              CROSS_CC_HAS_ARMV8_3); \
+	    $(call cc-option,-march=armv8.5-a,              CROSS_CC_HAS_ARMV8_5); \
 	    $(call cc-option,-mbranch-protection=standard,  CROSS_CC_HAS_ARMV8_BTI); \
 	    $(call cc-option,-march=armv8.5-a+memtag,       CROSS_CC_HAS_ARMV8_MTE); \
 	    $(call cc-option,-march=armv9-a+sme,            CROSS_CC_HAS_ARMV9_SME)) 3> config-cc.mak
 -include config-cc.mak
 
+ifneq ($(CROSS_CC_HAS_ARMV8_2),)
+AARCH64_TESTS += dcpop
+dcpop: CFLAGS += -march=armv8.2-a
+endif
+ifneq ($(CROSS_CC_HAS_ARMV8_5),)
+AARCH64_TESTS += dcpodp
+dcpodp: CFLAGS += -march=armv8.5-a
+endif
+
 # Pauth Tests
 ifneq ($(CROSS_CC_HAS_ARMV8_3),)
 AARCH64_TESTS += pauth-1 pauth-2 pauth-4 pauth-5
diff --git a/tests/tcg/aarch64/dcpodp.c b/tests/tcg/aarch64/dcpodp.c
new file mode 100644
index 0000000000..2cf7df2e07
--- /dev/null
+++ b/tests/tcg/aarch64/dcpodp.c
@@ -0,0 +1,63 @@
+/*
+ * Test execution of DC CVADP instruction.
+ *
+ * Copyright (c) 2023 Zhuojia Shen <chaosdefinition@hotmail.com>
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include <asm/hwcap.h>
+#include <sys/auxv.h>
+
+#include <signal.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifndef HWCAP2_DCPODP
+#define HWCAP2_DCPODP (1 << 0)
+#endif
+
+bool should_fail = false;
+
+static void signal_handler(int sig, siginfo_t *si, void *data)
+{
+    ucontext_t *uc = (ucontext_t *)data;
+
+    if (should_fail) {
+        uc->uc_mcontext.pc += 4;
+    } else {
+        exit(EXIT_FAILURE);
+    }
+}
+
+static int do_dc_cvadp(void)
+{
+    struct sigaction sa = {
+        .sa_flags = SA_SIGINFO,
+        .sa_sigaction = signal_handler,
+    };
+
+    sigemptyset(&sa.sa_mask);
+    if (sigaction(SIGSEGV, &sa, NULL) < 0) {
+        perror("sigaction");
+        return EXIT_FAILURE;
+    }
+
+    asm volatile("dc cvadp, %0\n\t" :: "r"(&sa));
+
+    should_fail = true;
+    asm volatile("dc cvadp, %0\n\t" :: "r"(NULL));
+    should_fail = false;
+
+    return EXIT_SUCCESS;
+}
+
+int main(void)
+{
+    if (getauxval(AT_HWCAP2) & HWCAP2_DCPODP) {
+        return do_dc_cvadp();
+    } else {
+        printf("SKIP: no HWCAP2_DCPODP on this system\n");
+        return EXIT_SUCCESS;
+    }
+}
diff --git a/tests/tcg/aarch64/dcpop.c b/tests/tcg/aarch64/dcpop.c
new file mode 100644
index 0000000000..a332a804a4
--- /dev/null
+++ b/tests/tcg/aarch64/dcpop.c
@@ -0,0 +1,63 @@
+/*
+ * Test execution of DC CVAP instruction.
+ *
+ * Copyright (c) 2023 Zhuojia Shen <chaosdefinition@hotmail.com>
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include <asm/hwcap.h>
+#include <sys/auxv.h>
+
+#include <signal.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifndef HWCAP_DCPOP
+#define HWCAP_DCPOP (1 << 16)
+#endif
+
+bool should_fail = false;
+
+static void signal_handler(int sig, siginfo_t *si, void *data)
+{
+    ucontext_t *uc = (ucontext_t *)data;
+
+    if (should_fail) {
+        uc->uc_mcontext.pc += 4;
+    } else {
+        exit(EXIT_FAILURE);
+    }
+}
+
+static int do_dc_cvap(void)
+{
+    struct sigaction sa = {
+        .sa_flags = SA_SIGINFO,
+        .sa_sigaction = signal_handler,
+    };
+
+    sigemptyset(&sa.sa_mask);
+    if (sigaction(SIGSEGV, &sa, NULL) < 0) {
+        perror("sigaction");
+        return EXIT_FAILURE;
+    }
+
+    asm volatile("dc cvap, %0\n\t" :: "r"(&sa));
+
+    should_fail = true;
+    asm volatile("dc cvap, %0\n\t" :: "r"(NULL));
+    should_fail = false;
+
+    return EXIT_SUCCESS;
+}
+
+int main(void)
+{
+    if (getauxval(AT_HWCAP) & HWCAP_DCPOP) {
+        return do_dc_cvap();
+    } else {
+        printf("SKIP: no HWCAP_DCPOP on this system\n");
+        return EXIT_SUCCESS;
+    }
+}
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v4 2/2] tests/tcg/aarch64: add DC CVA[D]P tests
  2023-06-01 21:53 [PATCH v4 0/2] target/arm: allow DC CVA[D]P in user mode emulation Zhuojia Shen
  2023-06-01 22:11 ` [PATCH v4 1/2] " Zhuojia Shen
       [not found] ` <20230601221158.48705-1-chaosdefinition@hotmail.com>
@ 2023-06-01 22:34 ` Zhuojia Shen
  2023-06-03  3:32 ` [PATCH v4 0/2] target/arm: allow DC CVA[D]P in user mode emulation Richard Henderson
  2023-06-05 16:01 ` Peter Maydell
  4 siblings, 0 replies; 8+ messages in thread
From: Zhuojia Shen @ 2023-06-01 22:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Richard Henderson, qemu-arm, Zhuojia Shen

Test execution of DC CVAP and DC CVADP instructions under user mode
emulation.

Signed-off-by: Zhuojia Shen <chaosdefinition@hotmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
 tests/tcg/aarch64/Makefile.target | 11 ++++++
 tests/tcg/aarch64/dcpodp.c        | 63 +++++++++++++++++++++++++++++++
 tests/tcg/aarch64/dcpop.c         | 63 +++++++++++++++++++++++++++++++
 3 files changed, 137 insertions(+)
 create mode 100644 tests/tcg/aarch64/dcpodp.c
 create mode 100644 tests/tcg/aarch64/dcpop.c

diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target
index 0315795487..3430fd3cd8 100644
--- a/tests/tcg/aarch64/Makefile.target
+++ b/tests/tcg/aarch64/Makefile.target
@@ -21,12 +21,23 @@ config-cc.mak: Makefile
 	$(quiet-@)( \
 	    $(call cc-option,-march=armv8.1-a+sve,          CROSS_CC_HAS_SVE); \
 	    $(call cc-option,-march=armv8.1-a+sve2,         CROSS_CC_HAS_SVE2); \
+	    $(call cc-option,-march=armv8.2-a,              CROSS_CC_HAS_ARMV8_2); \
 	    $(call cc-option,-march=armv8.3-a,              CROSS_CC_HAS_ARMV8_3); \
+	    $(call cc-option,-march=armv8.5-a,              CROSS_CC_HAS_ARMV8_5); \
 	    $(call cc-option,-mbranch-protection=standard,  CROSS_CC_HAS_ARMV8_BTI); \
 	    $(call cc-option,-march=armv8.5-a+memtag,       CROSS_CC_HAS_ARMV8_MTE); \
 	    $(call cc-option,-march=armv9-a+sme,            CROSS_CC_HAS_ARMV9_SME)) 3> config-cc.mak
 -include config-cc.mak
 
+ifneq ($(CROSS_CC_HAS_ARMV8_2),)
+AARCH64_TESTS += dcpop
+dcpop: CFLAGS += -march=armv8.2-a
+endif
+ifneq ($(CROSS_CC_HAS_ARMV8_5),)
+AARCH64_TESTS += dcpodp
+dcpodp: CFLAGS += -march=armv8.5-a
+endif
+
 # Pauth Tests
 ifneq ($(CROSS_CC_HAS_ARMV8_3),)
 AARCH64_TESTS += pauth-1 pauth-2 pauth-4 pauth-5
diff --git a/tests/tcg/aarch64/dcpodp.c b/tests/tcg/aarch64/dcpodp.c
new file mode 100644
index 0000000000..2cf7df2e07
--- /dev/null
+++ b/tests/tcg/aarch64/dcpodp.c
@@ -0,0 +1,63 @@
+/*
+ * Test execution of DC CVADP instruction.
+ *
+ * Copyright (c) 2023 Zhuojia Shen <chaosdefinition@hotmail.com>
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include <asm/hwcap.h>
+#include <sys/auxv.h>
+
+#include <signal.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifndef HWCAP2_DCPODP
+#define HWCAP2_DCPODP (1 << 0)
+#endif
+
+bool should_fail = false;
+
+static void signal_handler(int sig, siginfo_t *si, void *data)
+{
+    ucontext_t *uc = (ucontext_t *)data;
+
+    if (should_fail) {
+        uc->uc_mcontext.pc += 4;
+    } else {
+        exit(EXIT_FAILURE);
+    }
+}
+
+static int do_dc_cvadp(void)
+{
+    struct sigaction sa = {
+        .sa_flags = SA_SIGINFO,
+        .sa_sigaction = signal_handler,
+    };
+
+    sigemptyset(&sa.sa_mask);
+    if (sigaction(SIGSEGV, &sa, NULL) < 0) {
+        perror("sigaction");
+        return EXIT_FAILURE;
+    }
+
+    asm volatile("dc cvadp, %0\n\t" :: "r"(&sa));
+
+    should_fail = true;
+    asm volatile("dc cvadp, %0\n\t" :: "r"(NULL));
+    should_fail = false;
+
+    return EXIT_SUCCESS;
+}
+
+int main(void)
+{
+    if (getauxval(AT_HWCAP2) & HWCAP2_DCPODP) {
+        return do_dc_cvadp();
+    } else {
+        printf("SKIP: no HWCAP2_DCPODP on this system\n");
+        return EXIT_SUCCESS;
+    }
+}
diff --git a/tests/tcg/aarch64/dcpop.c b/tests/tcg/aarch64/dcpop.c
new file mode 100644
index 0000000000..a332a804a4
--- /dev/null
+++ b/tests/tcg/aarch64/dcpop.c
@@ -0,0 +1,63 @@
+/*
+ * Test execution of DC CVAP instruction.
+ *
+ * Copyright (c) 2023 Zhuojia Shen <chaosdefinition@hotmail.com>
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include <asm/hwcap.h>
+#include <sys/auxv.h>
+
+#include <signal.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifndef HWCAP_DCPOP
+#define HWCAP_DCPOP (1 << 16)
+#endif
+
+bool should_fail = false;
+
+static void signal_handler(int sig, siginfo_t *si, void *data)
+{
+    ucontext_t *uc = (ucontext_t *)data;
+
+    if (should_fail) {
+        uc->uc_mcontext.pc += 4;
+    } else {
+        exit(EXIT_FAILURE);
+    }
+}
+
+static int do_dc_cvap(void)
+{
+    struct sigaction sa = {
+        .sa_flags = SA_SIGINFO,
+        .sa_sigaction = signal_handler,
+    };
+
+    sigemptyset(&sa.sa_mask);
+    if (sigaction(SIGSEGV, &sa, NULL) < 0) {
+        perror("sigaction");
+        return EXIT_FAILURE;
+    }
+
+    asm volatile("dc cvap, %0\n\t" :: "r"(&sa));
+
+    should_fail = true;
+    asm volatile("dc cvap, %0\n\t" :: "r"(NULL));
+    should_fail = false;
+
+    return EXIT_SUCCESS;
+}
+
+int main(void)
+{
+    if (getauxval(AT_HWCAP) & HWCAP_DCPOP) {
+        return do_dc_cvap();
+    } else {
+        printf("SKIP: no HWCAP_DCPOP on this system\n");
+        return EXIT_SUCCESS;
+    }
+}
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v4 1/2] target/arm: allow DC CVA[D]P in user mode emulation
  2023-06-01 22:11 ` [PATCH v4 1/2] " Zhuojia Shen
@ 2023-06-02 10:27   ` Philippe Mathieu-Daudé
  2023-06-02 17:11     ` Zhuojia Shen
  0 siblings, 1 reply; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-06-02 10:27 UTC (permalink / raw)
  To: Zhuojia Shen, qemu-devel; +Cc: Peter Maydell, Richard Henderson, qemu-arm

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*/



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v4 1/2] target/arm: allow DC CVA[D]P in user mode emulation
  2023-06-02 10:27   ` Philippe Mathieu-Daudé
@ 2023-06-02 17:11     ` Zhuojia Shen
  0 siblings, 0 replies; 8+ messages in thread
From: Zhuojia Shen @ 2023-06-02 17:11 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Peter Maydell, Richard Henderson, qemu-arm

On 06/02/2023 12:27 PM +0200, Philippe Mathieu-Daudé wrote:
> 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?

Yes, exactly.  Since we pass -Werror, ifdef'ing out the if statement
wouldn't even compile.

> 
> >           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*/
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v4 0/2] target/arm: allow DC CVA[D]P in user mode emulation
  2023-06-01 21:53 [PATCH v4 0/2] target/arm: allow DC CVA[D]P in user mode emulation Zhuojia Shen
                   ` (2 preceding siblings ...)
  2023-06-01 22:34 ` Zhuojia Shen
@ 2023-06-03  3:32 ` Richard Henderson
  2023-06-05 16:01 ` Peter Maydell
  4 siblings, 0 replies; 8+ messages in thread
From: Richard Henderson @ 2023-06-03  3:32 UTC (permalink / raw)
  To: Zhuojia Shen, qemu-devel; +Cc: Peter Maydell, qemu-arm

On 6/1/23 14:53, Zhuojia Shen wrote:
> Zhuojia Shen (2):
>    target/arm: allow DC CVA[D]P in user mode emulation
>    tests/tcg/aarch64: add DC CVA[D]P tests
> 
>   target/arm/helper.c               |  6 +--
>   tests/tcg/aarch64/Makefile.target | 11 ++++++
>   tests/tcg/aarch64/dcpodp.c        | 63 +++++++++++++++++++++++++++++++
>   tests/tcg/aarch64/dcpop.c         | 63 +++++++++++++++++++++++++++++++
>   4 files changed, 139 insertions(+), 4 deletions(-)
>   create mode 100644 tests/tcg/aarch64/dcpodp.c
>   create mode 100644 tests/tcg/aarch64/dcpop.c

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v4 0/2] target/arm: allow DC CVA[D]P in user mode emulation
  2023-06-01 21:53 [PATCH v4 0/2] target/arm: allow DC CVA[D]P in user mode emulation Zhuojia Shen
                   ` (3 preceding siblings ...)
  2023-06-03  3:32 ` [PATCH v4 0/2] target/arm: allow DC CVA[D]P in user mode emulation Richard Henderson
@ 2023-06-05 16:01 ` Peter Maydell
  4 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2023-06-05 16:01 UTC (permalink / raw)
  To: Zhuojia Shen; +Cc: qemu-devel, Richard Henderson, qemu-arm

On Thu, 1 Jun 2023 at 23:09, Zhuojia Shen <chaosdefinition@hotmail.com> wrote:
>
> This patch series enables executing DC CVAP and DC CVADP instructions in
> AArch64 Linux user mode emulation and adds proper TCG tests.



Applied to target-arm.next, thanks.

-- PMM


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-06-05 16:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-01 21:53 [PATCH v4 0/2] target/arm: allow DC CVA[D]P in user mode emulation Zhuojia Shen
2023-06-01 22:11 ` [PATCH v4 1/2] " Zhuojia Shen
2023-06-02 10:27   ` Philippe Mathieu-Daudé
2023-06-02 17:11     ` Zhuojia Shen
     [not found] ` <20230601221158.48705-1-chaosdefinition@hotmail.com>
2023-06-01 22:11   ` [PATCH v4 2/2] tests/tcg/aarch64: add DC CVA[D]P tests Zhuojia Shen
2023-06-01 22:34 ` Zhuojia Shen
2023-06-03  3:32 ` [PATCH v4 0/2] target/arm: allow DC CVA[D]P in user mode emulation Richard Henderson
2023-06-05 16:01 ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).