-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x86: Emulate interrupt remapping support to enable x2APIC usage
If we want to use x2APIC on real hardware (virtual machines do not have this limitation), interrupt remapping has to be enabled. As we take over hardware control from Linux, we either have to switch the APIC modes on handover (tricky specifically for x2APIC->xAPIC) or let Linux boot with interrupt remapping already enable. We choose the latter way as the cleaner one that also allow us to run Linux without xAPIC emulation (non-root cells are expected to use the x2APIC unconditionally). IR emulation requires both the interpretation of the interrupt remapping table that Linux uses (vtd_get_remapped_root_int) as well as basic queued invalidation emulation (vtd_emulate_qi_request). We also need to handle FSTS register reads, but we simply return 0 here and let Jailhouse report all faults. Physical address provided by Linux via registers and data structures are mapped on demand into the hypervisor. This avoids that we create a static mapping that depends on Linux-controlled parameters (would be bad for check-summing). We also make sure this way that the addressed memory still belongs to Linux. Returning IR and QI to Linux is more complex than stealing it because we not only have to load overwritten registers with their original values: the Invalidation Queue Head cannot be set by software. Instead, we need to inject dummy invalidation wait requests until the hardware reaches the value Linux expects. Note that this IR emulation feature is solely designed to be used by the root cell. Non-root cells have to continue to program the virtualized interrupt registers of assigned devices. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
- Loading branch information
1 parent
e2c14a2
commit 20b09b8
Showing
8 changed files
with
374 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.