msi: report error for attempt to use APIC ID > 255
The MSI/MSI-X address includes 8 bits to encode the Destination ID. Previously IDs over 255 overlapped with the fixed portion of the address, resulting in an invalid value (and a nonfunctional interrupt). Instead, print an error message and return EINVAL. The interrupt will still not work, but the user will have a clue as to why. PR: 273022 Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41395
This commit is contained in:
parent
13da84237a
commit
cbf845052f
@ -620,6 +620,11 @@ msi_map(int irq, uint64_t *addr, uint32_t *data)
|
|||||||
mtx_unlock(&msi_lock);
|
mtx_unlock(&msi_lock);
|
||||||
error = EOPNOTSUPP;
|
error = EOPNOTSUPP;
|
||||||
#endif
|
#endif
|
||||||
|
if (error == EOPNOTSUPP && msi->msi_cpu > 0xff) {
|
||||||
|
printf("%s: unsupported destination APIC ID %u\n", __func__,
|
||||||
|
msi->msi_cpu);
|
||||||
|
error = EINVAL;
|
||||||
|
}
|
||||||
if (error == EOPNOTSUPP) {
|
if (error == EOPNOTSUPP) {
|
||||||
*addr = INTEL_ADDR(msi);
|
*addr = INTEL_ADDR(msi);
|
||||||
*data = INTEL_DATA(msi);
|
*data = INTEL_DATA(msi);
|
||||||
|
Loading…
Reference in New Issue
Block a user