qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, alex.bennee@linaro.org, f4bug@amsat.org
Subject: Re: [PATCH 00/17] tcg: breakpoint reorg
Date: Sat, 3 Jul 2021 08:00:22 +0100	[thread overview]
Message-ID: <212cc77c-228d-1fae-f556-dabafd58a594@ilande.co.uk> (raw)
In-Reply-To: <20210701152537.3330420-1-richard.henderson@linaro.org>

On 01/07/2021 16:25, Richard Henderson wrote:

> Based-on: <20210630183226.3290849-1-richard.henderson@linaro.org>
> ("[PATCH v2 00/28] accel/tcg: Introduce translator_use_goto_tb")
> 
> This is my attempt at fixing #404 ("windows xp boot takes much longer...").
> 
> I don't actually have windows xp available myself, so I don't know
> if this has worked, really.  I can still boot windows 7, but from
> the lack of tracepoint firings I guess it doesn't play any silly
> games with breakpoints.
> 
> This scheme is not without its drawbacks.  In exchange for no bookkeeping
> and invalidation whatsoever, other code on the same page as an active
> breakpoint runs one insn per tb, doing indirect chaining through
> helper_lookup_tb_ptr to see if we hit the breakpoint.
> 
> The minor testing that I did seemed fast enough though, with gdb
> responding quickly.  So before I go off and try to complicate
> things again with extra bookkeeping, I thought I'd get some feedback.
> 
> 
> r~
> 
> 
> Richard Henderson (17):
>    target/i386: Use cpu_breakpoint_test in breakpoint_handler
>    accel/tcg: Move helper_lookup_tb_ptr to cpu-exec.c
>    accel/tcg: Move tb_lookup to cpu-exec.c
>    accel/tcg: Split out log_cpu_exec
>    accel/tcg: Log tb->cflags with -d exec
>    tcg: Remove TCG_TARGET_HAS_goto_ptr
>    accel/tcg: Reduce CF_COUNT_MASK to match TCG_MAX_INSNS
>    accel/tcg: Move curr_cflags into cpu-exec.c
>    accel/tcg: Add CF_NO_GOTO_TB and CF_NO_GOTO_PTR
>    accel/tcg: Drop CF_NO_GOTO_PTR from -d nochain
>    accel/tcg: Handle -singlestep in curr_cflags
>    accel/tcg: Use CF_NO_GOTO_{TB,PTR} in cpu_exec_step_atomic
>    accel/tcg: Move cflags lookup into tb_find
>    accel/tcg: Adjust interface of TranslatorOps.breakpoint_check
>    accel/tcg: Hoist tb_cflags to a local in translator_loop
>    accel/tcg: Encode breakpoint info into tb->cflags
>    cpu: Add breakpoint tracepoints
> 
>   accel/tcg/tb-lookup.h               |  49 ------
>   include/exec/exec-all.h             |  30 ++--
>   include/exec/translator.h           |  17 +-
>   include/tcg/tcg-opc.h               |   3 +-
>   tcg/aarch64/tcg-target.h            |   1 -
>   tcg/arm/tcg-target.h                |   1 -
>   tcg/i386/tcg-target.h               |   1 -
>   tcg/mips/tcg-target.h               |   1 -
>   tcg/ppc/tcg-target.h                |   1 -
>   tcg/riscv/tcg-target.h              |   1 -
>   tcg/s390/tcg-target.h               |   1 -
>   tcg/sparc/tcg-target.h              |   1 -
>   tcg/tci/tcg-target.h                |   1 -
>   accel/tcg/cpu-exec.c                | 238 +++++++++++++++++++++++-----
>   accel/tcg/tcg-runtime.c             |  22 ---
>   accel/tcg/translate-all.c           |   7 +-
>   accel/tcg/translator.c              |  79 ++++++---
>   cpu.c                               |  35 +---
>   target/alpha/translate.c            |  12 +-
>   target/arm/translate-a64.c          |  14 +-
>   target/arm/translate.c              |  20 +--
>   target/avr/translate.c              |   6 +-
>   target/cris/translate.c             |  14 +-
>   target/hexagon/translate.c          |  13 +-
>   target/hppa/translate.c             |   7 +-
>   target/i386/tcg/sysemu/bpt_helper.c |  12 +-
>   target/i386/tcg/translate.c         |  15 +-
>   target/m68k/translate.c             |  14 +-
>   target/microblaze/translate.c       |  14 +-
>   target/mips/tcg/translate.c         |  14 +-
>   target/nios2/translate.c            |  13 +-
>   target/openrisc/translate.c         |  11 +-
>   target/ppc/translate.c              |  13 +-
>   target/riscv/translate.c            |  11 +-
>   target/rx/translate.c               |   8 +-
>   target/s390x/translate.c            |  12 +-
>   target/sh4/translate.c              |  12 +-
>   target/sparc/translate.c            |   9 +-
>   target/tricore/translate.c          |  13 +-
>   target/xtensa/translate.c           |  12 +-
>   tcg/tcg-op.c                        |  28 ++--
>   tcg/tcg.c                           |   8 +-
>   trace-events                        |   5 +
>   43 files changed, 386 insertions(+), 413 deletions(-)
>   delete mode 100644 accel/tcg/tb-lookup.h

