-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
platform: implement
SvsmPlatform::is_external_interrupt
for TDP.
The TDP platform must use APIC virtualization to check whether a given interrupt event originates from a hardware interrupt or a software interrupt. This change implements the logic to read the required state from the APIC. Signed-off-by: Jon Lange <[email protected]>
- Loading branch information
1 parent
5cd227c
commit 6ef4e57
Showing
4 changed files
with
23 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// SPDX-License-Identifier: MIT | ||
// | ||
// Copyright (c) Microsoft Corporation | ||
// | ||
// Author: Jon Lange <[email protected]> | ||
|
||
pub const APIC_MSR_EOI: u32 = 0x80B; | ||
pub const APIC_MSR_ISR: u32 = 0x810; | ||
pub const APIC_MSR_ICR: u32 = 0x830; | ||
|
||
// Returns the MSR offset and bitmask to identify a specific vector in an | ||
// APIC register (IRR, ISR, or TMR). | ||
pub fn apic_register_bit(vector: usize) -> (u32, u32) { | ||
let index: u8 = (vector & 0xFF) as u8; | ||
((index >> 5) as u32, 1 << (index & 0x1F)) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
// | ||
// Authors: Thomas Leroy <[email protected]> | ||
|
||
pub mod apic; | ||
pub mod smap; |
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