All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, Thomas Huth <thuth@redhat.com>
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Yanan Wang" <wangyanan55@huawei.com>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	qemu-arm@nongnu.org, "Eduardo Habkost" <eduardo@habkost.net>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH] hw/arm: Move the "arm-cpu" compat settings out of hw/core/machine.c
Date: Wed, 21 Jan 2026 18:36:30 +0100	[thread overview]
Message-ID: <875x8uuau9.fsf@redhat.com> (raw)
In-Reply-To: <CAFEAcA_0xM47w6tLgGSrXZO2v1S+ncq92N_h3U=HQENapzyU9Q@mail.gmail.com>

On Tue, Jan 20 2026, Peter Maydell <peter.maydell@linaro.org> wrote:

> On Tue, 20 Jan 2026 at 14:15, Thomas Huth <thuth@redhat.com> wrote:
>>
>> On 20/01/2026 13.55, Peter Maydell wrote:
>> > On Tue, 20 Jan 2026 at 12:21, Thomas Huth <thuth@redhat.com> wrote:
>> >>
>> >> From: Thomas Huth <thuth@redhat.com>
>> >>
>> >> The hw_compat_* arrays in hw/core/machine.c should be used for generic
>> >> compat settings that might affect all (or at least multiple) machines.
>> >> Target specific settings should rather go into the target specific
>> >> source files instead. For arm/aarch64, the virt machine is the only
>> >> one that cares about compat settings, so move the "arm-cpu" related
>> >> switches to hw/arm/virt.c now.

FWIW, this is not the only arch-specific setting in there, and I don't
think it's really bothersome. There are many compat settings that might
not be applicable when you spin up a machine, and that's fine.

>> >
>> > I think it makes more sense for all the compat stuff to
>> > live in one place, rather than being scattered around,
>> > unless it is truly machine-specific (which this isn't).
>>
>> It's only used by the arm virt machine, so it's IMHO machine specific.
>> If we will ever get other versionized arm machines, they won't use these
>> config knobs, so this never will be shared with another machine.
>
> It happens to be only used by the virt board, but that's just
> a coincidence that we only have one versioned arm board right
> now. The config knob itself is not at all board specific:
> it applies to a device object that is used by many boards and
> sets a behaviour that would usefully apply to all of them.
> If we ever did have more arm versioned machines in the future
> we'd end up with a weird split where compat properties of the CPU
> object that happened to pre-date the addition of that second
> machine type would be in one place in the source code, and
> properties that happened to post-date the second machine
> type would be somewhere else.

I think there are only two options that really make sense:
- keep the compat setting where it is
- introduce an arm specific compat array that can be included by the
  virt machine and any future versioned arm machine

Not sure if the latter is actually worth the hassle.



      reply	other threads:[~2026-01-21 17:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-20 12:21 [PATCH] hw/arm: Move the "arm-cpu" compat settings out of hw/core/machine.c Thomas Huth
2026-01-20 12:55 ` Peter Maydell
2026-01-20 14:15   ` Thomas Huth
2026-01-20 14:24     ` Peter Maydell
2026-01-21 17:36       ` Cornelia Huck [this message]

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=875x8uuau9.fsf@redhat.com \
    --to=cohuck@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    --cc=wangyanan55@huawei.com \
    --cc=zhao1.liu@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.