]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
selftests/rseq: Fix ppc32 offsets by using long rather than off_t
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 24 Jan 2022 17:12:48 +0000 (12:12 -0500)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 26 Aug 2022 08:54:22 +0000 (10:54 +0200)
BugLink: https://bugs.launchpad.net/bugs/1986728
commit 26dc8a6d8e11552f3b797b5aafe01071ca32d692 upstream.

The semantic of off_t is for file offsets. We mean to use it as an
offset from a pointer. We really expect it to fit in a single register,
and not use a 64-bit type on 32-bit architectures.

Fix runtime issues on ppc32 where the offset is always 0 due to
inconsistency between the argument type (off_t -> 64-bit) and type
expected by the inline assembler (32-bit).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20220124171253.22072-11-mathieu.desnoyers@efficios.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
tools/testing/selftests/rseq/basic_percpu_ops_test.c
tools/testing/selftests/rseq/param_test.c
tools/testing/selftests/rseq/rseq-arm.h
tools/testing/selftests/rseq/rseq-arm64.h
tools/testing/selftests/rseq/rseq-mips.h
tools/testing/selftests/rseq/rseq-ppc.h
tools/testing/selftests/rseq/rseq-s390.h
tools/testing/selftests/rseq/rseq-skip.h
tools/testing/selftests/rseq/rseq-x86.h

index b953a52ff706c8892fed5e9d1ebef023d0992866..517756afc2a4e53fc0dd71e5f93aa2d92fa02d10 100644 (file)
@@ -167,7 +167,7 @@ struct percpu_list_node *this_cpu_list_pop(struct percpu_list *list,
        for (;;) {
                struct percpu_list_node *head;
                intptr_t *targetptr, expectnot, *load;
-               off_t offset;
+               long offset;
                int ret, cpu;
 
                cpu = rseq_cpu_start();
index cc2cfc1da9383ffe3fec81bb8dbacdac8c5b41fa..335c290b39e7cd0b9d1fddd5aeb40cf736a53568 100644 (file)
@@ -549,7 +549,7 @@ struct percpu_list_node *this_cpu_list_pop(struct percpu_list *list,
        for (;;) {
                struct percpu_list_node *head;
                intptr_t *targetptr, expectnot, *load;
-               off_t offset;
+               long offset;
                int ret;
 
                cpu = rseq_cpu_start();
index 5f567b3b40f2a342966b1cba1dcd3903fe97eb88..ae476af701528e904c4a66548276d50ea2d3c451 100644 (file)
@@ -217,7 +217,7 @@ error2:
 
 static inline __attribute__((always_inline))
 int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
-                              off_t voffp, intptr_t *load, int cpu)
+                              long voffp, intptr_t *load, int cpu)
 {
        RSEQ_INJECT_C(9)
 
index d0f2b7feee9413288b63c1cac4faef5d0e263bf0..7806817062c2e68b084e064b61e87782c2f24793 100644 (file)
@@ -259,7 +259,7 @@ error2:
 
 static inline __attribute__((always_inline))
 int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
-                              off_t voffp, intptr_t *load, int cpu)
+                              long voffp, intptr_t *load, int cpu)
 {
        RSEQ_INJECT_C(9)
 
index 6df54273825df9701758b9cf3fa4c85875b772cf..0d1d9255da700f84f75d0c54222fe0762bf999de 100644 (file)
@@ -222,7 +222,7 @@ error2:
 
 static inline __attribute__((always_inline))
 int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
-                              off_t voffp, intptr_t *load, int cpu)
+                              long voffp, intptr_t *load, int cpu)
 {
        RSEQ_INJECT_C(9)
 
index 87befda47ba47c29b936c8b121418f88b231593c..aa18c0eabf40ab081869c8e0fd68cfd9b77ea738 100644 (file)
@@ -270,7 +270,7 @@ error2:
 
 static inline __attribute__((always_inline))
 int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
-                              off_t voffp, intptr_t *load, int cpu)
+                              long voffp, intptr_t *load, int cpu)
 {
        RSEQ_INJECT_C(9)
 
index 9927021f8bd0cf8d821bee7ec619e7ec732e5b99..0f523b3ecdef8c4b6409553e7fa73c1f96fdb418 100644 (file)
@@ -198,7 +198,7 @@ error2:
  */
 static inline __attribute__((always_inline))
 int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
-                              off_t voffp, intptr_t *load, int cpu)
+                              long voffp, intptr_t *load, int cpu)
 {
        RSEQ_INJECT_C(9)
 
index 72750b5905a966359e0f791a9ae8e5f87ebd09ca..7b53dac1fcdd9cd3c882539d8543217de3b16b0e 100644 (file)
@@ -13,7 +13,7 @@ int rseq_cmpeqv_storev(intptr_t *v, intptr_t expect, intptr_t newv, int cpu)
 
 static inline __attribute__((always_inline))
 int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
-                              off_t voffp, intptr_t *load, int cpu)
+                              long voffp, intptr_t *load, int cpu)
 {
        return -1;
 }
index 1d9fa0516e5365cbafaf5be5b9251e6ca49b101a..0ee6c041d4be98c7ecf9f981cb5d144a2c87e0f8 100644 (file)
@@ -172,7 +172,7 @@ error2:
  */
 static inline __attribute__((always_inline))
 int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
-                              off_t voffp, intptr_t *load, int cpu)
+                              long voffp, intptr_t *load, int cpu)
 {
        RSEQ_INJECT_C(9)
 
@@ -286,7 +286,7 @@ error1:
  *  *pval += inc;
  */
 static inline __attribute__((always_inline))
-int rseq_offset_deref_addv(intptr_t *ptr, off_t off, intptr_t inc, int cpu)
+int rseq_offset_deref_addv(intptr_t *ptr, long off, intptr_t inc, int cpu)
 {
        RSEQ_INJECT_C(9)
 
@@ -750,7 +750,7 @@ error2:
  */
 static inline __attribute__((always_inline))
 int rseq_cmpnev_storeoffp_load(intptr_t *v, intptr_t expectnot,
-                              off_t voffp, intptr_t *load, int cpu)
+                              long voffp, intptr_t *load, int cpu)
 {
        RSEQ_INJECT_C(9)