Re: [PATCH 1/6] hw/arm: Inline sysbus_create_simple(PL110 / PL111)

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

 



Hi,

On 19/2/24 15:05, BALATON Zoltan wrote:
On Mon, 19 Feb 2024, Mark Cave-Ayland wrote:
On 19/02/2024 13:05, Peter Maydell wrote:
On Mon, 19 Feb 2024 at 12:49, Mark Cave-Ayland
<mark.cave-ayland@xxxxxxxxxxxx> wrote:

On 19/02/2024 12:00, BALATON Zoltan wrote:
For new people trying to contribute to QEMU QDev is overwhelming so having some way
to need less of it to do simple things would help them to get started.

It depends what how you define "simple": for QEMU developers most people search for similar examples in the codebase and copy/paste them. I'd much rather have a slightly longer, but consistent API for setting properties rather than coming up with many special case wrappers that need to be maintained just to keep the line count down for
"simplicity".

I think that Phil's approach here is the best one for now, particularly given that it allows us to take another step towards heterogeneous machines. As the work in this area matures it might be that we can consider other approaches, but that's not a decision that can be made right now and so shouldn't be a reason to block this change.

Mmm. It's unfortunate that we're working with C, so we're a bit limited
in what tools we have to try to make a better and lower-boilerplate
interface for the "create, configure, realize and wire up devices" task.
(I think you could do much better in a higher level language...)
sysbus_create_simple() was handy at the time, but it doesn't work so
well for more complicated SoC-based boards. It's noticeable that
if you look at the code that uses it, it's almost entirely the older
and less maintained board models, especially those which don't actually
model an SoC and just have the board code create all the devices.

Yeah I was thinking that you'd use the DSL (e.g. YAML templates or similar) to provide some of the boilerplating around common actions, rather than the C API itself. Even better, once everything has been moved to use a DSL then the C API shouldn't really matter so much as it is no longer directly exposed to the user.

That may be a few more releases away (although Philippe is doing an excellent job with doing this all alone and as efficient as he is it might be reached sooner). So I think board code will stay for a while therefore if something can be done to keep it simple with not much work then maybe that's worth considering. That's why I did not propose to keep sysbus_create_simple and add properties to it because that might need something like a properties array with values that's hard to describe in C so it would be a bit more involved to implement and defining such arrays would only make it a litle less cluttered. So just keeping the parts that work for simple devices in sysbus_realize_simple and also keep sysbus_create_simple where it's already used is probably enough now rather than converting those to low level calls everywhere now.

Then we'll see how well the declarative machines will turn out and then if we no longer need to write board code these wrappers could go away then but for now it may be too early when we still have a lot of board code to maintain.

I'll keep forward with this patch inlining sysbus_create_simple();
if we notice in few releases the DSL experiment is a failure, I don't
mind going back reverting it.

Regards,

Phil.




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux