Accepting request 233682 from home:a_faerber:branches:Virtualization
Fix ppc64le TCG and resulting test failures OBS-URL: https://build.opensuse.org/request/show/233682 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=208
This commit is contained in:
parent
e3074d891d
commit
d53a5fa597
58
0045-tcg-ppc64-Support-the-ELFv2-ABI.patch
Normal file
58
0045-tcg-ppc64-Support-the-ELFv2-ABI.patch
Normal file
@ -0,0 +1,58 @@
|
||||
From 243f0e345cce28c1f93444de33fe7981efdac6dd Mon Sep 17 00:00:00 2001
|
||||
From: Ulrich Weigand <uweigand@de.ibm.com>
|
||||
Date: Tue, 22 Apr 2014 18:26:15 +0200
|
||||
Subject: [PATCH] tcg-ppc64: Support the ELFv2 ABI
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The new ELFv2 ABI, used by default on powerpc64le-linux hosts,
|
||||
introduced some changes that are incompatible with code currently
|
||||
generated by the ppc64 TGC target. In particular, we no longer
|
||||
use function descriptors.
|
||||
|
||||
This patch adds support for the ELFv2 ABI in the ppc64 TGC
|
||||
function call and function prologue sequences.
|
||||
|
||||
Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
|
||||
Signed-off-by: Andreas Färber <afaerber@suse.de>
|
||||
---
|
||||
tcg/ppc64/tcg-target.c | 18 +++++++++++++++++-
|
||||
1 file changed, 17 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c
|
||||
index 06e440f..4ef4838 100644
|
||||
--- a/tcg/ppc64/tcg-target.c
|
||||
+++ b/tcg/ppc64/tcg-target.c
|
||||
@@ -717,6 +717,22 @@ static void tcg_out_call(TCGContext *s, tcg_target_long arg, int const_arg)
|
||||
tcg_out32(s, MTSPR | RS(arg) | LR);
|
||||
tcg_out32(s, BCLR | BO_ALWAYS | LK);
|
||||
}
|
||||
+#elif _CALL_ELF == 2
|
||||
+ /* In the ELFv2 ABI, we do not need to set up the TOC pointer in r2,
|
||||
+ but instead we have to set up r12 to contain the destination address
|
||||
+ when performing an indirect call. */
|
||||
+ TCGReg reg = arg;
|
||||
+ if (const_arg) {
|
||||
+ /* FIXME: we could use bl if we knew that the destination uses
|
||||
+ the same TOC, and what its local entry point offset is.
|
||||
+ For now, always perform an indirect call. */
|
||||
+ tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_R12, arg);
|
||||
+ reg = TCG_REG_R12;
|
||||
+ } else {
|
||||
+ tcg_out_mov(s, TCG_TYPE_PTR, TCG_REG_R12, arg);
|
||||
+ }
|
||||
+ tcg_out32(s, MTSPR | RS(reg) | CTR);
|
||||
+ tcg_out32(s, BCCTR | BO_ALWAYS | LK);
|
||||
#else
|
||||
TCGReg reg = arg;
|
||||
int ofs = 0;
|
||||
@@ -1112,7 +1128,7 @@ static void tcg_target_qemu_prologue(TCGContext *s)
|
||||
REG_SAVE_BOT - CPU_TEMP_BUF_NLONGS * sizeof(long),
|
||||
CPU_TEMP_BUF_NLONGS * sizeof(long));
|
||||
|
||||
-#ifndef __APPLE__
|
||||
+#if !defined(__APPLE__) && _CALL_ELF != 2
|
||||
/* First emit adhoc function descriptor */
|
||||
tcg_out64(s, (uint64_t)s->code_ptr + 24); /* entry point */
|
||||
s->code_ptr += 16; /* skip TOC and environment pointer */
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue May 13 08:17:18 UTC 2014 - afaerber@suse.de
|
||||
|
||||
- ABI fixes for ppc64le TCG
|
||||
0045-tcg-ppc64-Support-the-ELFv2-ABI.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 18 17:55:03 UTC 2014 - afaerber@suse.de
|
||||
|
||||
|
@ -69,6 +69,7 @@ Patch0041: 0041-qtest-Increase-socket-timeout.patch
|
||||
Patch0042: 0042-qtest-Be-paranoid-about-accept-addr.patch
|
||||
Patch0043: 0043-arm-translate.c-Fix-smlald-Instruct.patch
|
||||
Patch0044: 0044-target-arm-A64-fix-unallocated-test.patch
|
||||
Patch0045: 0045-tcg-ppc64-Support-the-ELFv2-ABI.patch
|
||||
# Please do not add patches manually here, run update_git.sh.
|
||||
# this is to make lint happy
|
||||
Source300: rpmlintrc
|
||||
@ -166,6 +167,7 @@ run cross-architecture builds.
|
||||
%patch0042 -p1
|
||||
%patch0043 -p1
|
||||
%patch0044 -p1
|
||||
%patch0045 -p1
|
||||
|
||||
%build
|
||||
./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \
|
||||
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue May 13 08:17:18 UTC 2014 - afaerber@suse.de
|
||||
|
||||
- ABI fixes for ppc64le TCG. Addresses acpi-test failures.
|
||||
0045-tcg-ppc64-Support-the-ELFv2-ABI.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat May 10 20:06:24 UTC 2014 - afaerber@suse.de
|
||||
|
||||
|
@ -98,6 +98,7 @@ Patch0041: 0041-qtest-Increase-socket-timeout.patch
|
||||
Patch0042: 0042-qtest-Be-paranoid-about-accept-addr.patch
|
||||
Patch0043: 0043-arm-translate.c-Fix-smlald-Instruct.patch
|
||||
Patch0044: 0044-target-arm-A64-fix-unallocated-test.patch
|
||||
Patch0045: 0045-tcg-ppc64-Support-the-ELFv2-ABI.patch
|
||||
# Please do not add patches manually here, run update_git.sh.
|
||||
|
||||
# roms/ipxe patches
|
||||
@ -520,6 +521,7 @@ This package provides a service file for starting and stopping KSM.
|
||||
%patch0042 -p1
|
||||
%patch0043 -p1
|
||||
%patch0044 -p1
|
||||
%patch0045 -p1
|
||||
|
||||
%patch1000 -p1
|
||||
%patch1001 -p1
|
||||
|
Loading…
Reference in New Issue
Block a user