target/arm: Compile accelerator-related objects as common code
Subsystems (3)
cover target/arm: Compile accelerator-related objects as common code
First drop TARGET_KVM_HAVE_GUEST_DEBUG (all targets but MIPS support it), then -- after minor changes -- move the ARM specific accelerator units to target_common_system_arch[] source set, allowing to remove arm_system_ss[] for good.
Philippe Mathieu-Daudé (8):
accel/kvm: Include missing 'exec/vaddr.h' header accel/kvm: Remove TARGET_KVM_HAVE_GUEST_DEBUG accel/kvm: Expose all non-target specific declarations target/arm: Compile WHPX as common object
target/arm: Remove target_ulong use in hvf_handle_psci_call() target/arm: Compile HVF as common object
target/arm: Remove target_ulong cast in kvm_arm_handle_dabt_nisv() target/arm: Compile KVM as common object
configs/targets/aarch64-softmmu.mak | 1 - configs/targets/i386-softmmu.mak | 1 - configs/targets/loongarch64-softmmu.mak | 1 - configs/targets/ppc-softmmu.mak | 1 - configs/targets/ppc64-softmmu.mak | 1 - configs/targets/riscv64-softmmu.mak | 1 - configs/targets/s390x-softmmu.mak | 1 - configs/targets/x86_64-softmmu.mak | 1 - include/system/kvm.h | 13 +------------ include/system/kvm_int.h | 2 -- accel/kvm/kvm-accel-ops.c | 4 ---- accel/kvm/kvm-all.c | 13 ++----------- target/arm/hvf/hvf.c | 2 +- target/arm/kvm.c | 3 +-- target/mips/kvm.c | 5 +++++ target/arm/hvf/meson.build | 2 +- target/arm/meson.build | 12 +++++++----- target/arm/whpx/meson.build | 6 +++--- 18 files changed, 21 insertions(+), 49 deletions(-)
Signature · 1 line
2.53.0
PATCH 1/8 accel/kvm: Include missing 'exec/vaddr.h' header
Commit b67be03e3ac ("accel/kvm: Widen pc/saved_insn for kvm_sw_breakpoint") used the vaddr type in the kvm_sw_breakpoint structure but forgot to include the header defining it. Do it now in order to avoid when refactoring unrelated headers:
include/system/kvm.h:404:5: error: unknown type name 'vaddr'
404 | vaddr pc;
| ^~~~~
include/system/kvm.h:405:5: error: unknown type name 'vaddr'
405 | vaddr saved_insn;
| ^~~~~--- include/system/kvm.h | 1 + 1 file changed, 1 insertion(+)
include/system/kvm.h +1 -0
@@ -17,6 +17,7 @@#define QEMU_KVM_H #include "exec/memattrs.h" +#include "exec/vaddr.h" #include "qemu/accel.h" #include "qom/object.h"
Signature · 1 line
2.53.0
Re: [PATCH-for-11.1 1/8] accel/kvm: Include missing 'exec/vaddr.h' header
Quoted 6 lines · Philippe Mathieu-Daudé
Commit
b67be03e3ac("accel/kvm: Widen pc/saved_insn forkvm_sw_breakpoint") used the vaddr type in thekvm_sw_breakpointstructure but forgot to include the header defining it. Do it now in order to avoid when refactoring unrelated headers:
Quoted 8 lines
include/system/kvm.h:404:5: error: unknown type name 'vaddr'404 | vaddr pc; | ^~~~~ include/system/kvm.h:405:5: error: unknown type name 'vaddr' 405 | vaddr saved_insn; | ^~~~~Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Alistair
Quoted 20 lines
--- include/system/kvm.h | 1 + 1 file changed, 1 insertion(+)include/system/kvm.h +1
-1@@ -17,6 +17,7 @@#define QEMU_KVM_H #include "exec/memattrs.h" +#include "exec/vaddr.h" #include "qemu/accel.h" #include "qom/object.h" --2.53.0
Re: [PATCH-for-11.1 1/8] accel/kvm: Include missing 'exec/vaddr.h' header
In reply to Philippe Mathieu-DaudéQuoted 12 lines · Philippe Mathieu-Daudé
Commit
b67be03e3ac("accel/kvm: Widen pc/saved_insn forkvm_sw_breakpoint") used the vaddr type in thekvm_sw_breakpointstructure but forgot to include the header defining it. Do it now in order to avoid when refactoring unrelated headers:include/system/kvm.h:404:5: error: unknown type name 'vaddr' 404 | vaddr pc; | ^~~~~ include/system/kvm.h:405:5: error: unknown type name 'vaddr' 405 | vaddr saved_insn; | ^~~~~
Quoted 5 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/system/kvm.h | 1 + 1 file changed, 1 insertion(+)
r~
Quoted 12 lines
include/system/kvm.h +1
-0@@ -17,6 +17,7 @@#define QEMU_KVM_H #include "exec/memattrs.h" +#include "exec/vaddr.h" #include "qemu/accel.h" #include "qom/object.h"
PATCH 2/8 accel/kvm: Remove TARGET_KVM_HAVE_GUEST_DEBUG
In reply to Philippe Mathieu-DaudéAll targets except MIPS have TARGET_KVM_HAVE_GUEST_DEBUG=y. Declare the kvm_update_guest_debug() stub to MIPS and have TARGET_KVM_HAVE_GUEST_DEBUG be the default.
--- configs/targets/aarch64-softmmu.mak | 1 - configs/targets/i386-softmmu.mak | 1 - configs/targets/loongarch64-softmmu.mak | 1 - configs/targets/ppc-softmmu.mak | 1 - configs/targets/ppc64-softmmu.mak | 1 - configs/targets/riscv64-softmmu.mak | 1 - configs/targets/s390x-softmmu.mak | 1 - configs/targets/x86_64-softmmu.mak | 1 - include/system/kvm.h | 7 ------- include/system/kvm_int.h | 2 -- accel/kvm/kvm-accel-ops.c | 4 ---- accel/kvm/kvm-all.c | 13 ++----------- target/mips/kvm.c | 5 +++++ 13 files changed, 7 insertions(+), 32 deletions(-)
configs/targets/aarch64-softmmu.mak +0 -1
@@ -1,6 +1,5 @@ TARGET_ARCH=aarch64 TARGET_BASE_ARCH=arm -TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_XML_FILES= aarch64-core.xml aarch64-fpu.xml arm-core.xml arm-vfp.xml arm-vfp3.xml arm-vfp-sysregs.xml arm-neon.xml arm-m-profile.xml arm-m-profile-mve.xml aarch64-pauth.xml aarch64-sme2.xml # needed by boot.c TARGET_NEED_FDT=y
configs/targets/i386-softmmu.mak +0 -1
@@ -1,5 +1,4 @@ TARGET_ARCH=i386 -TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_KVM_HAVE_RESET_PARKED_VCPU=y TARGET_XML_FILES= i386-32bit.xml TARGET_LONG_BITS=32
configs/targets/loongarch64-softmmu.mak +0 -1
@@ -1,6 +1,5 @@ TARGET_ARCH=loongarch64 TARGET_BASE_ARCH=loongarch -TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_XML_FILES= loongarch-base32.xml loongarch-base64.xml loongarch-fpu.xml loongarch-lsx.xml loongarch-lasx.xml # all boards require libfdt TARGET_NEED_FDT=y
configs/targets/ppc-softmmu.mak +0 -1
@@ -1,5 +1,4 @@ TARGET_ARCH=ppc TARGET_BIG_ENDIAN=y -TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_XML_FILES= power-core.xml power-fpu.xml power-altivec.xml power-spe.xml TARGET_LONG_BITS=32
configs/targets/ppc64-softmmu.mak +0 -1
@@ -1,7 +1,6 @@ TARGET_ARCH=ppc64 TARGET_BASE_ARCH=ppc TARGET_BIG_ENDIAN=y -TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_XML_FILES= power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml # all boards require libfdt TARGET_NEED_FDT=y
configs/targets/riscv64-softmmu.mak +0 -1
@@ -1,6 +1,5 @@ TARGET_ARCH=riscv64 TARGET_BASE_ARCH=riscv -TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_XML_FILES= riscv-64bit-cpu.xml riscv-32bit-fpu.xml riscv-64bit-fpu.xml riscv-64bit-virtual.xml riscv-32bit-cpu.xml riscv-32bit-virtual.xml # needed by boot.c TARGET_NEED_FDT=y
configs/targets/s390x-softmmu.mak +0 -1
@@ -1,6 +1,5 @@ TARGET_ARCH=s390x TARGET_BIG_ENDIAN=y -TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_XML_FILES= s390x-core64.xml s390-acr.xml s390-fpr.xml s390-vx.xml s390-cr.xml s390-virt.xml s390-virt-kvm.xml s390-gs.xml TARGET_LONG_BITS=64 TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API=y
configs/targets/x86_64-softmmu.mak +0 -1
@@ -1,6 +1,5 @@ TARGET_ARCH=x86_64 TARGET_BASE_ARCH=i386 -TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_KVM_HAVE_RESET_PARKED_VCPU=y TARGET_XML_FILES= i386-64bit.xml i386-64bit-apx.xml TARGET_LONG_BITS=64
include/system/kvm.h +0 -7
@@ -236,14 +236,7 @@ void kvm_irqchip_change_notify(void);* calling down to kvm_arch_update_guest_debug after the generic * fields have been set. */ -#ifdef TARGET_KVM_HAVE_GUEST_DEBUG int kvm_update_guest_debug (CPUState *cpu,unsigned long reinject_trap); -#else -static inline int kvm_update_guest_debug (CPUState *cpu,unsigned long reinject_trap) -{ -return -EINVAL ; -} -#endif /* internal API */
include/system/kvm_int.h +0 -2
@@ -113,9 +113,7 @@ struct KVMStatestruct kvm_coalesced_mmio_ring *coalesced_mmio_ring;bool coalesced_flush_in_progress;int vcpu_events; -#ifdef TARGET_KVM_HAVE_GUEST_DEBUG QTAILQ_HEAD(, kvm_sw_breakpoint) kvm_sw_breakpoints; -#endif int max_nested_state_len;int kvm_shadow_mem;bool kernel_irqchip_allowed;
accel/kvm/kvm-accel-ops.c +0 -4
@@ -85,12 +85,10 @@ static bool kvm_cpus_are_resettable(void)return !kvm_enabled () || !kvm_state->guest_state_protected; } -#ifdef TARGET_KVM_HAVE_GUEST_DEBUG static int kvm_update_guest_debug_ops (CPUState *cpu) {return kvm_update_guest_debug (cpu,0 ); } -#endif static void kvm_accel_ops_class_init (ObjectClass *oc,const void *data) {
@@ -105,13 +103,11 @@ static void kvm_accel_ops_class_init(ObjectClass *oc, const void *data) ops->synchronize_pre_loadvm = kvm_cpu_synchronize_pre_loadvm; ops->handle_interrupt = generic_handle_interrupt; -#ifdef TARGET_KVM_HAVE_GUEST_DEBUG ops->update_guest_debug = kvm_update_guest_debug_ops; ops->supports_guest_debug = kvm_supports_guest_debug; ops->insert_breakpoint = kvm_insert_breakpoint; ops->remove_breakpoint = kvm_remove_breakpoint; ops->remove_all_breakpoints = kvm_remove_all_breakpoints; -#endif }static const TypeInfo kvm_accel_ops_type = {
accel/kvm/kvm-all.c +2 -11
@@ -2919,9 +2919,7 @@ static int kvm_init(AccelState *as, MachineState *ms) s->sigmask_len =8 ;accel_blocker_init (); -#ifdef TARGET_KVM_HAVE_GUEST_DEBUG QTAILQ_INIT (&s->kvm_sw_breakpoints); -#endif QLIST_INIT (&s->kvm_parked_vcpus); s->fd =qemu_open_old (s->device ?:"/dev/kvm" ,O_RDWR );if (s->fd ==-1 ) {
@@ -3032,23 +3030,19 @@ static int kvm_init(AccelState *as, MachineState *ms) kvm_vm_attributes_allowed = (kvm_check_extension (s,KVM_CAP_VM_ATTRIBUTES ) >0 ); -#ifdef TARGET_KVM_HAVE_GUEST_DEBUG kvm_has_guest_debug = (kvm_check_extension (s,KVM_CAP_SET_GUEST_DEBUG ) >0 ); -#endif kvm_sstep_flags =0 ;if (kvm_has_guest_debug) { - kvm_sstep_flags =SSTEP_ENABLE ; - -#if definedTARGET_KVM_HAVE_GUEST_DEBUG int guest_debug_flags =kvm_check_extension (s,KVM_CAP_SET_GUEST_DEBUG2 ); + kvm_sstep_flags =SSTEP_ENABLE ; +if (guest_debug_flags &KVM_GUESTDBG_BLOCKIRQ ) { kvm_sstep_flags |=SSTEP_NOIRQ ; } -#endif } kvm_state = s;
@@ -3781,7 +3775,6 @@ bool kvm_arm_supports_user_irq(void)return kvm_check_extension (kvm_state,KVM_CAP_ARM_USER_IRQ ); } -#ifdef TARGET_KVM_HAVE_GUEST_DEBUG struct kvm_sw_breakpoint *kvm_find_sw_breakpoint (CPUState *cpu,vaddr pc) {struct kvm_sw_breakpoint *bp;
@@ -3941,8 +3934,6 @@ void kvm_remove_all_breakpoints(CPUState *cpu) } } -#endif /* !TARGET_KVM_HAVE_GUEST_DEBUG */ -static int kvm_set_signal_mask (CPUState *cpu,const sigset_t *sigset) {KVMState *s = kvm_state;
target/mips/kvm.c +5 -0
@@ -1262,6 +1262,11 @@ int kvm_arch_msi_data_to_gsi(uint32_t data)abort (); } +int kvm_update_guest_debug (CPUState *cpu,unsigned long reinject_trap) +{ +return -EINVAL ; +} +int kvm_arch_get_default_type (MachineState *machine) {#if defined(KVM_CAP_MIPS_VZ )
Signature · 1 line
2.53.0
Re: [PATCH-for-11.1 2/8] accel/kvm: Remove TARGET_KVM_HAVE_GUEST_DEBUG
Quoted 6 lines · Philippe Mathieu-Daudé
All targets except MIPS have TARGET_KVM_HAVE_GUEST_DEBUG=y. Declare the
kvm_update_guest_debug()stub to MIPS and haveTARGET_KVM_HAVE_GUEST_DEBUGbe the default.Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Alistair
Quoted 244 lines
--- configs/targets/aarch64-softmmu.mak | 1 - configs/targets/i386-softmmu.mak | 1 - configs/targets/loongarch64-softmmu.mak | 1 - configs/targets/ppc-softmmu.mak | 1 - configs/targets/ppc64-softmmu.mak | 1 - configs/targets/riscv64-softmmu.mak | 1 - configs/targets/s390x-softmmu.mak | 1 - configs/targets/x86_64-softmmu.mak | 1 - include/system/kvm.h | 7 ------- include/system/kvm_int.h | 2 -- accel/kvm/kvm-accel-ops.c | 4 ---- accel/kvm/kvm-all.c | 13 ++----------- target/mips/kvm.c | 5 +++++ 13 files changed, 7 insertions(+), 32 deletions(-)configs/targets/aarch64-softmmu.mak +0
-1@@ -1,6 +1,5 @@ TARGET_ARCH=aarch64 TARGET_BASE_ARCH=arm -TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_XML_FILES= aarch64-core.xml aarch64-fpu.xml arm-core.xml arm-vfp.xml arm-vfp3.xml arm-vfp-sysregs.xml arm-neon.xml arm-m-profile.xml arm-m-profile-mve.xml aarch64-pauth.xml aarch64-sme2.xml # needed by boot.c TARGET_NEED_FDT=yconfigs/targets/i386-softmmu.mak +0
-1@@ -1,5 +1,4 @@ TARGET_ARCH=i386 -TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_KVM_HAVE_RESET_PARKED_VCPU=y TARGET_XML_FILES= i386-32bit.xml TARGET_LONG_BITS=32configs/targets/loongarch64-softmmu.mak +0
-1@@ -1,6 +1,5 @@ TARGET_ARCH=loongarch64 TARGET_BASE_ARCH=loongarch -TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_XML_FILES= loongarch-base32.xml loongarch-base64.xml loongarch-fpu.xml loongarch-lsx.xml loongarch-lasx.xml # all boards require libfdt TARGET_NEED_FDT=yconfigs/targets/ppc-softmmu.mak +0
-1@@ -1,5 +1,4 @@ TARGET_ARCH=ppc TARGET_BIG_ENDIAN=y -TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_XML_FILES= power-core.xml power-fpu.xml power-altivec.xml power-spe.xml TARGET_LONG_BITS=32configs/targets/ppc64-softmmu.mak +0
-1@@ -1,7 +1,6 @@ TARGET_ARCH=ppc64 TARGET_BASE_ARCH=ppc TARGET_BIG_ENDIAN=y -TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_XML_FILES= power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml # all boards require libfdt TARGET_NEED_FDT=yconfigs/targets/riscv64-softmmu.mak +0
-1@@ -1,6 +1,5 @@ TARGET_ARCH=riscv64 TARGET_BASE_ARCH=riscv -TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_XML_FILES= riscv-64bit-cpu.xml riscv-32bit-fpu.xml riscv-64bit-fpu.xml riscv-64bit-virtual.xml riscv-32bit-cpu.xml riscv-32bit-virtual.xml # needed by boot.c TARGET_NEED_FDT=yconfigs/targets/s390x-softmmu.mak +0
-1@@ -1,6 +1,5 @@ TARGET_ARCH=s390x TARGET_BIG_ENDIAN=y -TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_XML_FILES= s390x-core64.xml s390-acr.xml s390-fpr.xml s390-vx.xml s390-cr.xml s390-virt.xml s390-virt-kvm.xml s390-gs.xml TARGET_LONG_BITS=64 TARGET_NOT_USING_LEGACY_NATIVE_ENDIAN_API=yconfigs/targets/x86_64-softmmu.mak +0
-1@@ -1,6 +1,5 @@ TARGET_ARCH=x86_64 TARGET_BASE_ARCH=i386 -TARGET_KVM_HAVE_GUEST_DEBUG=y TARGET_KVM_HAVE_RESET_PARKED_VCPU=y TARGET_XML_FILES= i386-64bit.xml i386-64bit-apx.xml TARGET_LONG_BITS=64include/system/kvm.h +0
-7@@ -236,14 +236,7 @@ void kvm_irqchip_change_notify(void);* calling down to kvm_arch_update_guest_debug after the generic * fields have been set. */ -#ifdef TARGET_KVM_HAVE_GUEST_DEBUG int kvm_update_guest_debug (CPUState *cpu,unsigned long reinject_trap); -#else -static inline int kvm_update_guest_debug (CPUState *cpu,unsigned long reinject_trap) -{ -return -EINVAL ; -} -#endif /* internal API */ include/system/kvm_int.h +0
-2@@ -113,9 +113,7 @@ struct KVMStatestruct kvm_coalesced_mmio_ring *coalesced_mmio_ring;bool coalesced_flush_in_progress;int vcpu_events; -#ifdef TARGET_KVM_HAVE_GUEST_DEBUG QTAILQ_HEAD(, kvm_sw_breakpoint) kvm_sw_breakpoints; -#endif int max_nested_state_len;int kvm_shadow_mem;bool kernel_irqchip_allowed;accel/kvm/kvm-accel-ops.c +0
-4@@ -85,12 +85,10 @@ static bool kvm_cpus_are_resettable(void)return !kvm_enabled () || !kvm_state->guest_state_protected; } -#ifdef TARGET_KVM_HAVE_GUEST_DEBUG static int kvm_update_guest_debug_ops (CPUState *cpu) {return kvm_update_guest_debug (cpu,0 ); } -#endif static void kvm_accel_ops_class_init (ObjectClass *oc,const void *data) {@@ -105,13 +103,11 @@ static void kvm_accel_ops_class_init(ObjectClass *oc, const void *data) ops->synchronize_pre_loadvm = kvm_cpu_synchronize_pre_loadvm; ops->handle_interrupt = generic_handle_interrupt; -#ifdef TARGET_KVM_HAVE_GUEST_DEBUG ops->update_guest_debug = kvm_update_guest_debug_ops; ops->supports_guest_debug = kvm_supports_guest_debug; ops->insert_breakpoint = kvm_insert_breakpoint; ops->remove_breakpoint = kvm_remove_breakpoint; ops->remove_all_breakpoints = kvm_remove_all_breakpoints; -#endif }static const TypeInfo kvm_accel_ops_type = {accel/kvm/kvm-all.c +2
-11@@ -2919,9 +2919,7 @@ static int kvm_init(AccelState *as, MachineState *ms) s->sigmask_len =8 ;accel_blocker_init (); -#ifdef TARGET_KVM_HAVE_GUEST_DEBUG QTAILQ_INIT (&s->kvm_sw_breakpoints); -#endif QLIST_INIT (&s->kvm_parked_vcpus); s->fd =qemu_open_old (s->device ?:"/dev/kvm" ,O_RDWR );if (s->fd ==-1 ) {@@ -3032,23 +3030,19 @@ static int kvm_init(AccelState *as, MachineState *ms) kvm_vm_attributes_allowed = (kvm_check_extension (s,KVM_CAP_VM_ATTRIBUTES ) >0 ); -#ifdef TARGET_KVM_HAVE_GUEST_DEBUG kvm_has_guest_debug = (kvm_check_extension (s,KVM_CAP_SET_GUEST_DEBUG ) >0 ); -#endif kvm_sstep_flags =0 ;if (kvm_has_guest_debug) { - kvm_sstep_flags =SSTEP_ENABLE ; - -#if definedTARGET_KVM_HAVE_GUEST_DEBUG int guest_debug_flags =kvm_check_extension (s,KVM_CAP_SET_GUEST_DEBUG2 ); + kvm_sstep_flags =SSTEP_ENABLE ; +if (guest_debug_flags &KVM_GUESTDBG_BLOCKIRQ ) { kvm_sstep_flags |=SSTEP_NOIRQ ; } -#endif } kvm_state = s;@@ -3781,7 +3775,6 @@ bool kvm_arm_supports_user_irq(void)return kvm_check_extension (kvm_state,KVM_CAP_ARM_USER_IRQ ); } -#ifdef TARGET_KVM_HAVE_GUEST_DEBUG struct kvm_sw_breakpoint *kvm_find_sw_breakpoint (CPUState *cpu,vaddr pc) {struct kvm_sw_breakpoint *bp;@@ -3941,8 +3934,6 @@ void kvm_remove_all_breakpoints(CPUState *cpu) } } -#endif /* !TARGET_KVM_HAVE_GUEST_DEBUG */ -static int kvm_set_signal_mask (CPUState *cpu,const sigset_t *sigset) {KVMState *s = kvm_state;target/mips/kvm.c +5
-1@@ -1262,6 +1262,11 @@ int kvm_arch_msi_data_to_gsi(uint32_t data)abort (); } +int kvm_update_guest_debug (CPUState *cpu,unsigned long reinject_trap) +{ +return -EINVAL ; +} +int kvm_arch_get_default_type (MachineState *machine) {#if defined(KVM_CAP_MIPS_VZ ) --2.53.0
Re: [PATCH-for-11.1 2/8] accel/kvm: Remove TARGET_KVM_HAVE_GUEST_DEBUG
In reply to Philippe Mathieu-DaudéQuoted 5 lines · Philippe Mathieu-Daudé
All targets except MIPS have TARGET_KVM_HAVE_GUEST_DEBUG=y. Declare the
kvm_update_guest_debug()stub to MIPS and haveTARGET_KVM_HAVE_GUEST_DEBUGbe the default.Signed-off-by Philippe Mathieu-Daudé<[email protected]>
Quoted 15 lines
--- configs/targets/aarch64-softmmu.mak | 1 - configs/targets/i386-softmmu.mak | 1 - configs/targets/loongarch64-softmmu.mak | 1 - configs/targets/ppc-softmmu.mak | 1 - configs/targets/ppc64-softmmu.mak | 1 - configs/targets/riscv64-softmmu.mak | 1 - configs/targets/s390x-softmmu.mak | 1 - configs/targets/x86_64-softmmu.mak | 1 - include/system/kvm.h | 7 ------- include/system/kvm_int.h | 2 -- accel/kvm/kvm-accel-ops.c | 4 ---- accel/kvm/kvm-all.c | 13 ++----------- target/mips/kvm.c | 5 +++++ 13 files changed, 7 insertions(+), 32 deletions(-)
r~
PATCH 3/8 accel/kvm: Expose all non-target specific declarations
In reply to Philippe Mathieu-DaudéNone of the declarations guarded within the COMPILING_PER_TARGET checks use target-specific declaration. "cpu.h" is not required since some time (maybe commit 4fb54de823e "meson: build target libraries with common dependencies"). Remove the restrictions.
--- include/system/kvm.h | 5 ----- 1 file changed, 5 deletions(-)
include/system/kvm.h +0 -5
@@ -224,9 +224,6 @@ void kvm_irqchip_add_change_notifier(Notifier *n);void kvm_irqchip_remove_change_notifier (Notifier *n);void kvm_irqchip_change_notify (void ); -#ifdef COMPILING_PER_TARGET -#include "cpu.h" -/** * kvm_update_guest_debug(): ensure KVM debug structures updated * @cs: the CPUState for this cpu
@@ -449,8 +446,6 @@ void kvm_set_sigmask_len(KVMState *s, unsigned int sigmask_len);int kvm_physical_memory_addr_from_host (KVMState *s,void *ram_addr,hwaddr *phys_addr); -#endif /* COMPILING_PER_TARGET */ -bool kvm_arch_supports_vmfd_change (void );int kvm_arch_on_vmfd_change (MachineState *ms,KVMState *s);
Signature · 1 line
2.53.0
Re: [PATCH-for-11.1 3/8] accel/kvm: Expose all non-target specific declarations
Quoted 15 lines · Philippe Mathieu-Daudé
None of the declarations guarded within the
COMPILING_PER_TARGETchecks use target-specific declaration. "cpu.h" is not required since some time (maybe commit4fb54de823e"meson: build target libraries with common dependencies"). Remove the restrictions.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/system/kvm.h | 5 ----- 1 file changed, 5 deletions(-)include/system/kvm.h +0
-0
include/system/kvm.h void kvm_irqchip_add_change_notifier(Notifier *n); · line 228
Quoted 5 lines
include/system/kvm.h +0
-2@@ -224,9 +224,6 @@ void kvm_irqchip_add_change_notifier(Notifier *n);void kvm_irqchip_remove_change_notifier (Notifier *n);void kvm_irqchip_change_notify (void ); -#ifdef COMPILING_PER_TARGET -#include "cpu.h"
Missing:
#include "qemu/queue.h"
Quoted 12 lines
include/system/kvm.h +0
-2/** * kvm_update_guest_debug(): ensure KVM debug structures updated * @cs: the CPUState for this cpu @@ -449,8 +446,6 @@ void kvm_set_sigmask_len(KVMState *s, unsigned int sigmask_len);int kvm_physical_memory_addr_from_host (KVMState *s,void *ram_addr,hwaddr *phys_addr); -#endif /* COMPILING_PER_TARGET */ -bool kvm_arch_supports_vmfd_change (void );int kvm_arch_on_vmfd_change (MachineState *ms,KVMState *s);
Re: [PATCH-for-11.1 3/8] accel/kvm: Expose all non-target specific declarations
In reply to Philippe Mathieu-DaudéQuoted 9 lines · Philippe Mathieu-Daudé
None of the declarations guarded within the
COMPILING_PER_TARGETchecks use target-specific declaration. "cpu.h" is not required since some time (maybe commit4fb54de823e"meson: build target libraries with common dependencies"). Remove the restrictions.Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- include/system/kvm.h | 5 ----- 1 file changed, 5 deletions(-)
r~
PATCH 4/8 target/arm: Compile WHPX as common object
In reply to Philippe Mathieu-Daudéwhpx-all.c doesn't use target-specific code, move it from arm_system_ss[] to arm_common_system_ss[] to compile it once.
--- target/arm/whpx/meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
target/arm/whpx/meson.build +3 -3
@@ -1,5 +1,5 @@ -arm_system_ss.add(when: 'CONFIG_WHPX', if_true: files( +arm_common_system_ss.add(when: 'CONFIG_WHPX', if_true: files( 'whpx-all.c', +), if_false: files( + 'whpx-stub.c' )) - -arm_common_system_ss.add(when: 'CONFIG_WHPX', if_false: files('whpx-stub.c'))
Signature · 1 line
2.53.0
Re: [PATCH-for-11.1 4/8] target/arm: Compile WHPX as common object
Quoted 13 lines · Philippe Mathieu-Daudé
whpx-all.cdoesn't use target-specific code, move it from arm_system_ss[] to arm_common_system_ss[] to compile it once.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/arm/whpx/meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)target/arm/whpx/meson.build +0
-0
target/arm/whpx/meson.build line 5
Quoted 8 lines
target/arm/whpx/meson.build +3
-3@@ -1,5 +1,5 @@ -arm_system_ss.add(when: 'CONFIG_WHPX', if_true: files( +arm_common_system_ss.add(when: 'CONFIG_WHPX', if_true: files( 'whpx-all.c', +), if_false: files( + 'whpx-stub.c' )) - -arm_common_system_ss.add(when: 'CONFIG_WHPX', if_false: files('whpx-stub.c'))
r~
PATCH 5/8 target/arm: Remove target_ulong use in hvf_handle_psci_call()
In reply to Philippe Mathieu-DaudéSimilarly to commit 3580aa03547 ("target/arm/tcg/psci.c: make compilation unit common") which replaced the target_ulong use in arm_handle_psci_call(), replace the one in hvf_handle_psci_call.
--- target/arm/hvf/hvf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/arm/hvf/hvf.c +1 -1
@@ -1418,7 +1418,7 @@ static bool hvf_handle_psci_call(CPUState *cpu, int *excp_ret)bool target_aarch64 = true;CPUState *target_cpu_state;ARMCPU *target_cpu; -target_ulong entry; +uint64_t entry;int target_el =1 ;int32_t ret =0 ;
Signature · 1 line
2.53.0
Re: [PATCH-for-11.1 5/8] target/arm: Remove target_ulong use in hvf_handle_psci_call()
Quoted 15 lines · Philippe Mathieu-Daudé
Similarly to commit
3580aa03547("target/arm/tcg/psci.c: make compilation unit common") which replaced thetarget_ulonguse inarm_handle_psci_call(), replace the one inhvf_handle_psci_call.Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Pierrick Bouvier <[email protected]>--- target/arm/hvf/hvf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target/arm/hvf/hvf.c +0
-0
target/arm/hvf/hvf.c static bool hvf_handle_psci_call(CPUState *cpu, int *excp_ret) · line 1424
Quoted 8 lines
target/arm/hvf/hvf.c +1
-1@@ -1418,7 +1418,7 @@ static bool hvf_handle_psci_call(CPUState *cpu, int *excp_ret)bool target_aarch64 = true;CPUState *target_cpu_state;ARMCPU *target_cpu; -target_ulong entry; +uint64_t entry;int target_el =1 ;int32_t ret =0 ;
This could be vaddr, because entry is the start pc for the on-lining cpu. But uint64_t does match arm_set_cpu_on declaration.
Anyway,
r~
PATCH 6/8 target/arm: Compile HVF as common object
In reply to Philippe Mathieu-DaudéNeither of hvf.c nor hyp_gdbstub.c use target-specific code. Move them from arm_system_ss[] to arm_common_system_ss[] to compile them once.
--- target/arm/hvf/meson.build | 2 +- target/arm/meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
target/arm/hvf/meson.build +1 -1
@@ -1,3 +1,3 @@ -arm_system_ss.add(when: [hvf, 'CONFIG_HVF'], if_true: files( +arm_common_system_ss.add(when: [hvf, 'CONFIG_HVF'], if_true: files( 'hvf.c', ))
target/arm/meson.build +1 -1
@@ -20,7 +20,6 @@ arm_common_system_ss.add(files( 'arm-qmp-cmds.c', )) arm_system_ss.add(when: 'CONFIG_KVM', if_true: files('hyp_gdbstub.c', 'kvm.c')) -arm_system_ss.add(when: 'CONFIG_HVF', if_true: files('hyp_gdbstub.c')) arm_user_ss.add(files('cpu.c')) arm_user_ss.add(when: 'TARGET_AARCH64', if_false: files(
@@ -41,6 +40,7 @@ arm_common_system_ss.add(files('cpu.c')) arm_common_system_ss.add(when: 'TARGET_AARCH64', if_false: files( 'cpu32-stubs.c')) arm_common_system_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c')) +arm_common_system_ss.add(when: 'CONFIG_HVF', if_true: files('hyp_gdbstub.c')) arm_common_system_ss.add(when: 'CONFIG_ARM_COMPATIBLE_SEMIHOSTING', if_true: files('common-semi-target.c')) arm_common_system_ss.add(files(
Signature · 1 line
2.53.0
Re: [PATCH-for-11.1 6/8] target/arm: Compile HVF as common object
Quoted 9 lines · Philippe Mathieu-Daudé
Neither of
hvf.cnorhyp_gdbstub.cuse target-specific code. Move them from arm_system_ss[] to arm_common_system_ss[] to compile them once.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/arm/hvf/meson.build | 2 +- target/arm/meson.build | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
r~
Quoted 30 lines
target/arm/hvf/meson.build +1
-1@@ -1,3 +1,3 @@ -arm_system_ss.add(when: [hvf, 'CONFIG_HVF'], if_true: files( +arm_common_system_ss.add(when: [hvf, 'CONFIG_HVF'], if_true: files( 'hvf.c', ))target/arm/meson.build +1
-1@@ -20,7 +20,6 @@ arm_common_system_ss.add(files( 'arm-qmp-cmds.c', )) arm_system_ss.add(when: 'CONFIG_KVM', if_true: files('hyp_gdbstub.c', 'kvm.c')) -arm_system_ss.add(when: 'CONFIG_HVF', if_true: files('hyp_gdbstub.c')) arm_user_ss.add(files('cpu.c')) arm_user_ss.add(when: 'TARGET_AARCH64', if_false: files(@@ -41,6 +40,7 @@ arm_common_system_ss.add(files('cpu.c')) arm_common_system_ss.add(when: 'TARGET_AARCH64', if_false: files( 'cpu32-stubs.c')) arm_common_system_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c')) +arm_common_system_ss.add(when: 'CONFIG_HVF', if_true: files('hyp_gdbstub.c')) arm_common_system_ss.add(when: 'CONFIG_ARM_COMPATIBLE_SEMIHOSTING', if_true: files('common-semi-target.c')) arm_common_system_ss.add(files(
PATCH 7/8 target/arm: Remove target_ulong cast in kvm_arm_handle_dabt_nisv()
In reply to Philippe Mathieu-Daudékvm_arm_handle_dabt_nisv() uses a uint64_t type for its @fault_ipa argument since its introduction in commit 694bcaa81f4 ("target/arm:
kvm: Handle DABT with no valid ISS"). Use the proper format and remove the pointless cast.
--- target/arm/kvm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
target/arm/kvm.c +1 -2
@@ -1453,8 +1453,7 @@ static int kvm_arm_handle_dabt_nisv(ARMCPU *cpu, uint64_t esr_iss, } }else {error_report ("Data abort exception triggered by guest memory access " -"at physical address: 0x" TARGET_FMT_lx, - (target_ulong )fault_ipa); +"at physical address: 0x%08" PRIx64, fault_ipa);error_printf ("KVM unable to emulate faulting instruction.\n" ); }return -1 ;
Signature · 1 line
2.53.0
Re: [PATCH-for-11.1 7/8] target/arm: Remove target_ulong cast in kvm_arm_handle_dabt_nisv()
Quoted 9 lines · Philippe Mathieu-Daudé
kvm_arm_handle_dabt_nisv()uses auint64_ttype for its @fault_ipa argument since its introduction in commit694bcaa81f4("target/arm:
kvm: Handle DABT with no valid ISS"). Use the proper format and remove the pointless cast.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/arm/kvm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
r~
Quoted 15 lines
target/arm/kvm.c +1
-2@@ -1453,8 +1453,7 @@ static int kvm_arm_handle_dabt_nisv(ARMCPU *cpu, uint64_t esr_iss, } }else {error_report ("Data abort exception triggered by guest memory access " -"at physical address: 0x" TARGET_FMT_lx, - (target_ulong )fault_ipa); +"at physical address: 0x%08" PRIx64, fault_ipa);error_printf ("KVM unable to emulate faulting instruction.\n" ); }return -1 ;
PATCH 8/8 target/arm: Compile KVM as common object
In reply to Philippe Mathieu-DaudéNeither of kvm.c nor hyp_gdbstub.c use target-specific code. Move them from arm_system_ss[] to arm_common_system_ss[] to compile them once. The arm_system_ss[] source set ends up unused, remove it.
--- target/arm/meson.build | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
target/arm/meson.build +6 -4
@@ -1,7 +1,6 @@ arm_ss = ss.source_set() arm_common_ss = ss.source_set() arm_common_system_ss = ss.source_set() -arm_system_ss = ss.source_set() arm_user_ss = ss.source_set() arm_common_system_ss.add(files('gdbstub.c'))
@@ -19,7 +18,6 @@ arm_common_ss.add(files( arm_common_system_ss.add(files( 'arm-qmp-cmds.c', )) -arm_system_ss.add(when: 'CONFIG_KVM', if_true: files('hyp_gdbstub.c', 'kvm.c')) arm_user_ss.add(files('cpu.c')) arm_user_ss.add(when: 'TARGET_AARCH64', if_false: files(
@@ -39,7 +37,12 @@ arm_user_ss.add(when: 'CONFIG_ARM_COMPATIBLE_SEMIHOSTING', arm_common_system_ss.add(files('cpu.c')) arm_common_system_ss.add(when: 'TARGET_AARCH64', if_false: files( 'cpu32-stubs.c')) -arm_common_system_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c')) +arm_common_system_ss.add(when: 'CONFIG_KVM', if_true: files( + 'kvm.c', + 'hyp_gdbstub.c', +), if_false: files( + 'kvm-stub.c', +)) arm_common_system_ss.add(when: 'CONFIG_HVF', if_true: files('hyp_gdbstub.c')) arm_common_system_ss.add(when: 'CONFIG_ARM_COMPATIBLE_SEMIHOSTING', if_true: files('common-semi-target.c'))
@@ -67,7 +70,6 @@ else endif target_arch += {'arm': arm_ss} -target_system_arch += {'arm': arm_system_ss} target_user_arch += {'arm': arm_user_ss} target_common_arch += {'arm': arm_common_ss} target_common_system_arch += {'arm': arm_common_system_ss}
Signature · 1 line
2.53.0
Re: [PATCH-for-11.1 8/8] target/arm: Compile KVM as common object
Quoted 9 lines · Philippe Mathieu-Daudé
Neither of
kvm.cnorhyp_gdbstub.cuse target-specific code. Move them from arm_system_ss[] to arm_common_system_ss[] to compile them once. The arm_system_ss[] source set ends up unused, remove it.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/arm/meson.build | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
r~
Quoted 43 lines
target/arm/meson.build +6
-4@@ -1,7 +1,6 @@ arm_ss = ss.source_set() arm_common_ss = ss.source_set() arm_common_system_ss = ss.source_set() -arm_system_ss = ss.source_set() arm_user_ss = ss.source_set() arm_common_system_ss.add(files('gdbstub.c'))@@ -19,7 +18,6 @@ arm_common_ss.add(files( arm_common_system_ss.add(files( 'arm-qmp-cmds.c', )) -arm_system_ss.add(when: 'CONFIG_KVM', if_true: files('hyp_gdbstub.c', 'kvm.c')) arm_user_ss.add(files('cpu.c')) arm_user_ss.add(when: 'TARGET_AARCH64', if_false: files(@@ -39,7 +37,12 @@ arm_user_ss.add(when: 'CONFIG_ARM_COMPATIBLE_SEMIHOSTING', arm_common_system_ss.add(files('cpu.c')) arm_common_system_ss.add(when: 'TARGET_AARCH64', if_false: files( 'cpu32-stubs.c')) -arm_common_system_ss.add(when: 'CONFIG_KVM', if_false: files('kvm-stub.c')) +arm_common_system_ss.add(when: 'CONFIG_KVM', if_true: files( + 'kvm.c', + 'hyp_gdbstub.c', +), if_false: files( + 'kvm-stub.c', +)) arm_common_system_ss.add(when: 'CONFIG_HVF', if_true: files('hyp_gdbstub.c')) arm_common_system_ss.add(when: 'CONFIG_ARM_COMPATIBLE_SEMIHOSTING', if_true: files('common-semi-target.c'))@@ -67,7 +70,6 @@ else endif target_arch += {'arm': arm_ss} -target_system_arch += {'arm': arm_system_ss} target_user_arch += {'arm': arm_user_ss} target_common_arch += {'arm': arm_common_ss} target_common_system_arch += {'arm': arm_common_system_ss}