All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
To: Claudio Fontana <claudio.fontana@huawei.com>
Cc: Edgar Iglesias <edgari@xilinx.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	claudio.fontana@gmail.com,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>,
	Alexander Graf <agraf@suse.de>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	Peter Crosthwaite <crosthwaitepeter@gmail.com>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 7/7] disas: arm: Use target_disas impl for monitor
Date: Tue, 5 May 2015 09:48:02 -0700	[thread overview]
Message-ID: <CAEgOgz7vpo_ouYKBmOnPmyhPTH6wLtECbttZco+ZyDf68Mx4uA@mail.gmail.com> (raw)
In-Reply-To: <5548D5EA.5070302@huawei.com>

On Tue, May 5, 2015 at 7:38 AM, Claudio Fontana
<claudio.fontana@huawei.com> wrote:
> Hello Peter,
>
> On 05.05.2015 06:45, Peter Crosthwaite wrote:
>> As it is more fully featured. It has multi-endian, thumb and AArch64
>> support whereas the existing monitor disas support only has vanilla
>> AA32 support.
>>
>> E.G. Running an AA64 linux kernel the follow -d in_asm disas happens
>> (taget_disas()):
>>
>> IN:
>> 0x0000000040000000:  580000c0      ldr x0, pc+24 (addr 0x40000018)
>> 0x0000000040000004:  aa1f03e1      mov x1, xzr
>>
>> However before this patch, disasing the same from the monitor:
>>
>> (qemu) xp/i 0x40000000
>> 0x0000000040000000:  580000c0      stmdapl  r0, {r6, r7}
>>
>> After this patch:
>> (qemu) xp/i 0x40000000
>> 0x0000000040000000:  580000c0      ldr x0, pc+24 (addr 0x40000018)
>>
>> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
>> ---
>>  disas.c | 48 +++++++++++++++++++++++-------------------------
>>  1 file changed, 23 insertions(+), 25 deletions(-)
>>
>> diff --git a/disas.c b/disas.c
>> index 498b05f..e1da40d 100644
>> --- a/disas.c
>> +++ b/disas.c
>> @@ -208,6 +208,27 @@ target_disas_set_info(int (**print_insn)(bfd_vma pc, disassemble_info *info),
>>          s->info.mach = bfd_mach_i386_i386;
>>      }
>>      *print_insn = print_insn_i386;
>> +#elif defined(TARGET_ARM)
>> +    if (flags & 4) {
>> +        /* We might not be compiled with the A64 disassembler
>> +        * because it needs a C++ compiler; in that case we will
>
> nit: misaligned * (add one space)
>

Will fix.

> for all the rest, I didn't notice any problems.
>

Thanks for the test.

> Regarding the libvixl output, I still have a lot of unimplemented instructions..
> is it possible to improve libvixl to dissect system instructions?
> I guess this question is more for the libvixl project itself.
>

So my project (and coding time) is currently going is a different
direction. My main motivation here is to QOMify the disas code path to
remove the target specific compilation of the disaser. This series is
the minimal cleanup and functional changes before diving into the
bigger refactor.

Is the GSOC event happening again and should we list this as a project?

Regards,
Peter

> Looking at my disassembly I just tested I have:
>
> 0x00000000400d08a0:   d50342df      unimplemented (System)
> 0x00000000400d08a4:   d5033fdf      isb
> 0x00000000400d08a8:   d503207f      unimplemented (System)
> 0x00000000400d08ac:   d503207f      unimplemented (System)
>
> Tested-by: Claudio Fontana <claudio.fontana@huawei.com>
> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com>
>
>> +         * fall through to the default print_insn_od case.
>> +         */
>> +#if defined(CONFIG_ARM_A64_DIS)
>> +        *print_insn = print_insn_arm_a64;
>> +#endif
>> +    } else if (flags & 1) {
>> +        *print_insn = print_insn_thumb1;
>> +    } else {
>> +        *print_insn = print_insn_arm;
>> +    }
>> +    if (flags & 2) {
>> +#ifdef TARGET_WORDS_BIGENDIAN
>> +        s->info.endian = BFD_ENDIAN_LITTLE;
>> +#else
>> +        s->info.endian = BFD_ENDIAN_BIG;
>> +#endif
>> +    }
>>  #elif defined(TARGET_SPARC)
>>      *print_insn = print_insn_sparc;
>>  #ifdef TARGET_SPARC64
>> @@ -271,28 +292,7 @@ void target_disas(FILE *out, CPUArchState *env, target_ulong code,
>>      s.info.buffer_vma = code;
>>      s.info.buffer_length = size;
>>
>> -#if defined(TARGET_ARM)
>> -    if (flags & 4) {
>> -        /* We might not be compiled with the A64 disassembler
>> -         * because it needs a C++ compiler; in that case we will
>> -         * fall through to the default print_insn_od case.
>> -         */
>> -#if defined(CONFIG_ARM_A64_DIS)
>> -        print_insn = print_insn_arm_a64;
>> -#endif
>> -    } else if (flags & 1) {
>> -        print_insn = print_insn_thumb1;
>> -    } else {
>> -        print_insn = print_insn_arm;
>> -    }
>> -    if (flags & 2) {
>> -#ifdef TARGET_WORDS_BIGENDIAN
>> -        s.info.endian = BFD_ENDIAN_LITTLE;
>> -#else
>> -        s.info.endian = BFD_ENDIAN_BIG;
>> -#endif
>> -    }
>> -#elif defined(TARGET_PPC)
>> +#if defined(TARGET_PPC)
>>      if ((flags >> 16) & 1) {
>>          s.info.endian = BFD_ENDIAN_LITTLE;
>>      }
>> @@ -475,9 +475,7 @@ void monitor_disas(Monitor *mon, CPUArchState *env,
>>
>>      s.info.buffer_vma = pc;
>>
>> -#if defined(TARGET_ARM)
>> -    print_insn = print_insn_arm;
>> -#elif defined(TARGET_ALPHA)
>> +#if defined(TARGET_ALPHA)
>>      print_insn = print_insn_alpha;
>>  #elif defined(TARGET_PPC)
>>      if (flags & 0xFFFF) {
>>
>
>
> --
> Claudio Fontana
> Server Virtualization Architect
> Huawei Technologies Duesseldorf GmbH
> Riesstraße 25 - 80992 München
>
>

  reply	other threads:[~2015-05-05 16:48 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-05  4:44 [Qemu-devel] [PATCH 0/7] disas: Unify target_disas and monitor_disas Peter Crosthwaite
2015-05-05  4:44 ` [Qemu-devel] [PATCH 1/7] disas: Create factored out fn for monitor and target disas Peter Crosthwaite
2015-05-05 14:45   ` Claudio Fontana
2015-05-05  4:44 ` [Qemu-devel] [PATCH 2/7] disas: microblaze: Migrate setup to common code Peter Crosthwaite
2015-05-05  4:45 ` [Qemu-devel] [PATCH 3/7] disas: cris: Fix 0 buffer length case Peter Crosthwaite
2015-05-05  4:45 ` [Qemu-devel] [PATCH 4/7] disas: cris: Migrate setup to common code Peter Crosthwaite
2015-05-05  4:45 ` [Qemu-devel] [PATCH 5/7] disas: arm-a64: Make printfer and stream variable Peter Crosthwaite
2015-05-05 14:41   ` Claudio Fontana
2015-05-05 17:22   ` Richard Henderson
2015-05-05  4:45 ` [Qemu-devel] [PATCH 6/7] monitor: "i": Add ARM specifics Peter Crosthwaite
2015-05-05 14:40   ` Claudio Fontana
2015-05-05 17:19   ` Peter Maydell
2015-05-05 17:43     ` Richard Henderson
2015-05-06  6:57       ` Peter Crosthwaite
2015-05-06 13:57         ` Richard Henderson
2015-05-06  7:06       ` Peter Crosthwaite
2015-05-06 14:12         ` Richard Henderson
2015-05-06 14:17           ` Paolo Bonzini
2015-05-06 14:32             ` Stefano Stabellini
2015-05-06 15:44           ` Peter Maydell
2015-05-06 18:24             ` Richard Henderson
2015-05-06 18:39               ` Peter Maydell
2015-05-05  4:45 ` [Qemu-devel] [PATCH 7/7] disas: arm: Use target_disas impl for monitor Peter Crosthwaite
2015-05-05 14:38   ` Claudio Fontana
2015-05-05 16:48     ` Peter Crosthwaite [this message]
2015-05-05 17:18 ` [Qemu-devel] [PATCH 0/7] disas: Unify target_disas and monitor_disas Richard Henderson

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=CAEgOgz7vpo_ouYKBmOnPmyhPTH6wLtECbttZco+ZyDf68Mx4uA@mail.gmail.com \
    --to=peter.crosthwaite@xilinx.com \
    --cc=agraf@suse.de \
    --cc=claudio.fontana@gmail.com \
    --cc=claudio.fontana@huawei.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=crosthwaitepeter@gmail.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=edgari@xilinx.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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.