Re: [PATCH RFC] hvmloader: Make ROM dependencies optional

Ian Campbell
Wed, 08 Feb 2012 13:28:59 -0000

On Sun, 2012-02-05 at 16:18 +0000, Julian Pidancet
wrote:
> When booting HVMs with SeaBIOS, the BIOS itself takes care of extracting
> option ROMs from the PCI devices. These ROMs are usually provided with by
> the device model (qemu).
> Thus, hvmloader should not require any longer the rombios, stdvga,
> cirrusvga or etherboot ROMs to be present.
>
> Also, the 32bitbios_support.c file is specific to rombios and should not
> be built when building hvmloader with seabios.

> [...]
> @@ -475,16 +477,20 @@ int main(void)
>         switch ( virtual_vga )
>          {
>          case VGA_cirrus:
> +#ifdef ENABLE_CIRRUSVGA

Just outside the context here is an "if ( bios->load_roms )" which
prevents the ROMs from being loaded if we are using SeaBIOS -- is that
not sufficient for your needs?

Currently hvmloader builds with support for both ROMBIOS and SeaBIOS and
selects the one to use based on a configuration key in xenstore (pushed
down by the toolstack depending on which qemu you are running). Have you
modified something elsewhere in order to build a SeaBIOS-only hvmloader?

Perhaps it would make sense for the ROMs to be keyed off whether or not
ROMBIOS is enabled rather than each keying off their own DIR var?

You seem to have mixed some other changes, specifically s/:=/?=/ in a
few places and also some sort of change wrt how eb-roms.h is generated
(including dropping the 8086100e ROM from the image, which must be
discussed).

These other changes should be submitted and rationalised separately.

Ian.


>              printf("Loading Cirrus VGABIOS ...\n");
>              memcpy((void *)VGABIOS_PHYSICAL_ADDRESS,
>                     vgabios_cirrusvga, sizeof(vgabios_cirrusvga));
>              vgabios_sz = round_option_rom(sizeof(vgabios_cirrusvga));
> +#endif
>              break;
>          case VGA_std:
> +#ifdef ENABLE_STDVGA
>              printf("Loading Standard VGABIOS ...\n");
>              memcpy((void *)VGABIOS_PHYSICAL_ADDRESS,
>                     vgabios_stdvga, sizeof(vgabios_stdvga));
>              vgabios_sz = round_option_rom(sizeof(vgabios_stdvga));
> +#endif
>              break;
>          case VGA_pt:
>              printf("Loading VGABIOS of passthroughed gfx
...\n");
> @@ -496,13 +502,16 @@ int main(void)
>              break;
>          }
>
> -        etherboot_phys_addr = VGABIOS_PHYSICAL_ADDRESS + vgabios_sz;
> +        option_rom_phys_addr = VGABIOS_PHYSICAL_ADDRESS + vgabios_sz;
> +#ifdef ENABLE_ETHERBOOT
> +        etherboot_phys_addr = option_rom_phys_addr;
>          if ( etherboot_phys_addr < bios->optionrom_start )
>              etherboot_phys_addr = bios->optionrom_start;
>          etherboot_sz = scan_etherboot_nic(bios->optionrom_end,
>                                            etherboot_phys_addr);
>
> -        option_rom_phys_addr = etherboot_phys_addr + etherboot_sz;
> +        option_rom_phys_addr += etherboot_sz;
> +#endif
>          option_rom_sz = pci_load_option_roms(bios->optionrom_end,
>                                               option_rom_phys_addr);
>      }