qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tests/tcg/nios2: Tweak 10m50-ghrd.ld
@ 2022-10-24  3:53 Richard Henderson
  2022-10-24 21:37 ` Alex Bennée
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Henderson @ 2022-10-24  3:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

More closely follow the default linker script for nios2.
This magically fixes a problem resolving .got relocs from
the toolchain's libgcc.a.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1258
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tests/tcg/nios2/10m50-ghrd.ld | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/tests/tcg/nios2/10m50-ghrd.ld b/tests/tcg/nios2/10m50-ghrd.ld
index 7db0d59ad7..71cdda450c 100644
--- a/tests/tcg/nios2/10m50-ghrd.ld
+++ b/tests/tcg/nios2/10m50-ghrd.ld
@@ -44,11 +44,15 @@ SECTIONS
     .data : ALIGN(4) {
         *(.shdata)
         *(.data .data.* .gnu.linkonce.d.*)
-        . = ALIGN(4);
-        _gp = ABSOLUTE(. + 0x8000);
-        *(.got.plt) *(.got)
-        *(.lit8)
-        *(.lit4)
+    } >ram :RAM
+
+    HIDDEN (_gp = ALIGN(16) + 0x7ff0);
+    PROVIDE_HIDDEN (gp = _gp);
+    .got : ALIGN(4) {
+        *(.got.plt) *(.igot.plt) *(.got) *(.igot)
+    } >ram :RAM
+
+    .sdata : ALIGN(4) {
         *(.sdata .sdata.* .gnu.linkonce.s.*)
     } >ram :RAM
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH 00/29] tcg: Fix x86 TARGET_TB_PCREL (#1269)
@ 2022-10-24 13:24 Richard Henderson
  2022-10-24 13:24 ` [PATCH] tests/tcg/nios2: Tweak 10m50-ghrd.ld Richard Henderson
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Henderson @ 2022-10-24 13:24 UTC (permalink / raw)
  To: qemu-devel

As per #1269, this affects NetBSD installer boot.

The problem is that one of the x86 acpi callbacks modifies
env->eip during an mmio store, which means that the tracking
that translate.c does is thrown out of whack.

Introduce a method to extract unwind data without the
writeback to env.  This isn't a perfect abstraction, but I
couldn't think of anything better.  There's a couple of lines
of code duplication, but probably less than any abstration
that we might put on top

Move restore_state_to_opc to a tcg_ops hook.

Remove the last use of cpu_restore_state with will_exit=false
from openrisc, which was on shaky ground already with similar
modifications to translate.c variables.

Remove the will_exit/reset_icount parameters, which are now
always true.


r~


