qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] disas: Add LoongArch support
@ 2022-08-04 17:29 Qi Hu
  2022-08-04 18:08 ` Peter Maydell
  2022-08-04 18:23 ` Richard Henderson
  0 siblings, 2 replies; 4+ messages in thread
From: Qi Hu @ 2022-08-04 17:29 UTC (permalink / raw)
  To: Thomas Huth, Richard Henderson, Marc-André Lureau,
	Paolo Bonzini
  Cc: Song Gao, Xiaojuan Yang, qemu-devel

Signed-off-by: Qi Hu <huqi@loongson.cn>
---
 disas.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/disas.c b/disas.c
index e31438f349..d44feeee46 100644
--- a/disas.c
+++ b/disas.c
@@ -176,6 +176,8 @@ static void initialize_debug_host(CPUDebug *s)
 #else
 #error unsupported RISC-V ABI
 #endif
+#elif defined(__loongarch__)
+    s->info.print_insn = print_insn_loongarch;
 #elif defined(__aarch64__)
     s->info.cap_arch = CS_ARCH_ARM64;
 #elif defined(__alpha__)
-- 
2.37.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] disas: Add LoongArch support
  2022-08-04 17:29 [PATCH] disas: Add LoongArch support Qi Hu
@ 2022-08-04 18:08 ` Peter Maydell
  2022-08-04 18:23 ` Richard Henderson
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2022-08-04 18:08 UTC (permalink / raw)
  To: Qi Hu
  Cc: Thomas Huth, Richard Henderson, Marc-André Lureau,
	Paolo Bonzini, Song Gao, Xiaojuan Yang, qemu-devel

On Thu, 4 Aug 2022 at 18:32, Qi Hu <huqi@loongson.cn> wrote:
>

More specifically, this is adding support for disassembling
on LoongArch hosts. The handling of disassembling LoongArch
guests is already connected up.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] disas: Add LoongArch support
  2022-08-04 17:29 [PATCH] disas: Add LoongArch support Qi Hu
  2022-08-04 18:08 ` Peter Maydell
@ 2022-08-04 18:23 ` Richard Henderson
  2022-08-06  9:23   ` Qi Hu
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Henderson @ 2022-08-04 18:23 UTC (permalink / raw)
  To: Qi Hu, Thomas Huth, Marc-André Lureau, Paolo Bonzini
  Cc: Song Gao, Xiaojuan Yang, qemu-devel

On 8/4/22 10:29, Qi Hu wrote:
> Signed-off-by: Qi Hu <huqi@loongson.cn>
> ---
>   disas.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/disas.c b/disas.c
> index e31438f349..d44feeee46 100644
> --- a/disas.c
> +++ b/disas.c
> @@ -176,6 +176,8 @@ static void initialize_debug_host(CPUDebug *s)
>   #else
>   #error unsupported RISC-V ABI
>   #endif
> +#elif defined(__loongarch__)
> +    s->info.print_insn = print_insn_loongarch;

This is very much insufficient.  Try --target-list=i386-softmmu and watch it fail to link.
You need to modify the build rules to make certain that the loongarch disassembler is 
built for loongarch host.


r~



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] disas: Add LoongArch support
  2022-08-04 18:23 ` Richard Henderson
@ 2022-08-06  9:23   ` Qi Hu
  0 siblings, 0 replies; 4+ messages in thread
From: Qi Hu @ 2022-08-06  9:23 UTC (permalink / raw)
  To: Richard Henderson, Thomas Huth, Marc-André Lureau,
	Paolo Bonzini
  Cc: Song Gao, Xiaojuan Yang, qemu-devel


On 2022/8/5 02:23, Richard Henderson wrote:
> On 8/4/22 10:29, Qi Hu wrote:
>> Signed-off-by: Qi Hu <huqi@loongson.cn>
>> ---
>>   disas.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/disas.c b/disas.c
>> index e31438f349..d44feeee46 100644
>> --- a/disas.c
>> +++ b/disas.c
>> @@ -176,6 +176,8 @@ static void initialize_debug_host(CPUDebug *s)
>>   #else
>>   #error unsupported RISC-V ABI
>>   #endif
>> +#elif defined(__loongarch__)
>> +    s->info.print_insn = print_insn_loongarch;
>
> This is very much insufficient.  Try --target-list=i386-softmmu and 
> watch it fail to link.
> You need to modify the build rules to make certain that the loongarch 
> disassembler is built for loongarch host.
>
>
> r~

I realized that "target/loongarch/disas.c" is only used for loongarch 
target . When the target is not "loongarch", the function 
"print_insn_loongarch" will not be compiled. Next I will add loongarch 
support to "disams/*".


Thanks.

Qi



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-06  9:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-04 17:29 [PATCH] disas: Add LoongArch support Qi Hu
2022-08-04 18:08 ` Peter Maydell
2022-08-04 18:23 ` Richard Henderson
2022-08-06  9:23   ` Qi Hu

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).