[PATCH v2 0/6] tcg: Fix x86 TARGET_TB_PCREL (#1269)

Richard Henderson posted 6 patches 1 year, 6 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20221027100254.215253-1-richard.henderson@linaro.org
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Eduardo Habkost <eduardo@habkost.net>, Laurent Vivier <laurent@vivier.eu>, Chris Wulff <crwulff@gmail.com>, Marek Vasut <marex@denx.de>, Stafford Horne <shorne@gmail.com>, Daniel Henrique Barboza <danielhb413@gmail.com>, "Cédric Le Goater" <clg@kaod.org>, David Gibson <david@gibson.dropbear.id.au>, Greg Kurz <groug@kaod.org>, David Hildenbrand <david@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Thomas Huth <thuth@redhat.com>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Max Filippov <jcmvbkbc@gmail.com>
accel/tcg/internal.h                |  4 +-
include/exec/exec-all.h             | 24 +++++---
accel/tcg/cpu-exec-common.c         |  2 +-
accel/tcg/tb-maint.c                |  4 +-
accel/tcg/translate-all.c           | 91 +++++++++++++++++------------
target/alpha/helper.c               |  2 +-
target/alpha/mem_helper.c           |  2 +-
target/arm/op_helper.c              |  2 +-
target/arm/tlb_helper.c             |  8 +--
target/cris/helper.c                |  2 +-
target/i386/helper.c                | 21 ++++++-
target/i386/tcg/sysemu/svm_helper.c |  2 +-
target/m68k/op_helper.c             |  4 +-
target/microblaze/helper.c          |  2 +-
target/nios2/op_helper.c            |  2 +-
target/openrisc/sys_helper.c        | 17 ++++--
target/ppc/excp_helper.c            |  2 +-
target/s390x/tcg/excp_helper.c      |  2 +-
target/tricore/op_helper.c          |  2 +-
target/xtensa/helper.c              |  6 +-
20 files changed, 125 insertions(+), 76 deletions(-)
[PATCH v2 0/6] tcg: Fix x86 TARGET_TB_PCREL (#1269)
Posted by Richard Henderson 1 year, 6 months ago
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

Changes for v2:
  * Rebase on master, 23 patches merged.
  * Comments adjusted per review (claudio)


r~


Richard Henderson (6):
  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

 accel/tcg/internal.h                |  4 +-
 include/exec/exec-all.h             | 24 +++++---
 accel/tcg/cpu-exec-common.c         |  2 +-
 accel/tcg/tb-maint.c                |  4 +-
 accel/tcg/translate-all.c           | 91 +++++++++++++++++------------
 target/alpha/helper.c               |  2 +-
 target/alpha/mem_helper.c           |  2 +-
 target/arm/op_helper.c              |  2 +-
 target/arm/tlb_helper.c             |  8 +--
 target/cris/helper.c                |  2 +-
 target/i386/helper.c                | 21 ++++++-
 target/i386/tcg/sysemu/svm_helper.c |  2 +-
 target/m68k/op_helper.c             |  4 +-
 target/microblaze/helper.c          |  2 +-
 target/nios2/op_helper.c            |  2 +-
 target/openrisc/sys_helper.c        | 17 ++++--
 target/ppc/excp_helper.c            |  2 +-
 target/s390x/tcg/excp_helper.c      |  2 +-
 target/tricore/op_helper.c          |  2 +-
 target/xtensa/helper.c              |  6 +-
 20 files changed, 125 insertions(+), 76 deletions(-)

-- 
2.34.1
Re: [PATCH v2 0/6] tcg: Fix x86 TARGET_TB_PCREL (#1269)
Posted by Richard Henderson 1 year, 6 months ago
On 10/27/22 21:02, Richard Henderson wrote:
> 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
> 
> Changes for v2:
>    * Rebase on master, 23 patches merged.
>    * Comments adjusted per review (claudio)
> 
> 
> r~

Queuing to tcg-next.


r~