x86/vPCI: check address in vpci_msi_update()

If the upper address bits don't match the interrupt delivery address
space window, entirely different behavior would need to be implemented.
Refuse such requests for the time being.

Replace adjacent hard tabs while introducing MSI_ADDR_BASE_MASK.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
This commit is contained in:
Jan Beulich committed 2021-01-05 13:18:26 +01:00
1 parent 04b090366c
commit 0f7bcaf19f
2 files changed
+10 -2

No files matched your search

+7
View File
@@ -682,6 +682,13 @@ static int vpci_msi_update(const struct pci_dev *pdev, uint32_t data,
ASSERT(pcidevs_locked());
if ( (address & MSI_ADDR_BASE_MASK) != MSI_ADDR_HEADER )
{
gdprintk(XENLOG_ERR, "%pp: PIRQ %u: unsupported address %lx\n",
&pdev->sbdf, pirq, address);
return -EOPNOTSUPP;
}
for ( i = 0; i < vectors; i++ )
{
uint8_t vector = MASK_EXTR(data, MSI_DATA_VECTOR_MASK);
+3 -2
View File
@@ -36,8 +36,9 @@
* Shift/mask fields for msi address
*/
#define MSI_ADDR_BASE_HI 0
#define MSI_ADDR_BASE_LO 0xfee00000
#define MSI_ADDR_BASE_HI 0
#define MSI_ADDR_BASE_LO 0xfee00000
#define MSI_ADDR_BASE_MASK (~0xfffff)
#define MSI_ADDR_HEADER MSI_ADDR_BASE_LO
#define MSI_ADDR_DESTMODE_SHIFT 2
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.