Skip to contentSkip to conversation

buildsys: Only build capstone if softmmu/user mode is enabled

RFC PATCH In review Philippe Mathieu-Daudé 3 participants 7 messages Jul 24, 2020

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 buildsys: Only build capstone if softmmu/user mode is enabled

At least one of softmmu or user mode has to be enabled to use capstone. If not, don't clone/built it.

This save CI time for the tools/documentation-only build jobs.

---
 configure | 4 ++++
 1 file changed, 4 insertions(+)
configure +4 -0
index 4bd80ed507..bc5757159a 100755
@@ -5381,6 +5381,10 @@ fi
 ##########################################
 # capstone
 
+if test -z "$capstone" && test $tcg = 'no' ; then # !tcg implies !softmmu
+  capstone="no"
+fi
+
 case "$capstone" in
   "" | yes)
     if $pkg_config capstone; then
Signature · 1 line
2.21.3
#1 lore raw
Quoted 15 lines · Philippe Mathieu-Daudé

At least one of softmmu or user mode has to be enabled to use capstone. If not, don't clone/built it.

This save CI time for the tools/documentation-only build jobs.

---
 configure | 4 ++++
 1 file changed, 4 insertions(+)
configure +0 -0
index 4bd80ed507..bc5757159a 100755

configure fi · line 5386

Quoted 6 lines
configure +3 -0
@@ -5381,6 +5381,10 @@ fi
 ##########################################
 # capstone
 
+if test -z "$capstone" && test $tcg = 'no' ; then # !tcg implies !softmmu
+  capstone="no"
+fi

I don't think this is right. You could have a KVM-only build where you still want to use the disassembler for the human monitor.

But maybe it could be disabled if softmmu="no", linux_user="no" and bsd_user="no" ?

Thomas

#2 lore raw
Quoted 19 lines · Thomas Huth
Quoted 18 lines · Philippe Mathieu-Daudé

At least one of softmmu or user mode has to be enabled to use capstone. If not, don't clone/built it.

This save CI time for the tools/documentation-only build jobs.

---
 configure | 4 ++++
 1 file changed, 4 insertions(+)
configure +0 -0
index 4bd80ed507..bc5757159a 100755
@@ -5381,6 +5381,10 @@ fi
 ##########################################
 # capstone
 
Quoted 6 lines

configure fi · line 5386

Quoted 3 lines
configure +3 -0
+if test -z "$capstone" && test $tcg = 'no' ; then # !tcg implies !softmmu
+  capstone="no"
+fi

I don't think this is right. You could have a KVM-only build where you still want to use the disassembler for the human monitor.

I had the same question with KVM, I agree this is unclear, this is why I added RFC.

Don't we have !softmmu implies !kvm?

Quoted 7 lines

But maybe it could be disabled if softmmu="no", linux_user="no" and bsd_user="no" ?

Thomas

#3 lore raw
Quoted 27 lines · Philippe Mathieu-Daudé
Quoted 19 lines · Thomas Huth
Quoted 18 lines · Philippe Mathieu-Daudé

At least one of softmmu or user mode has to be enabled to use capstone. If not, don't clone/built it.

This save CI time for the tools/documentation-only build jobs.

---
 configure | 4 ++++
 1 file changed, 4 insertions(+)
configure +0 -0
index 4bd80ed507..bc5757159a 100755
@@ -5381,6 +5381,10 @@ fi
 ##########################################
 # capstone
 
Quoted 6 lines

configure fi · line 5386

Quoted 3 lines
configure +3 -0
+if test -z "$capstone" && test $tcg = 'no' ; then # !tcg implies !softmmu
+  capstone="no"
+fi

I don't think this is right. You could have a KVM-only build where you still want to use the disassembler for the human monitor.

Quoted 4 lines

I had the same question with KVM, I agree this is unclear, this is why I added RFC.

Don't we have !softmmu implies !kvm?

Yes. You can not use KVM with linux-user builds.

But I think it's wrong to test for accelerators here. You could still build a QEMU binary with HVF or HAX and still want to have disassembler support in there.

Thomas

#4 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 27 lines · Philippe Mathieu-Daudé
Quoted 19 lines · Thomas Huth
Quoted 18 lines · Philippe Mathieu-Daudé

At least one of softmmu or user mode has to be enabled to use capstone. If not, don't clone/built it.

