qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: BALATON Zoltan <balaton@eik.bme.hu>
Cc: qemu-devel@nongnu.org, "Bernhard Beschow" <shentey@gmail.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Ani Sinha" <anisinha@redhat.com>,
	qemu-block@nongnu.org,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"John Snow" <jsnow@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>,
	"Markus Armbruster" <armbru@redhat.com>
Subject: Re: [PATCH v2 08/15] hw/pci-bridge: Extract QOM ICH definitions to 'ich9_dmi.h'
Date: Mon, 26 Feb 2024 14:39:48 +0100	[thread overview]
Message-ID: <0925a53b-bd37-43c4-a4e8-ec031fb5de23@linaro.org> (raw)
In-Reply-To: <d65ee3cc-70f1-b0f4-0fd2-8c50b369556d@eik.bme.hu>

On 26/2/24 14:23, BALATON Zoltan wrote:
> On Mon, 26 Feb 2024, Philippe Mathieu-Daudé wrote:
>> On 26/2/24 14:01, BALATON Zoltan wrote:
>>> On Mon, 26 Feb 2024, Philippe Mathieu-Daudé wrote:
>>>> Expose TYPE_ICH_DMI_PCI_BRIDGE to the new
>>>> "hw/pci-bridge/ich9_dmi.h" header.
>>>
>>> Since this is effectively an empty object (that's not even 
>>> instantiated by default) I still think that instead of adding even 
>>> more files for it all this could just be moved to hw/isa/lpc_ich9.c 
>>> and define there as an internal object and drop the 
>>> OBJECT_DECLARE_SIMPLE_TYPE(I82801b11Bridge, ICH_DMI_PCI_BRIDGE) and 
>>> just use the size of the superclass as it's instance size. That just 
>>> adds the realize function and a type definition and gets rid of 
>>> boilerplate scattered around the source tree which just adds 
>>> complexity for no reason. But I don't care too much about it, just 
>>> wanted to say again that if something can be kept simple I'd prefer 
>>> that over making it more complex and for this device it looks already 
>>> too complex for what it does or used for.
>>
>> My understanding was project coherency and style is preferred over
>> simplifications / optimizations, so we prefer explicit TYPE_FOO
>> and corresponding OBJECT_DECLARE_XXX() in a public include/hw/foo
>> header -- because it will end up copy/pasted --, but I might be
>> wrong.
> 
> For classes that are actually used that may be true but this class isn't 
> used anywhere just defined for the user to be instantiated from command 
> line or config. So you won't even need a type name in code currently. 
> It's also an internal part of ICH southbridge so no need to be exposed 
> outside of that as it's only useful within that chip. Finally it has no 
> functionality, just an empty boilerplate so that the device appears in 
> lspci output but it does nothing. Therefore, I think it's simpler to 
> just move all of it within the same file where the southbridge is 
> implemented and define as empty object there like the via-mc97 device in 
> hw/audio/via-ac97.c which serves the same purpose to show the part to 
> the guest but its empty device without function. That would save half of 
> all this boilerplate that just adds complexity now. If sometimes in the 
> future this device gains some functionality then it can be split off and 
> add all the defines and stuff around it but that's not needed yet so why 
> not keep it simple?

Like you, I don't care much about the ICH9 device. However it seemed
a complex-enough chipset worth trying to model it right with QDev so
we could then split the code in QOM Properties / QDev API / real
implementation to prototype a DSL, generate the QDev boiler plate and
keep the implementation part. Again, price worth to spend a bit in
order to get something simpler later.


  reply	other threads:[~2024-02-26 14:50 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26 11:13 [PATCH v2 00/15] hw/southbridge: Extract ICH9 QOM container model Philippe Mathieu-Daudé
2024-02-26 11:14 ` [PATCH v2 01/15] MAINTAINERS: Add 'ICH9 South Bridge' section Philippe Mathieu-Daudé
2024-02-26 11:14 ` [PATCH v2 02/15] hw/i386/q35: Add local 'lpc_obj' variable Philippe Mathieu-Daudé
2024-02-26 11:14 ` [PATCH v2 03/15] hw/acpi/ich9: Restrict definitions from 'hw/southbridge/ich9.h' Philippe Mathieu-Daudé
2024-02-26 11:14 ` [PATCH v2 04/15] hw/acpi/ich9_tco: Include 'ich9' in names Philippe Mathieu-Daudé
2024-02-26 11:14 ` [PATCH v2 05/15] hw/acpi/ich9_tco: Restrict ich9_generate_smi() declaration Philippe Mathieu-Daudé
2024-02-26 11:14 ` [PATCH v2 06/15] hw/ide: Rename ich.c -> ich9_ahci.c Philippe Mathieu-Daudé
2024-02-26 12:52   ` BALATON Zoltan
2024-02-26 13:13     ` Philippe Mathieu-Daudé
2024-02-26 13:27       ` BALATON Zoltan
2024-02-26 11:14 ` [PATCH v2 07/15] hw/i2c/smbus: Extract QOM ICH9 definitions to 'ich9_smbus.h' Philippe Mathieu-Daudé
2024-02-26 11:14 ` [PATCH v2 08/15] hw/pci-bridge: Extract QOM ICH definitions to 'ich9_dmi.h' Philippe Mathieu-Daudé
2024-02-26 13:01   ` BALATON Zoltan
2024-02-26 13:11     ` Philippe Mathieu-Daudé
2024-02-26 13:23       ` BALATON Zoltan
2024-02-26 13:39         ` Philippe Mathieu-Daudé [this message]
2024-02-26 11:14 ` [PATCH v2 09/15] hw/southbridge/ich9: Introduce TYPE_ICH9_SOUTHBRIDGE stub Philippe Mathieu-Daudé
2024-02-26 11:14 ` [PATCH v2 10/15] hw/southbridge/ich9: Add the DMI-to-PCI bridge Philippe Mathieu-Daudé
2024-02-26 22:52   ` Bernhard Beschow
2024-02-26 11:14 ` [PATCH v2 11/15] hw/southbridge/ich9: Add a AHCI function Philippe Mathieu-Daudé
2024-04-15  8:05   ` Bernhard Beschow
2024-02-26 11:14 ` [PATCH v2 12/15] hw/southbridge/ich9: Add the SMBus function Philippe Mathieu-Daudé
2024-02-26 11:14 ` [PATCH v2 13/15] hw/southbridge/ich9: Add the USB EHCI/UHCI functions Philippe Mathieu-Daudé
2024-02-26 11:14 ` [PATCH v2 14/15] hw/southbridge/ich9: Extract LPC definitions to 'hw/isa/ich9_lpc.h' Philippe Mathieu-Daudé
2024-02-26 11:14 ` [PATCH v2 15/15] hw/southbridge/ich9: Add the LPC / ISA bridge function Philippe Mathieu-Daudé
2024-02-26 13:07 ` [PATCH v2 00/15] hw/southbridge: Extract ICH9 QOM container model Philippe Mathieu-Daudé
2024-02-26 22:44 ` Bernhard Beschow
2024-03-12 16:49 ` Michael S. Tsirkin

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=0925a53b-bd37-43c4-a4e8-ec031fb5de23@linaro.org \
    --to=philmd@linaro.org \
    --cc=anisinha@redhat.com \
    --cc=armbru@redhat.com \
    --cc=balaton@eik.bme.hu \
    --cc=berrange@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=imammedo@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=shentey@gmail.com \
    --cc=thuth@redhat.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 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).