x86-32: Remove support for old IDT WinChip and PPRO
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 27 Feb 2024 19:09:58 +0000 (14:09 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 27 Feb 2024 22:28:07 +0000 (17:28 -0500)
The rseq system call first appeared in Linux v4.18, which did not
support the old IDT WinChip Intel clones and PentiumPro CPUs anymore.
Therefore, remove CPU barrier instructions from the smp_rmb() and
smp_wmb() macros given that librseq will realistically never be used on
such hardware.

Expect all x86-32 hardware to be TSO.

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

include/rseq/rseq-x86.h

index 9d38628b64e48b48a29329faac8af85697a32e7e..eb5cc19778ca30184c1c5f3948885b77640c6613 100644 (file)
 #define RSEQ_CS_OFFSET         8
 #define RSEQ_MM_CID_OFFSET     24
 
-#ifdef __x86_64__
-
-#define RSEQ_ASM_TP_SEGMENT    %%fs
-
 #define rseq_smp_mb()  \
        __asm__ __volatile__ ("lock; addl $0,-128(%%rsp)" ::: "memory", "cc")
 #define rseq_smp_rmb() rseq_barrier()
@@ -55,6 +51,10 @@ do {                                                                 \
        RSEQ_WRITE_ONCE(*(p), v);                                       \
 } while (0)
 
+#ifdef __x86_64__
+
+#define RSEQ_ASM_TP_SEGMENT    %%fs
+
 #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags,                 \
                                start_ip, post_commit_offset, abort_ip) \
                ".pushsection __rseq_cs, \"aw\"\n\t"                    \
@@ -117,28 +117,6 @@ do {                                                                       \
 
 #define RSEQ_ASM_TP_SEGMENT    %%gs
 
-#define rseq_smp_mb()  \
-       __asm__ __volatile__ ("lock; addl $0,-128(%%esp)" ::: "memory", "cc")
-#define rseq_smp_rmb() \
-       __asm__ __volatile__ ("lock; addl $0,-128(%%esp)" ::: "memory", "cc")
-#define rseq_smp_wmb() \
-       __asm__ __volatile__ ("lock; addl $0,-128(%%esp)" ::: "memory", "cc")
-
-#define rseq_smp_load_acquire(p)                                       \
-__extension__ ({                                                       \
-       rseq_unqual_scalar_typeof(*(p)) ____p1 = RSEQ_READ_ONCE(*(p));  \
-       rseq_smp_mb();                                                  \
-       ____p1;                                                         \
-})
-
-#define rseq_smp_acquire__after_ctrl_dep()     rseq_smp_rmb()
-
-#define rseq_smp_store_release(p, v)                                   \
-do {                                                                   \
-       rseq_smp_mb();                                                  \
-       RSEQ_WRITE_ONCE(*p, v);                                         \
-} while (0)
-
 /*
  * Use eax as scratch register and take memory operands as input to
  * lessen register pressure. Especially needed when compiling in O0.
This page took 0.035752 seconds and 4 git commands to generate.