target/loongarch/kvm: Include missing exec/cpu-defs.h header
PATCH 1/1 target/loongarch/kvm: Include missing exec/cpu-defs.h header
After commit 71cab1a42d2 removed the indirect include of exec/cpu-defs.h from target/loongarch/cpu.h, the TARGET_FMT_lx macro is no longer visible in kvm.c, causing build failures:
error: expected ')' before TARGET_FMT_lx
Add the missing #include exec/cpu-defs.h to restore the TARGET_FMT_lx definition.
--- target/loongarch/kvm/kvm.c | 1 + 1 file changed, 1 insertion(+)
target/loongarch/kvm/kvm.c +1 -0
@@ -6,6 +6,7 @@*/ #include "qemu/osdep.h" +#include "exec/cpu-defs.h" #include <sys/ioctl.h> #include <linux/kvm.h> #include "asm-loongarch/kvm_para.h"
Signature · 1 line
2.51.0
+Philippe,and bibo.
Quoted 19 lines · Qiang Ma
After commit
71cab1a42d2removed the indirect include ofexec/cpu-defs.hfromtarget/loongarch/cpu.h, theTARGET_FMT_lxmacro is no longer visible inkvm.c, causing build failures:error: expected ')' before
TARGET_FMT_lxAdd the missing #include
exec/cpu-defs.hto restore theTARGET_FMT_lxdefinition.Signed-off-by Qiang Ma <[email protected]>--- target/loongarch/kvm/kvm.c | 1 + 1 file changed, 1 insertion(+)target/loongarch/kvm/kvm.c +0
-0
target/loongarch/kvm/kvm.c line 9
Quoted 4 lines
target/loongarch/kvm/kvm.c +1
-0@@ -6,6 +6,7 @@*/ #include "qemu/osdep.h" +#include "exec/cpu-defs.h"
Simply add exec/target_long.h.
Thanks.
Song Gao
Quoted 3 lines
target/loongarch/kvm/kvm.c +0
-0#include <sys/ioctl.h> #include <linux/kvm.h> #include "asm-loongarch/kvm_para.h"
Quoted 16 lines · gaosong
+Philippe,and bibo.
Quoted 14 lines · Qiang Ma
After commit
71cab1a42d2removed the indirect include ofexec/cpu-defs.hfromtarget/loongarch/cpu.h, theTARGET_FMT_lxmacro is no longer visible inkvm.c, causing build failures:error: expected ')' before
TARGET_FMT_lxAdd the missing #include
exec/cpu-defs.hto restore theTARGET_FMT_lxdefinition.Signed-off-by Qiang Ma <[email protected]>---
target/loongarch/kvm/kvm.c| 1 +1 file changed, 1 insertion(+)
Quoted 9 lines
target/loongarch/kvm/kvm.c line 8
Quoted 8 lines
target/loongarch/kvm/kvm.c +1
-0@@ -6,6 +6,7 @@*/ #include "qemu/osdep.h" +#include "exec/cpu-defs.h" Simply add
exec/target_long.h.
OK, Add #include "exec/target_long.h" in v2.
Quoted 8 lines
Thanks.
Song GaoQuoted 3 lines
target/loongarch/kvm/kvm.c +0
-0#include <sys/ioctl.h> #include <linux/kvm.h> #include "asm-loongarch/kvm_para.h"
Hi,
Quoted 16 lines · gaosong
+Philippe,and bibo.
Quoted 14 lines · Qiang Ma
After commit
71cab1a42d2removed the indirect include ofexec/cpu-defs.hfromtarget/loongarch/cpu.h, theTARGET_FMT_lxmacro is no longer visible inkvm.c, causing build failures:error: expected ')' before
TARGET_FMT_lxAdd the missing #include
exec/cpu-defs.hto restore theTARGET_FMT_lxdefinition.Signed-off-by Qiang Ma <[email protected]>---
target/loongarch/kvm/kvm.c| 1 +1 file changed, 1 insertion(+)
Quoted 9 lines
target/loongarch/kvm/kvm.c line 8
Quoted 8 lines
target/loongarch/kvm/kvm.c +1
-0@@ -6,6 +6,7 @@*/ #include "qemu/osdep.h" +#include "exec/cpu-defs.h" Simply add
exec/target_long.h.
Correct.
Looking at the last build-loongarch64 job output,
https://gitlab.com/qemu-project/qemu/-/jobs/14336151206,
I see KVM is not build-covered:
configuring with: '../configure' '--enable-werror' '--disable-docs' '--enable-fdt=system' '--disable-debug-info' '--target-list=loongarch64-linux-user loongarch64-softmmu' '--disable-tools' '--enable-debug' [...]
Targets and accelerators
KVM support : NO
Why is that, what is missing?
Also I strongly suggest adding a cross-loongarch64-kvm-only job in .gitlab-ci.d/crossbuilds.yml.
Quoted 3 lines
Thanks.
Song Gao
Quoted 35 lines · Philippe Mathieu-Daudé
Hi,
Quoted 16 lines · gaosong
+Philippe,and bibo.
Quoted 14 lines · Qiang Ma
After commit
71cab1a42d2removed the indirect include ofexec/cpu-defs.hfromtarget/loongarch/cpu.h, theTARGET_FMT_lxmacro is no longer visible inkvm.c, causing build failures:error: expected ')' before
TARGET_FMT_lxAdd the missing #include
exec/cpu-defs.hto restore theTARGET_FMT_lxdefinition.Signed-off-by Qiang Ma <[email protected]>---
target/loongarch/kvm/kvm.c| 1 +1 file changed, 1 insertion(+)Quoted 9 lines
target/loongarch/kvm/kvm.c line 8
Quoted 8 lines
target/loongarch/kvm/kvm.c +1
-0@@ -6,6 +6,7 @@*/ #include "qemu/osdep.h" +#include "exec/cpu-defs.h" Simply add
exec/target_long.h.Correct.
Looking at the last build-loongarch64 job output,
https://gitlab.com/qemu-project/qemu/-/jobs/14336151206,
I see KVM is not build-covered:
Quoted 6 lines
configuring with: '../configure' '--enable-werror' '--disable-docs' '-- enable-fdt=system' '--disable-debug-info' '--target-list=loongarch64-linux- user loongarch64-softmmu' '--disable-tools' '--enable-debug' [...]
Targets and accelerators
KVM support : NOWhy is that, what is missing?
KVM only works if you build binaries where host architecture matches the target architecture. In that job, binaries are built for x86 hosts, so no KVM support here.
Quoted 2 lines
Also I strongly suggest adding a cross-loongarch64-kvm-only job in
.gitlab-ci.d/crossbuilds.yml.
Right, you'd need this for getting compile-coverage of the KVM code.
Thomas