mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-02-24 05:05:05 -07:00
msi: Guard msi/msix_write_config with msi_present
Terminate msi/msix_write_config early if support is not enabled. This allows to remove checks at the caller site if MSI is optional. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
cbd2d4342b
commit
7c9958b043
2 changed files with 3 additions and 2 deletions
3
hw/msi.c
3
hw/msi.c
|
|
@ -276,7 +276,8 @@ void msi_write_config(PCIDevice *dev, uint32_t addr, uint32_t val, int len)
|
|||
unsigned int vector;
|
||||
uint32_t pending;
|
||||
|
||||
if (!ranges_overlap(addr, len, dev->msi_cap, msi_cap_sizeof(flags))) {
|
||||
if (!msi_present(dev) ||
|
||||
!ranges_overlap(addr, len, dev->msi_cap, msi_cap_sizeof(flags))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ void msix_write_config(PCIDevice *dev, uint32_t addr,
|
|||
int vector;
|
||||
bool was_masked;
|
||||
|
||||
if (!range_covers_byte(addr, len, enable_pos)) {
|
||||
if (!msix_present(dev) || !range_covers_byte(addr, len, enable_pos)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue