From: Thomas Huth <thuth@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org,
"Jean-Christophe Dubois" <jcd@tribudubois.net>,
"Alistair Francis" <alistair@alistair23.me>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
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 [thread overview]
Message-ID: <5a5031b4-d00f-fcc0-6b47-38413dd6c308@redhat.com> (raw)
In-Reply-To: <95226bbe-9658-660c-12bb-dbf82b28dbd5@redhat.com>
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
next prev parent reply other threads:[~2022-12-02 14:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-30 11:15 [PATCH for-8.0] hw/misc: Move some arm-related files from specific_ss into softmmu_ss Thomas Huth
2022-12-01 11:55 ` Peter Maydell
2022-12-02 12:25 ` Thomas Huth
2022-12-02 14:28 ` Thomas Huth [this message]
2022-12-04 17:36 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5a5031b4-d00f-fcc0-6b47-38413dd6c308@redhat.com \
--to=thuth@redhat.com \
--cc=alistair@alistair23.me \
--cc=edgar.iglesias@gmail.com \
--cc=jcd@tribudubois.net \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).