diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2016-03-04 11:24:28 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-03-11 16:45:21 +0200 |
commit | 226419d6153048cdba2fe722636220b01a1f9e96 (patch) | |
tree | 9c1411811af904c8e9c5f99aeb83e7f42a7fdc35 /hw/pci/msi.c | |
parent | 75fd6f13af8513f1e14add754549141e415f8704 (diff) |
msi_supported -> msi_nonbroken
Rename controller flag to make it clearer what it means.
Add some documentation as well.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci/msi.c')
-rw-r--r-- | hw/pci/msi.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/hw/pci/msi.c b/hw/pci/msi.c index 85f21b8c4b..e0e64c2d9e 100644 --- a/hw/pci/msi.c +++ b/hw/pci/msi.c @@ -34,8 +34,21 @@ #define PCI_MSI_VECTORS_MAX 32 -/* Flag for interrupt controller to declare MSI/MSI-X support */ -bool msi_supported; +/* + * Flag for interrupt controllers to declare broken MSI/MSI-X support. + * values: false - broken; true - non-broken. + * + * Setting this flag to false will remove MSI/MSI-X capability from all devices. + * + * It is preferrable for controllers to set this to true (non-broken) even if + * they do not actually support MSI/MSI-X: guests normally probe the controller + * type and do not attempt to enable MSI/MSI-X with interrupt controllers not + * supporting such, so removing the capability is not required, and + * it seems cleaner to have a given device look the same for all boards. + * + * TODO: some existing controllers violate the above rule. Identify and fix them. + */ +bool msi_nonbroken; /* If we get rid of cap allocator, we won't need this. */ static inline uint8_t msi_cap_sizeof(uint16_t flags) @@ -160,7 +173,7 @@ int msi_init(struct PCIDevice *dev, uint8_t offset, uint8_t cap_size; int config_offset; - if (!msi_supported) { + if (!msi_nonbroken) { return -ENOTSUP; } |