From: Sergey Fedorov <serge.fdrv@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-arm] [PATCH] target-arm: Fix and improve AA32 singlestep translation completion code
Date: Thu, 26 Nov 2015 15:43:37 +0300 [thread overview]
Message-ID: <5656FE79.6000308@gmail.com> (raw)
In-Reply-To: <CAFEAcA-D4ZYKqGEe9ySuBe+9nPQVah77VqwkTTDWiCOZDdR24g@mail.gmail.com>
On 26.11.2015 15:33, Peter Maydell wrote:
> On 25 November 2015 at 18:02, Sergey Fedorov <serge.fdrv@gmail.com> wrote:
>> The AArch32 translation completion code for singlestep enabled/active
>> case was a way more confusing and too repetitive then it needs to be.
>> Probably that was the cause for a bug to be introduced into it at some
>> point. The bug was that SWI/HVC/SMC exception would be generated in
>> condition-failed instruction code path whereas it shouldn't.
> So I did some testing, and I think this is a bug that's not actually
> really visible to Linux guests. For both QEMU's gdbstub and for gdb
> running within a system emulation, gdb for 32-bit ARM will prefer to
> do singlestep via setting breakpoints rather than trying to use the
> gdbstub's singlestep command. So while we should definitely fix it
> (and the code cleanup is nice) I think we don't need to do this for 2.5,
> and I'm going to put this on my review-for-2.6 list. Do you agree?
Sure, that's okay. I just wanted to finish this before I move on to
something else.
BTW, I used the following quick-and-dirty Perl script to do testing (it
was helpful to detect some bugs in my first attempts):
#!/usr/bin/perl
use strict;
use warnings;
use IO::Socket::INET;
our $addr = 'localhost:1234';
sub recv_pack {
my $sock = shift;
my $c = $sock->getc() || die();
if ($c eq '+') {
return $c;
}
if ($c eq '-') {
die;
}
if ($c eq '$') {
my $packet = $c;
while (($c = $sock->getc()) ne '#') {
defined($c) || die();
$packet .= $c;
}
$sock->getc();
$sock->getc();
$sock->print('+') || die();
return $packet;
}
return "";
}
sub wait_ack {
my $sock = shift;
my $pack = recv_pack($sock);
while ($pack ne "+") {
$pack = recv_pack($sock);
}
}
sub send_pack {
my $sock = shift;
my $packet = shift;
my $sum = unpack("%8C*", $packet);
$packet = '$' . $packet . '#' . sprintf("%hhx", $sum);
$sock->print($packet) || die();
wait_ack($sock);
}
our $sock = IO::Socket::INET->new($addr) || die();
our $quit = 0;
$SIG{INT} = sub { $quit = 1; };
my $nr_packets = 0;
while (!$quit) {
send_pack($sock, 's');
recv_pack($sock);
printf("\r%d packets sent", ++$nr_packets);
STDOUT->flush();
}
print("\n");
send_pack($sock, 'c');
Best regards,
Sergey
WARNING: multiple messages have this Message-ID (diff)
From: Sergey Fedorov <serge.fdrv@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] target-arm: Fix and improve AA32 singlestep translation completion code
Date: Thu, 26 Nov 2015 15:43:37 +0300 [thread overview]
Message-ID: <5656FE79.6000308@gmail.com> (raw)
In-Reply-To: <CAFEAcA-D4ZYKqGEe9ySuBe+9nPQVah77VqwkTTDWiCOZDdR24g@mail.gmail.com>
On 26.11.2015 15:33, Peter Maydell wrote:
> On 25 November 2015 at 18:02, Sergey Fedorov <serge.fdrv@gmail.com> wrote:
>> The AArch32 translation completion code for singlestep enabled/active
>> case was a way more confusing and too repetitive then it needs to be.
>> Probably that was the cause for a bug to be introduced into it at some
>> point. The bug was that SWI/HVC/SMC exception would be generated in
>> condition-failed instruction code path whereas it shouldn't.
> So I did some testing, and I think this is a bug that's not actually
> really visible to Linux guests. For both QEMU's gdbstub and for gdb
> running within a system emulation, gdb for 32-bit ARM will prefer to
> do singlestep via setting breakpoints rather than trying to use the
> gdbstub's singlestep command. So while we should definitely fix it
> (and the code cleanup is nice) I think we don't need to do this for 2.5,
> and I'm going to put this on my review-for-2.6 list. Do you agree?
Sure, that's okay. I just wanted to finish this before I move on to
something else.
BTW, I used the following quick-and-dirty Perl script to do testing (it
was helpful to detect some bugs in my first attempts):
#!/usr/bin/perl
use strict;
use warnings;
use IO::Socket::INET;
our $addr = 'localhost:1234';
sub recv_pack {
my $sock = shift;
my $c = $sock->getc() || die();
if ($c eq '+') {
return $c;
}
if ($c eq '-') {
die;
}
if ($c eq '$') {
my $packet = $c;
while (($c = $sock->getc()) ne '#') {
defined($c) || die();
$packet .= $c;
}
$sock->getc();
$sock->getc();
$sock->print('+') || die();
return $packet;
}
return "";
}
sub wait_ack {
my $sock = shift;
my $pack = recv_pack($sock);
while ($pack ne "+") {
$pack = recv_pack($sock);
}
}
sub send_pack {
my $sock = shift;
my $packet = shift;
my $sum = unpack("%8C*", $packet);
$packet = '$' . $packet . '#' . sprintf("%hhx", $sum);
$sock->print($packet) || die();
wait_ack($sock);
}
our $sock = IO::Socket::INET->new($addr) || die();
our $quit = 0;
$SIG{INT} = sub { $quit = 1; };
my $nr_packets = 0;
while (!$quit) {
send_pack($sock, 's');
recv_pack($sock);
printf("\r%d packets sent", ++$nr_packets);
STDOUT->flush();
}
print("\n");
send_pack($sock, 'c');
Best regards,
Sergey
next prev parent reply other threads:[~2015-11-26 12:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-25 18:02 [Qemu-devel] [PATCH] target-arm: Fix and improve AA32 singlestep translation completion code Sergey Fedorov
2015-11-26 12:33 ` [Qemu-arm] " Peter Maydell
2015-11-26 12:33 ` [Qemu-devel] " Peter Maydell
2015-11-26 12:43 ` Sergey Fedorov [this message]
2015-11-26 12:43 ` Sergey Fedorov
2015-12-15 18:03 ` [Qemu-arm] " Peter Maydell
2015-12-15 18:03 ` [Qemu-devel] " Peter Maydell
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=5656FE79.6000308@gmail.com \
--to=serge.fdrv@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.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 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.