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 13:25:25 +0100 [thread overview]
Message-ID: <95226bbe-9658-660c-12bb-dbf82b28dbd5@redhat.com> (raw)
In-Reply-To: <CAFEAcA-hneP0SLUTW=_maTztra9gYnKgPeXevDcVu3jZZnDObA@mail.gmail.com>
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.)
>
> I guess this is worth living with for the benefit of not
> compiling things twice. It could probably be untangled a little
> by e.g. moving the PSCI constants into their own header rather
> than defining them in kvm-consts.h, but I'm not sure if it's
> worth the effort right now.
Hmm, do we really need these QEMU_ARM_POWERCTL* redefinitions?
They seem hardly to be used outside of the arm-powerctl.[ch]
files:
$ grep -r QEMU_ARM_POWERCTL * | grep -v target/arm/arm-powerctl
hw/misc/allwinner-cpucfg.c: if (ret != QEMU_ARM_POWERCTL_RET_SUCCESS) {
target/arm/hvf/hvf.c: assert(ret == QEMU_ARM_POWERCTL_RET_SUCCESS);
target/arm/psci.c: assert(ret == QEMU_ARM_POWERCTL_RET_SUCCESS);
... so maybe we could rather change those spots to use the QEMU_PSCI_*
constants instead? ... or since they basically only check for success,
we could maybe use "if (ret) ..." and "assert(!ret)" there?
Thomas
next prev parent reply other threads:[~2022-12-02 12:26 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 [this message]
2022-12-02 14:28 ` Thomas Huth
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=95226bbe-9658-660c-12bb-dbf82b28dbd5@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).