From: "Vincent Stehlé" <vincent.stehle@intel.com>
To: linux-kernel@vger.kernel.org
Cc: "Vincent Stehlé" <vincent.stehle@intel.com>,
"Peter Zijlstra" <peterz@infradead.org>,
"Ingo Molnar" <mingo@redhat.com>,
"Arnaldo Carvalho de Melo" <acme@kernel.org>,
"Jiri Olsa" <jolsa@redhat.com>,
"Adrian Hunter" <adrian.hunter@intel.com>
Subject: [PATCH 2/2] perf x86: fix compilation of push/pop for x32
Date: Thu, 6 Oct 2016 16:34:45 +0200 [thread overview]
Message-ID: <20161006143445.8523-2-vincent.stehle@intel.com> (raw)
In-Reply-To: <20161006143445.8523-1-vincent.stehle@intel.com>
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@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.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
prev parent reply other threads:[~2016-10-06 14:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-06 14:34 [PATCH 1/2] perf: cast some printf() arguments to fix x32 build Vincent Stehlé
2016-10-06 14:34 ` Vincent Stehlé [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161006143445.8523-2-vincent.stehle@intel.com \
--to=vincent.stehle@intel.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome