[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v10 03/19] pcie: modify the capability size assert
From: |
Chen Fan |
Subject: |
[Qemu-devel] [RFC v10 03/19] pcie: modify the capability size assert |
Date: |
Tue, 16 Jun 2015 16:10:47 +0800 |
because the capabilities need to be DWORD aligned, so the size
should DWORD aligned too, and then the last capability size can
to be the greatest 0x1000. e.g. if I have a capability starting
4 bytes from the end, 0xFFC. The max size should be 4 bytes,
0x1000 - 0xFFC, not 3 bytes, 0xFFF - 0xFFC.
Signed-off-by: Chen Fan <address@hidden>
---
hw/pci/pcie.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index 1463e65..6cdd4a1 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -595,7 +595,7 @@ void pcie_add_capability(PCIDevice *dev,
assert(offset >= PCI_CONFIG_SPACE_SIZE);
assert(offset < offset + size);
- assert(offset + size < PCIE_CONFIG_SPACE_SIZE);
+ assert(offset + size <= PCIE_CONFIG_SPACE_SIZE);
assert(size >= 8);
assert(pci_is_express(dev));
--
1.9.3
- [Qemu-devel] [RFC v10 00/19] vfio-pci: pass the aer error to guest, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 01/19] vfio: extract vfio_get_hot_reset_info as a single function, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 03/19] pcie: modify the capability size assert,
Chen Fan <=
- [Qemu-devel] [RFC v10 02/19] vfio: squeeze out vfio_pci_do_hot_reset for support bus reset, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 04/19] vfio: make the 4 bytes aligned for capability size, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 06/19] aer: impove pcie_aer_init to support vfio device, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 08/19] vfio: add ref for group to support own affected groups, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 05/19] vfio: add pcie extanded capability support, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 10/19] vfio: improve vfio_get_group to support adding as is NULL., Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 07/19] vfio: add aer support for vfio device, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 09/19] vfio: extract vfio_register_container_listener from vfio_connect_container, Chen Fan, 2015/06/16