qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH 1/2] pci: Automatically patch PCI vendor id and


From: Michael S. Tsirkin
Subject: [Qemu-devel] Re: [PATCH 1/2] pci: Automatically patch PCI vendor id and device id in PCI ROM
Date: Mon, 18 Oct 2010 19:58:21 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Oct 18, 2010 at 07:55:11PM +0200, Stefan Weil wrote:
> PCI devices with different vendor or device ids sometimes share
> the same rom code. Only the ids and the checksum
> differs in a boot rom for such devices.
> 
> The i825xx ethernet controller family is a typical example
> which is implemented in hw/eepro100.c. It uses at least
> 3 different device ids, so normally 3 boot roms would be needed.
> 
> By automatically patching vendor id and device id (and the checksum)
> in qemu, all emulated family members can share the same boot rom.
> 
> VGA bios roms are another example with different vendor and device ids.
> 
> v2:
> 
> * Patch also the vendor id (and remove the sanity check for vendor id).
> 
> Cc: Gerd Hoffmann <address@hidden>
> Cc: Markus Armbruster <address@hidden>
> Cc: Michael S. Tsirkin <address@hidden>
> Signed-off-by: Stefan Weil <address@hidden>
> ---
>  hw/pci.c |   58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 58 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/pci.c b/hw/pci.c
> index 1280d4d..139eb24 100644
> --- a/hw/pci.c
> +++ b/hw/pci.c
> @@ -1797,6 +1797,62 @@ static void pci_map_option_rom(PCIDevice *pdev, int 
> region_num, pcibus_t addr, p
>      cpu_register_physical_memory(addr, size, pdev->rom_offset);
>  }
>  
> +/* Patch the PCI vendor and device ids in a PCI rom image if necessary.
> +   This is needed for an option rom which is used for more than one device. 
> */
> +static void pci_patch_ids(PCIDevice *pdev, uint8_t *ptr, int size)

let's return an error code on malformed roms so management can detect errors?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]