Revert "x86: Introduce rseq_load_cbne_load_add_store"
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 4 Mar 2024 16:43:08 +0000 (11:43 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 4 Mar 2024 16:43:08 +0000 (11:43 -0500)
This reverts commit 18f21b27f01b9147cd95c538ece07f95c37150a2.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ieffcd50965fe6dcf2c7d067f5fddb4e9f62e82f3

include/rseq/arch/x86/bits.h

index 8621d9c4845186333a2e00012bae531132a915cf..f5511b6f0b8323d3f803fae4eecc5f58b0c30fc8 100644 (file)
@@ -79,61 +79,6 @@ error2:
 #endif
 }
 
-#define rseq_arch_has_load_cbne_load_add_store
-static inline __attribute__((always_inline))
-int RSEQ_TEMPLATE_IDENTIFIER(rseq_load_cbne_load_add_store__ptr)(intptr_t *v, intptr_t expect,
-               intptr_t *v2, intptr_t count, int cpu)
-{
-       RSEQ_INJECT_C(9)
-
-       __asm__ __volatile__ goto (
-               RSEQ_ASM_DEFINE_TABLE(3, 1f, 2f, 4f) /* start, commit, abort */
-               RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[ne])
-#ifdef RSEQ_COMPARE_TWICE
-               RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
-#endif
-               /* Start rseq by storing table entry pointer into rseq_cs. */
-               RSEQ_ASM_STORE_RSEQ_CS(1, 3b, RSEQ_ASM_TP_SEGMENT:RSEQ_ASM_CS_OFFSET(%[rseq_offset]))
-               RSEQ_ASM_CBNE_CPU_ID(cpu_id, RSEQ_ASM_TP_SEGMENT:RSEQ_TEMPLATE_INDEX_CPU_ID_OFFSET(%[rseq_offset]), 4f)
-               RSEQ_INJECT_ASM(3)
-               "cmpq %[v], %[expect]\n\t"
-               "jne %l[ne]\n\t"
-               RSEQ_INJECT_ASM(4)
-               /* final store */
-               "addq %[count], %[v2]\n\t"
-               "2:\n\t"
-               RSEQ_INJECT_ASM(5)
-               RSEQ_ASM_DEFINE_ABORT(4, "", abort)
-               : /* gcc asm goto does not allow outputs */
-               : [cpu_id]              "r" (cpu),
-                 [rseq_offset]         "r" (rseq_offset),
-                 [v]                   "m" (*v),
-                 [expect]              "r" (expect),
-                 [v2]                  "m" (*v2),
-                 [count]               "er" (count)
-               : "memory", "cc", "rax"
-                 RSEQ_INJECT_CLOBBER
-               : abort, ne
-#ifdef RSEQ_COMPARE_TWICE
-                 , error1
-#endif
-       );
-       rseq_after_asm_goto();
-       return 0;
-abort:
-       rseq_after_asm_goto();
-       RSEQ_INJECT_FAILED
-       return -1;
-ne:
-       rseq_after_asm_goto();
-       return 1;
-#ifdef RSEQ_COMPARE_TWICE
-error1:
-       rseq_after_asm_goto();
-       rseq_bug("cpu_id comparison failed");
-#endif
-}
-
 static inline __attribute__((always_inline))
 int RSEQ_TEMPLATE_IDENTIFIER(rseq_load_cbeq_store_add_load_store__ptr)(intptr_t *v, intptr_t expectnot,
                               long voffp, intptr_t *load, int cpu)
@@ -653,71 +598,6 @@ error2:
 #endif
 }
 
-#define rseq_arch_has_load_cbne_load_add_store
-static inline __attribute__((always_inline))
-int RSEQ_TEMPLATE_IDENTIFIER(rseq_load_cbne_load_add_store__ptr)(intptr_t *v, intptr_t expect,
-               intptr_t *v2, intptr_t count, int cpu)
-{
-       /*
-        * ref_ip is used to store a reference instruction pointer
-        * for ip-relative addressing.
-        */
-       struct rseq_local {
-               uint32_t ref_ip;
-       } rseq_local;
-
-       RSEQ_INJECT_C(9)
-
-       __asm__ __volatile__ goto (
-               RSEQ_ASM_DEFINE_TABLE(3, 1f, 2f, 4f) /* start, commit, abort */
-               RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[ne])
-#ifdef RSEQ_COMPARE_TWICE
-               RSEQ_ASM_DEFINE_EXIT_POINT(1f, %l[error1])
-#endif
-               /* Start rseq by storing table entry pointer into rseq_cs. */
-               RSEQ_ASM_STORE_RSEQ_CS(1, 3b, RSEQ_ASM_TP_SEGMENT:RSEQ_ASM_CS_OFFSET(%[rseq_offset]), %[ref_ip], RSEQ_ASM_REF_LABEL)
-               RSEQ_ASM_CBNE_CPU_ID(cpu_id, RSEQ_ASM_TP_SEGMENT:RSEQ_TEMPLATE_INDEX_CPU_ID_OFFSET(%[rseq_offset]), 4f)
-               RSEQ_INJECT_ASM(3)
-               "cmpl %[v], %[expect]\n\t"
-               "jne %l[ne]\n\t"
-               RSEQ_INJECT_ASM(4)
-               /* final store */
-               "addl %[count], %[v2]\n\t"
-               "2:\n\t"
-               RSEQ_INJECT_ASM(5)
-               RSEQ_ASM_DEFINE_ABORT(4, "", abort)
-               : /* gcc asm goto does not allow outputs */
-               : [cpu_id]              "r" (cpu),
-                 [rseq_offset]         "r" (rseq_offset),
-                 [v]                   "m" (*v),
-                 [expect]              "r" (expect),
-                 [v2]                  "m" (*v2),
-                 [count]               "ir" (count),
-                 [ref_ip]              "m" (rseq_local.ref_ip)
-               : "memory", "cc", "eax"
-                 RSEQ_INJECT_CLOBBER
-               : abort, ne
-#ifdef RSEQ_COMPARE_TWICE
-                 , error1
-#endif
-       );
-       rseq_after_asm_goto();
-       return 0;
-abort:
-       rseq_after_asm_goto();
-       RSEQ_INJECT_FAILED
-       return -1;
-ne:
-       rseq_after_asm_goto();
-       return 1;
-#ifdef RSEQ_COMPARE_TWICE
-error1:
-       rseq_after_asm_goto();
-       rseq_bug("cpu_id comparison failed");
-#endif
-}
-
-
 static inline __attribute__((always_inline))
 int RSEQ_TEMPLATE_IDENTIFIER(rseq_load_cbeq_store_add_load_store__ptr)(intptr_t *v, intptr_t expectnot,
                               long voffp, intptr_t *load, int cpu)
This page took 0.026057 seconds and 4 git commands to generate.