Thanks Richard! I grabbed the git tag from patchew and gave it a quick smoke test 
booting a pre-installed WinXP image to the login screen. I've included some extra 
times below for comparison taken from my rather modest laptop:

b55f54bc~1 (i.e. last known good commit): 43s
current master (9c2647f750): 2m 40s
breakpoint reorg patchew tag: 25s(!)

I can certainly report that booting WinXP from the patchew tag is substantially 
faster than both git master and the last known good commit before the TLB flush logic 
was altered, so the initial results are extremely promising.


ATB,

Mark.


      parent reply	other threads:[~2021-07-03  7:02 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01 15:25 [PATCH 00/17] tcg: breakpoint reorg Richard Henderson
2021-07-01 15:25 ` [PATCH 01/17] target/i386: Use cpu_breakpoint_test in breakpoint_handler Richard Henderson
2021-07-01 15:25 ` [PATCH 02/17] accel/tcg: Move helper_lookup_tb_ptr to cpu-exec.c Richard Henderson
2021-07-01 16:33   ` Philippe Mathieu-Daudé
2021-07-01 15:25 ` [PATCH 03/17] accel/tcg: Move tb_lookup " Richard Henderson
2021-07-01 16:34   ` Philippe Mathieu-Daudé
2021-07-01 15:25 ` [PATCH 04/17] accel/tcg: Split out log_cpu_exec Richard Henderson
2021-07-01 15:25 ` [PATCH 05/17] accel/tcg: Log tb->cflags with -d exec Richard Henderson
2021-07-01 16:36   ` Philippe Mathieu-Daudé
2021-07-01 15:25 ` [PATCH 06/17] tcg: Remove TCG_TARGET_HAS_goto_ptr Richard Henderson
2021-07-01 16:37   ` Philippe Mathieu-Daudé
2021-07-01 15:25 ` [PATCH 07/17] accel/tcg: Reduce CF_COUNT_MASK to match TCG_MAX_INSNS Richard Henderson
2021-07-01 15:25 ` [PATCH 08/17] accel/tcg: Move curr_cflags into cpu-exec.c Richard Henderson
2021-07-01 15:25 ` [PATCH 09/17] accel/tcg: Add CF_NO_GOTO_TB and CF_NO_GOTO_PTR Richard Henderson
2021-07-01 15:25 ` [PATCH 10/17] accel/tcg: Drop CF_NO_GOTO_PTR from -d nochain Richard Henderson
2021-07-01 15:25 ` [PATCH 11/17] accel/tcg: Handle -singlestep in curr_cflags Richard Henderson
2021-07-01 15:25 ` [PATCH 12/17] accel/tcg: Use CF_NO_GOTO_{TB, PTR} in cpu_exec_step_atomic Richard Henderson
2021-07-01 15:25 ` [PATCH 13/17] accel/tcg: Move cflags lookup into tb_find Richard Henderson
2021-07-01 15:25 ` [PATCH 14/17] accel/tcg: Adjust interface of TranslatorOps.breakpoint_check Richard Henderson
2021-07-01 15:25 ` [PATCH 15/17] accel/tcg: Hoist tb_cflags to a local in translator_loop Richard Henderson
2021-07-01 15:25 ` [PATCH 16/17] accel/tcg: Encode breakpoint info into tb->cflags Richard Henderson
2021-07-01 15:25 ` [PATCH 17/17] cpu: Add breakpoint tracepoints Richard Henderson
2021-07-01 16:43   ` Philippe Mathieu-Daudé
2021-07-03  7:00 ` Mark Cave-Ayland [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=212cc77c-228d-1fae-f556-dabafd58a594@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=alex.bennee@linaro.org \
    --cc=f4bug@amsat.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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;
as well as URLs for NNTP newsgroup(s).