[PATCH-for-11.1 v2 1/9] accel/kvm: Include missing 'exec/cpu-common.h' header

Philippe Mathieu-Daudé posted 9 patches 1 week, 2 days ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Zhao Liu <zhao1.liu@intel.com>, Song Gao <gaosong@loongson.cn>, Bibo Mao <maobibo@loongson.cn>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Chao Liu <chao.liu.zevorn@gmail.com>, Cornelia Huck <cohuck@redhat.com>, Eric Farman <farman@linux.ibm.com>, Matthew Rosato <mjrosato@linux.ibm.com>, Alexander Graf <agraf@csgraf.de>, Peter Maydell <peter.maydell@linaro.org>, Pedro Barbuda <pbarbuda@microsoft.com>, Mohamed Mediouni <mohamed@unpredictable.fr>, Huacai Chen <chenhuacai@kernel.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Aurelien Jarno <aurelien@aurel32.net>, Aleksandar Rikalo <arikalo@gmail.com>
[PATCH-for-11.1 v2 1/9] accel/kvm: Include missing 'exec/cpu-common.h' header
Posted by Philippe Mathieu-Daudé 1 week, 2 days ago
kvm-all.c uses EXCP_INTERRUPT and EXCP_HLT, defined in the
"exec/cpu-common.h" header:

 17 #define EXCP_INTERRUPT  0x10000 /* async interruption */
 18 #define EXCP_HLT        0x10001 /* hlt instruction reached */

This header is indirectly included via "system/kvm.h" -> "cpu.h".
Since we want to remove the latter inclusion, include it here in
order to avoid otherwise:

  accel/kvm/kvm-all.c: In function 'kvm_handle_internal_error':
  accel/kvm/kvm-all.c:3147:20: error: 'EXCP_INTERRUPT' undeclared (first use in this function); did you mean 'SA_INTERRUPT'?
   3147 |             return EXCP_INTERRUPT;
        |                    ^~~~~~~~~~~~~~
  accel/kvm/kvm-all.c: In function 'kvm_cpu_exec':
  accel/kvm/kvm-all.c:3436:16: error: 'EXCP_HLT' undeclared (first use in this function)
   3436 |         return EXCP_HLT;
        |                ^~~~~~~~
  accel/kvm/kvm-all.c:3490:23: error: 'EXCP_INTERRUPT' undeclared (first use in this function); did you mean 'SA_INTERRUPT'?
   3490 |                 ret = EXCP_INTERRUPT;
        |                       ^~~~~~~~~~~~~~

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 accel/kvm/kvm-all.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 774499d34f8..5df3fb90d88 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -36,6 +36,7 @@
 #include "system/ramblock.h"
 #include "accel/accel-ops.h"
 #include "qemu/bswap.h"
+#include "exec/cpu-common.h"
 #include "exec/tswap.h"
 #include "exec/target_page.h"
 #include "system/memory.h"
-- 
2.53.0