qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [6604] qemu: warn if PCI region is not power of two (Marcel


From: Anthony Liguori
Subject: [Qemu-devel] [6604] qemu: warn if PCI region is not power of two (Marcelo Tosatti)
Date: Wed, 11 Feb 2009 15:21:17 +0000

Revision: 6604
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6604
Author:   aliguori
Date:     2009-02-11 15:21:16 +0000 (Wed, 11 Feb 2009)

Log Message:
-----------
qemu: warn if PCI region is not power of two (Marcelo Tosatti)

Otherwise the PCI size for such regions can be calculated erroneously.

Signed-off-by: Marcelo Tosatti <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>

Modified Paths:
--------------
    trunk/hw/pci.c

Modified: trunk/hw/pci.c
===================================================================
--- trunk/hw/pci.c      2009-02-11 15:21:10 UTC (rev 6603)
+++ trunk/hw/pci.c      2009-02-11 15:21:16 UTC (rev 6604)
@@ -247,6 +247,13 @@
 
     if ((unsigned int)region_num >= PCI_NUM_REGIONS)
         return;
+
+    if (size & (size-1)) {
+        fprintf(stderr, "ERROR: PCI region size must be pow2 "
+                    "type=0x%x, size=0x%x\n", type, size);
+        exit(1);
+    }
+
     r = &pci_dev->io_regions[region_num];
     r->addr = -1;
     r->size = size;






reply via email to

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