On 22/10/2018 20:36, Samuel Ortiz wrote: > This patch set implements support for the ACPI hardware-reduced > specification. > > The changes are coming from the NEMU [1] project where we're defining > a new x86 machine type: i386/virt. This is an EFI only, ACPI > hardware-reduced platform and as such we had to implement support > for the latter. > > As a preliminary for adding hardware-reduced support to QEMU, we did > some ACPI code reorganization with the following goals: > > * Share as much as possible of the current ACPI build APIs between > legacy and hardware-reduced ACPI. > * Share the ACPI build code across machine types and architectures and > remove the typical PC machine type dependency. > Eventually we hope to see arm/virt also re-use much of that code. > > The rest of the patchset adds the hardware-reduced support on top of > this code reorganization. Here again, the implementation is machine > type, platform and architecture independent. > > [1] https://github.com/intel/nemu
I think the first part of the series is very valuable, and also the FirmwareBuildMethods idea is good even though I have some comments on how to model it in C. It won't make it in 3.1, but I suppose you expected that. Including the second part in QEMU however would be premature, since it is not used by anything. As mentioned earlier, my suggestion is that you convert the ARM virt machine type to FirmwareBuildMethods and HW-reduced ACPI. It shouldn't be a large amount of work and it should let you reduce the ACPI delta between QEMU and NEMU. Also, I would like to understand if you NEMU people are interested in refactoring the ACPI builder code to move DSDT-building code closer to the device, or perhaps have already done that. For example, the infamous floppy cannot be disabled right now because of the call to isa_fdc_get_drive_type in hw/i386/acpi-build.c. As I understand it, your initial patches have the side effect of letting you bypass this issue---because you don't include hw/i386/acpi-build.c in your virt machine type. That is totally fine, but of course it doesn't help if you want to compile the floppy out of a QEMU that supports -M q35 but not -M pc. Therefore I would love to know that I'm wrong, or just that you're planning to fix that too. :) Paolo