This save CI time for the tools/documentation-only build jobs.

---
 configure | 4 ++++
 1 file changed, 4 insertions(+)
configure +0 -0
index 4bd80ed507..bc5757159a 100755
@@ -5381,6 +5381,10 @@ fi
 ##########################################
 # capstone
 
Quoted 6 lines

configure fi · line 5386

Quoted 3 lines
configure +3 -0
+if test -z "$capstone" && test $tcg = 'no' ; then # !tcg implies !softmmu
+  capstone="no"
+fi

I don't think this is right. You could have a KVM-only build where you still want to use the disassembler for the human monitor.

Quoted 4 lines

I had the same question with KVM, I agree this is unclear, this is why I added RFC.

Don't we have !softmmu implies !kvm?

It works because it falls back to the old disas.c (if capstone is here, use it, else fall-back).

Does this means we can directly remove the capstone experiment & submodule without waiting for the libllvm integration?

Quoted 9 lines
Quoted 8 lines

But maybe it could be disabled if softmmu="no", linux_user="no" and bsd_user="no" ?

Thomas

#5 lore raw
Quoted 19 lines · Philippe Mathieu-Daudé
Quoted 17 lines · Philippe Mathieu-Daudé
Quoted 4 lines · Thomas Huth
Quoted 3 lines · Philippe Mathieu-Daudé

At least one of softmmu or user mode has to be enabled to use capstone. If not, don't clone/built it.

Quoted 8 lines

configure fi · line 5386

Quoted 5 lines

This save CI time for the tools/documentation-only build jobs.

configure +3 -0
+if test -z "$capstone" && test $tcg = 'no' ; then # !tcg implies !softmmu
+  capstone="no"
+fi

I don't think this is right. You could have a KVM-only build where you still want to use the disassembler for the human monitor.

I had the same question with KVM, I agree this is unclear, this is why I added RFC.

Quoted 7 lines
Quoted 1 line

Don't we have !softmmu implies !kvm?

It works because it falls back to the old disas.c (if capstone is here, use it, else fall-back).

Does this means we can directly remove the capstone experiment & submodule without waiting for the libllvm integration?

The theory (at least at the time) was that capstone was better than the internal disassembler for at least some targets. If we want to go from libllvm to capstone as our long term plan that's cool, but until we actually do that I don't think we should drop capstone.

As far as this patch goes: if you want to disable capstone for the tools-and-docs-only setup then I think the right condition is if [ "$bsd_user" = "no" -a "$linux_user" = "no" -a "$softmmu" = "no" ] ; then
capstone=no
fi

thanks
-- PMM

#6 lore raw
Quoted 28 lines · Peter Maydell
Quoted 19 lines · Philippe Mathieu-Daudé
Quoted 17 lines · Philippe Mathieu-Daudé
Quoted 4 lines · Thomas Huth
Quoted 3 lines · Philippe Mathieu-Daudé

At least one of softmmu or user mode has to be enabled to use capstone. If not, don't clone/built it.

Quoted 8 lines

configure fi · line 5386

Quoted 5 lines

This save CI time for the tools/documentation-only build jobs.

configure +3 -0
+if test -z "$capstone" && test $tcg = 'no' ; then # !tcg implies !softmmu
+  capstone="no"
+fi

I don't think this is right. You could have a KVM-only build where you still want to use the disassembler for the human monitor.

I had the same question with KVM, I agree this is unclear, this is why I added RFC.

Quoted 7 lines
Quoted 1 line

Don't we have !softmmu implies !kvm?

It works because it falls back to the old disas.c (if capstone is here, use it, else fall-back).

Does this means we can directly remove the capstone experiment & submodule without waiting for the libllvm integration?

Quoted 8 lines

The theory (at least at the time) was that capstone was better than the internal disassembler for at least some targets. If we want to go from libllvm to capstone as our long term plan that's cool, but until we actually do that I don't think we should drop capstone.

As far as this patch goes: if you want to disable capstone for the tools-and-docs-only setup

This is also useful for a job downloading CI prerequisite artifacts.

Quoted 4 lines

then I think the right condition is
if [ "$bsd_user" = "no" -a "$linux_user" = "no" -a "$softmmu" = "no" ] ; then
capstone=no
fi

OK, thanks!

Quoted 4 lines

thanks
-- PMM