Richard Henderson (29):
  accel/tcg: Add restore_state_to_opc to TCGCPUOps
  target/alpha: Convert to tcg_ops restore_state_to_opc
  target/arm: Convert to tcg_ops restore_state_to_opc
  target/avr: Convert to tcg_ops restore_state_to_opc
  target/cris: Convert to tcg_ops restore_state_to_opc
  target/hexagon: Convert to tcg_ops restore_state_to_opc
  target/hppa: Convert to tcg_ops restore_state_to_opc
  target/i386: Convert to tcg_ops restore_state_to_opc
  target/loongarch: Convert to tcg_ops restore_state_to_opc
  target/m68k: Convert to tcg_ops restore_state_to_opc
  target/microblaze: Convert to tcg_ops restore_state_to_opc
  target/mips: Convert to tcg_ops restore_state_to_opc
  target/nios2: Convert to tcg_ops restore_state_to_opc
  target/openrisc: Convert to tcg_ops restore_state_to_opc
  target/ppc: Convert to tcg_ops restore_state_to_opc
  target/riscv: Convert to tcg_ops restore_state_to_opc
  target/rx: Convert to tcg_ops restore_state_to_opc
  target/s390x: Convert to tcg_ops restore_state_to_opc
  target/sh4: Convert to tcg_ops restore_state_to_opc
  target/sparc: Convert to tcg_ops restore_state_to_opc
  target/tricore: Convert to tcg_ops restore_state_to_opc
  target/xtensa: Convert to tcg_ops restore_state_to_opc
  accel/tcg: Remove restore_state_to_opc function
  accel/tcg: Introduce cpu_unwind_state_data
  target/i386: Use cpu_unwind_state_data for tpr access
  target/openrisc: Always exit after mtspr npc
  target/openrisc: Use cpu_unwind_state_data for mfspr
  accel/tcg: Remove will_exit argument from cpu_restore_state
  accel/tcg: Remove reset_icount argument from cpu_restore_state_from_tb

 include/exec/exec-all.h             | 23 +++++---
 include/hw/core/tcg-cpu-ops.h       | 11 ++++
 target/mips/tcg/tcg-internal.h      |  3 +
 target/s390x/s390x-internal.h       |  4 +-
 target/sparc/cpu.h                  |  3 +
 accel/tcg/cpu-exec-common.c         |  2 +-
 accel/tcg/translate-all.c           | 87 ++++++++++++++++++-----------
 target/alpha/cpu.c                  |  9 +++
 target/alpha/helper.c               |  2 +-
 target/alpha/mem_helper.c           |  2 +-
 target/alpha/translate.c            |  6 --
 target/arm/cpu.c                    | 26 +++++++++
 target/arm/op_helper.c              |  2 +-
 target/arm/tlb_helper.c             |  8 +--
 target/arm/translate.c              | 22 --------
 target/avr/cpu.c                    | 11 ++++
 target/avr/translate.c              |  6 --
 target/cris/cpu.c                   | 11 ++++
 target/cris/helper.c                |  2 +-
 target/cris/translate.c             |  6 --
 target/hexagon/cpu.c                |  9 ++-
 target/hppa/cpu.c                   | 19 +++++++
 target/hppa/translate.c             | 13 -----
 target/i386/helper.c                | 21 ++++++-
 target/i386/tcg/sysemu/svm_helper.c |  2 +-
 target/i386/tcg/tcg-cpu.c           | 19 +++++++
 target/i386/tcg/translate.c         | 15 -----
 target/loongarch/cpu.c              | 11 ++++
 target/loongarch/translate.c        |  6 --
 target/m68k/cpu.c                   | 14 +++++
 target/m68k/op_helper.c             |  4 +-
 target/m68k/translate.c             | 10 ----
 target/microblaze/cpu.c             | 11 ++++
 target/microblaze/helper.c          |  2 +-
 target/microblaze/translate.c       |  7 ---
 target/mips/cpu.c                   |  1 +
 target/mips/tcg/translate.c         |  8 ++-
 target/nios2/cpu.c                  | 11 ++++
 target/nios2/op_helper.c            |  2 +-
 target/nios2/translate.c            |  6 --
 target/openrisc/cpu.c               | 13 +++++
 target/openrisc/sys_helper.c        | 17 ++++--
 target/openrisc/translate.c         | 10 ----
 target/ppc/cpu_init.c               | 10 ++++
 target/ppc/excp_helper.c            |  2 +-
 target/ppc/translate.c              |  6 --
 target/riscv/cpu.c                  |  9 ++-
 target/rx/cpu.c                     | 10 ++++
 target/rx/translate.c               |  6 --
 target/s390x/cpu.c                  |  1 +
 target/s390x/tcg/excp_helper.c      |  2 +-
 target/s390x/tcg/translate.c        |  7 ++-
 target/sh4/cpu.c                    | 16 ++++++
 target/sh4/translate.c              | 10 ----
 target/sparc/cpu.c                  |  1 +
 target/sparc/translate.c            |  7 ++-
 target/tricore/cpu.c                | 11 ++++
 target/tricore/op_helper.c          |  2 +-
 target/tricore/translate.c          |  6 --
 target/xtensa/cpu.c                 | 10 ++++
 target/xtensa/helper.c              |  6 +-
 target/xtensa/translate.c           |  6 --
 62 files changed, 386 insertions(+), 219 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-25  9:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-24  3:53 [PATCH] tests/tcg/nios2: Tweak 10m50-ghrd.ld Richard Henderson
2022-10-24 21:37 ` Alex Bennée
  -- strict thread matches above, loose matches on Subject: below --
2022-10-24 13:24 [PATCH 00/29] tcg: Fix x86 TARGET_TB_PCREL (#1269) Richard Henderson
2022-10-24 13:24 ` [PATCH] tests/tcg/nios2: Tweak 10m50-ghrd.ld Richard Henderson
2022-10-25  9:12   ` Claudio Fontana

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).