qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [patch 13/18] qemu: warn if PCI region is not power of


From: malc
Subject: Re: [Qemu-devel] [patch 13/18] qemu: warn if PCI region is not power of two
Date: Sun, 8 Feb 2009 09:08:14 +0300 (MSK)

On Fri, 6 Feb 2009, Marcelo Tosatti wrote:

> On Wed, Feb 04, 2009 at 02:38:05PM +0000, Paul Brook wrote:
> > This should be an error. It is a requirement of the PCI spec, and not 
> > something that's user configurable. Any odd sizes indicate a fairly serious 
> > bug elsewhere in qemu.
> > 
> > Paul
> 
> qemu: bail out if PCI region is not power of two
> 
> Otherwise the PCI size for such regions can be calculated erroneously.
> 
> Signed-off-by: Marcelo Tosatti <address@hidden>
> 
> Index: trunk/hw/pci.c
> ===================================================================
> --- trunk.orig/hw/pci.c
> +++ trunk/hw/pci.c
> @@ -249,6 +249,13 @@ void pci_register_io_region(PCIDevice *p
>  
>      if ((unsigned int)region_num >= PCI_NUM_REGIONS)
>          return;
> +
> +    if (size & (size-1)) {
> +        term_printf("ERROR: PCI region size must be pow2 "
> +                    "type=0x%x, size=0x%x\n", type, size);
> +        exit(1);
> +    }
> +

If monitor is on a vc the error message would never be seen, perhaps
it's better to fprintf it stderr instead?

[..snip..]

-- 
mailto:address@hidden




reply via email to

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