x86/msi: dynamically map pages for MSI-X tables
Quoted 30 lines · Roger Pau Monné
Quoted 21 lines · Jan Beulich
Quoted 8 lines · Roger Pau Monné
Quoted 7 lines · Ruben Hakobyan
Xen reserves a constant number of pages that can be used for mapping MSI-X tables. This limit is defined by
FIX_MSIX_MAX_PAGESinfixmap.h.Reserving a fixed number of pages could result in an
-ENOMEMif a device requests a new page when the fixmap limit is exhausted and will necessitate manually adjusting the limit before compilation.Quoted 7 lines
Quoted 3 lines
To avoid the issues with the current fixmap implementation, we modify the MSI-X page mapping logic to instead dynamically map new pages when they are needed by making use of
ioremap().I wonder if Arm plans to reuse this code, and whether then arm32 would better keep the fixmap implementation to avoid exhausting virtual address space in that case.
I think this would then need to be something that 32-bit architectures do specially. Right now aiui PCI (and hence MSI-X) work on Arm targets only Arm64.
Quoted 6 lines
Quoted 2 lines
This also have the side effect of
ioremap()now possibly allocating a page in order to fill the page table for the newly allocated VA.Indeed, but I think the (vague) plan to switch to
ioremap()has been around for a pretty long time (perhaps forever since 32-bit support was purged).
Quoted 5 lines
Yup, I'm not saying the above should block the patch, but might be worth mentioning in the commit message.
Roger.
Sure, I will add a note in the commit message regarding the possible use of this patch for 32-bit architectures.
Regarding other comments you made on the patch, I have noted them all and agree with your suggestions. I will send out a new version.
Thanks for reviewing the patch!
Ruben.