lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu,  6 Oct 2016 16:34:45 +0200
From:   Vincent Stehlé <vincent.stehle@...el.com>
To:     linux-kernel@...r.kernel.org
Cc:     Vincent Stehlé <vincent.stehle@...el.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Jiri Olsa <jolsa@...hat.com>,
        Adrian Hunter <adrian.hunter@...el.com>
Subject: [PATCH 2/2] perf x86: fix compilation of push/pop for x32

The x32 ABI (a.k.a AMD64 ILP32) necessitates to push or pop a 64-bit
register even though ILP32 uses 32-bit integers, longs and pointers.

This fixes the following build errors:

  arch/x86/tests/regs_load.S:65: Error: operand type mismatch for `push'
  arch/x86/tests/regs_load.S:72: Error: operand type mismatch for `pop'

Signed-off-by: Vincent Stehlé <vincent.stehle@...el.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Adrian Hunter <adrian.hunter@...el.com>
---
 tools/perf/arch/x86/tests/regs_load.S | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/perf/arch/x86/tests/regs_load.S b/tools/perf/arch/x86/tests/regs_load.S
index 60875d5..4fa7943 100644
--- a/tools/perf/arch/x86/tests/regs_load.S
+++ b/tools/perf/arch/x86/tests/regs_load.S
@@ -62,14 +62,22 @@ ENTRY(perf_regs_load)
 ENDPROC(perf_regs_load)
 #else
 ENTRY(perf_regs_load)
+#if defined(__x86_64__) && defined(__ILP32__)
+	pushq %rdi
+#else
 	push %edi
+#endif
 	movl 8(%esp), %edi
 	movl %eax, AX(%edi)
 	movl %ebx, BX(%edi)
 	movl %ecx, CX(%edi)
 	movl %edx, DX(%edi)
 	movl %esi, SI(%edi)
+#if defined(__x86_64__) && defined(__ILP32__)
+	popq %rax
+#else
 	pop %eax
+#endif
 	movl %eax, DI(%edi)
 	movl %ebp, BP(%edi)
 
-- 
2.9.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