[Qemu-devel] [PATCH] hw/i386: The i440fx is not a machine, remove it from the machine list

Philippe Mathieu-Daudé posted 1 patch 5 years ago
Test asan passed
Test checkpatch passed
Test docker-clang@ubuntu passed
Test docker-mingw@fedora passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190427141905.20393-1-philmd@redhat.com
Maintainers: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Richard Henderson <rth@twiddle.net>, Paolo Bonzini <pbonzini@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>
default-configs/i386-softmmu.mak | 1 -
hw/i386/Kconfig                  | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
[Qemu-devel] [PATCH] hw/i386: The i440fx is not a machine, remove it from the machine list
Posted by Philippe Mathieu-Daudé 5 years ago
When building with CONFIG_ISAPC=n and CONFIG_I440FX=y we get:

  $ make subdir-x86_64-softmmu
  [...]
  /usr/bin/ld: hw/i386/pc_piix.o: in function `pc_init1':
  /source/qemu/hw/i386/pc_piix.c:261: undefined reference to `isa_ide_init'
  /usr/bin/ld: /source/qemu/hw/i386/pc_piix.c:261: undefined reference to `isa_ide_init'
  collect2: error: ld returned 1 exit status
  make[1]: *** [Makefile:204: qemu-system-x86_64] Error 1

This is because the I440FX device is a North Bridge, not a machine.
It is however used by the ISAPC machine.

Correct the dependency in the ISAPC Kconfig.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 default-configs/i386-softmmu.mak | 1 -
 hw/i386/Kconfig                  | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index ba3fb3ff50a..b33f5952128 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -23,5 +23,4 @@
 # Boards:
 #
 CONFIG_ISAPC=y
-CONFIG_I440FX=y
 CONFIG_Q35=y
diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig
index a6aed7c1313..9211adf2bb3 100644
--- a/hw/i386/Kconfig
+++ b/hw/i386/Kconfig
@@ -69,7 +69,7 @@ config ISAPC
     select VGA_ISA
     # FIXME: it is in the same file as i440fx, and does not compile
     # if separated
-    depends on I440FX
+    select I440FX
 
 config Q35
     bool
-- 
2.20.1


Re: [Qemu-devel] [PATCH] hw/i386: The i440fx is not a machine, remove it from the machine list
Posted by Thomas Huth 5 years ago
On 27/04/2019 16.19, Philippe Mathieu-Daudé wrote:
> When building with CONFIG_ISAPC=n and CONFIG_I440FX=y we get:
> 
>   $ make subdir-x86_64-softmmu
>   [...]
>   /usr/bin/ld: hw/i386/pc_piix.o: in function `pc_init1':
>   /source/qemu/hw/i386/pc_piix.c:261: undefined reference to `isa_ide_init'
>   /usr/bin/ld: /source/qemu/hw/i386/pc_piix.c:261: undefined reference to `isa_ide_init'
>   collect2: error: ld returned 1 exit status
>   make[1]: *** [Makefile:204: qemu-system-x86_64] Error 1
> 
> This is because the I440FX device is a North Bridge, not a machine.

Really? I thought CONFIG_I440FX was there to configure the
"pc-i440fx-x.y" machine types?

 Thomas

Re: [Qemu-devel] [PATCH] hw/i386: The i440fx is not a machine, remove it from the machine list
Posted by Philippe Mathieu-Daudé 5 years ago
On 4/27/19 4:49 PM, Thomas Huth wrote:
> On 27/04/2019 16.19, Philippe Mathieu-Daudé wrote:
>> When building with CONFIG_ISAPC=n and CONFIG_I440FX=y we get:
>>
>>   $ make subdir-x86_64-softmmu
>>   [...]
>>   /usr/bin/ld: hw/i386/pc_piix.o: in function `pc_init1':
>>   /source/qemu/hw/i386/pc_piix.c:261: undefined reference to `isa_ide_init'
>>   /usr/bin/ld: /source/qemu/hw/i386/pc_piix.c:261: undefined reference to `isa_ide_init'
>>   collect2: error: ld returned 1 exit status
>>   make[1]: *** [Makefile:204: qemu-system-x86_64] Error 1
>>
>> This is because the I440FX device is a North Bridge, not a machine.
> 
> Really? I thought CONFIG_I440FX was there to configure the
> "pc-i440fx-x.y" machine types?

Ah, I just found in hw/i386/pc_piix.c:

    if (pcmc->pci_enabled) {
        pci_bus = i440fx_init(host_type,
                              pci_type,
                              &i440fx_state, &piix3_devfn,
                              &isa_bus, pcms->gsi,
                              system_memory, system_io,
                              machine->ram_size,
                              pcms->below_4g_mem_size,
                              pcms->above_4g_mem_size,
                              pci_memory, ram_memory);
        pcms->bus = pci_bus;
    } else {
        pci_bus = NULL;
        i440fx_state = NULL;
        isa_bus = isa_bus_new(NULL, get_system_memory(), system_io,
                              &error_abort);
        no_hpet = 1;
    }

So I guess I'll have to figure it out from here ;)

Thanks,

Phil.