qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-8.0] hw/misc: Move some arm-related files from specific_s


From: Thomas Huth
Subject: Re: [PATCH for-8.0] hw/misc: Move some arm-related files from specific_ss into softmmu_ss
Date: Fri, 2 Dec 2022 15:28:29 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0

On 02/12/2022 13.25, Thomas Huth wrote:
On 01/12/2022 12.55, Peter Maydell wrote:
On Wed, 30 Nov 2022 at 11:16, Thomas Huth <thuth@redhat.com> wrote:

By removing #include "kvm-consts.h" from arm-powerctl.h (seems not to
be required there) and adjusting the header includes in some files, we
can move them from specific_ss into softmmu_ss, so that they only need
to be compiled once and not for qemu-system-arm and qemu-system-aarch64
individually.

--- a/target/arm/arm-powerctl.h
+++ b/target/arm/arm-powerctl.h
@@ -11,8 +11,6 @@
  #ifndef QEMU_ARM_POWERCTL_H
  #define QEMU_ARM_POWERCTL_H

-#include "kvm-consts.h"
-
  #define QEMU_ARM_POWERCTL_RET_SUCCESS QEMU_PSCI_RET_SUCCESS
  #define QEMU_ARM_POWERCTL_INVALID_PARAM QEMU_PSCI_RET_INVALID_PARAMS
  #define QEMU_ARM_POWERCTL_ALREADY_ON QEMU_PSCI_RET_ALREADY_ON

kvm-consts.h is where QEMU_PSCI_RET_SUCCESS etc are defined.
So while the #include isn't strictly needed for compilation to work
because arm-powerctl.h only creates the #define and doesn't use it,
it does mean that any source file that uses the QEMU_ARM_POWERCTL_*
now needs to include kvm-consts.h somehow itself. (Usually this is
going to happen implicitly via target/arm/cpu.h, I think.)

Thinking about this a little bit more (and finally having a look at the contents of kvm-consts.h itself) ... I think there might be an even more elegant solution here: We could maybe apply the "#ifdef NEED_CPU_H" trick in kvm-consts.h (like it is e.g. done in include/sysemu/kvm.h) to avoid to touch the poisoned CONFIG_KVM macro in common code ... I'll give it a try, and if it works, I'll use that method for my v2 of this patch.

 Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]