All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Sergey Fedorov <serge.fdrv@gmail.com>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Anthony Green <green@moxielogic.com>,
	Alexander Graf <agraf@suse.de>, Max Filippov <jcmvbkbc@gmail.com>,
	Michael Walle <michael@walle.cc>,
	qemu-arm@nongnu.org, qemu-ppc@nongnu.org,
	Paolo Bonzini <pbonzini@redhat.com>,
	Guan Xuetao <gxt@mprc.pku.edu.cn>,
	Leon Alrae <leon.alrae@imgtec.com>,
	Aurelien Jarno <aurelien@aurel32.net>, Jia Liu <proljc@gmail.com>
Subject: Re: [Qemu-arm] [Qemu-devel] [PATCH] target-*: Get rid of "PC advancement" trick
Date: Fri, 11 Dec 2015 15:39:10 -0800	[thread overview]
Message-ID: <566B5E9E.8040108@twiddle.net> (raw)
In-Reply-To: <1449773244-17078-1-git-send-email-serge.fdrv@gmail.com>

On 12/10/2015 10:47 AM, Sergey Fedorov wrote:
> The "PC advancement" trick was used just after recognizing that a
> breakpoint exception was going to be generated. This trick has had two
> points:
>   1. Guarantee that tb->size isn't zero: there are many places where it's
>      expected to be non-zero. In fact, that is even stated in the comment
>      for this field.
>   2. Try to satisfy disassembler's check for instruction length. To this
>      end, PC advancement was done for estimated instruction length, but
>      actually, didn't work properly in variable-instruction-length cases.
>
> Substitute this trick with checking for TB size at the end of
> translation. If we get an empty TB then just set tb->size to 1 and skip
> disassembling. Setting tb->size to 1 is enough to get correct behaviour,
> whereas an empty TB doesn't obviously need to be disassembled.

This doesn't help when the TB already has instructions, the TB would ordinarily 
cross a page boundary, and the breakpoint is at the page boundary.


r~

WARNING: multiple messages have this Message-ID (diff)
From: Richard Henderson <rth@twiddle.net>
To: Sergey Fedorov <serge.fdrv@gmail.com>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Anthony Green <green@moxielogic.com>,
	Alexander Graf <agraf@suse.de>, Max Filippov <jcmvbkbc@gmail.com>,
	Michael Walle <michael@walle.cc>,
	qemu-arm@nongnu.org, qemu-ppc@nongnu.org,
	Paolo Bonzini <pbonzini@redhat.com>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Guan Xuetao <gxt@mprc.pku.edu.cn>,
	Leon Alrae <leon.alrae@imgtec.com>,
	Aurelien Jarno <aurelien@aurel32.net>, Jia Liu <proljc@gmail.com>
Subject: Re: [Qemu-devel] [PATCH] target-*: Get rid of "PC advancement" trick
Date: Fri, 11 Dec 2015 15:39:10 -0800	[thread overview]
Message-ID: <566B5E9E.8040108@twiddle.net> (raw)
In-Reply-To: <1449773244-17078-1-git-send-email-serge.fdrv@gmail.com>

On 12/10/2015 10:47 AM, Sergey Fedorov wrote:
> The "PC advancement" trick was used just after recognizing that a
> breakpoint exception was going to be generated. This trick has had two
> points:
>   1. Guarantee that tb->size isn't zero: there are many places where it's
>      expected to be non-zero. In fact, that is even stated in the comment
>      for this field.
>   2. Try to satisfy disassembler's check for instruction length. To this
>      end, PC advancement was done for estimated instruction length, but
>      actually, didn't work properly in variable-instruction-length cases.
>
> Substitute this trick with checking for TB size at the end of
> translation. If we get an empty TB then just set tb->size to 1 and skip
> disassembling. Setting tb->size to 1 is enough to get correct behaviour,
> whereas an empty TB doesn't obviously need to be disassembled.

This doesn't help when the TB already has instructions, the TB would ordinarily 
cross a page boundary, and the breakpoint is at the page boundary.


r~

  reply	other threads:[~2015-12-11 23:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-10 18:47 [Qemu-devel] [PATCH] target-*: Get rid of "PC advancement" trick Sergey Fedorov
2015-12-11 23:39 ` Richard Henderson [this message]
2015-12-11 23:39   ` Richard Henderson
2015-12-12 20:02   ` [Qemu-arm] " Sergey Fedorov
2015-12-12 20:02     ` Sergey Fedorov
2015-12-14 16:19     ` [Qemu-arm] " Richard Henderson
2015-12-14 16:19       ` Richard Henderson
2015-12-15 21:02       ` [Qemu-arm] " Sergey Fedorov
2015-12-15 21:02         ` Sergey Fedorov
2015-12-16 17:03         ` [Qemu-arm] " Richard Henderson
2015-12-16 17:03           ` Richard Henderson
2015-12-16 21:13           ` [Qemu-arm] " Sergey Fedorov
2015-12-16 21:13             ` Sergey Fedorov

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=566B5E9E.8040108@twiddle.net \
    --to=rth@twiddle.net \
    --cc=agraf@suse.de \
    --cc=aurelien@aurel32.net \
    --cc=ehabkost@redhat.com \
    --cc=green@moxielogic.com \
    --cc=gxt@mprc.pku.edu.cn \
    --cc=jcmvbkbc@gmail.com \
    --cc=leon.alrae@imgtec.com \
    --cc=michael@walle.cc \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=proljc@gmail.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=serge.fdrv@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.