Skip to content

Commit

Permalink
OvmfPkg: Disable 8254/8259 timer in Td guest
Browse files Browse the repository at this point in the history
TODO: Add more description
  • Loading branch information
mxu9 committed Mar 24, 2021
1 parent 4b00dcd commit 10b16da
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions OvmfPkg/8254TimerDxe/8254Timer.inf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
DebugLib
UefiDriverEntryPoint
IoLib
TdxProbeLib

[Sources]
Timer.h
Expand Down
5 changes: 5 additions & 0 deletions OvmfPkg/8254TimerDxe/Timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#include "Timer.h"
#include <Library/TdxProbeLib.h>

//
// The handle onto which the Timer Architectural Protocol will be installed
Expand Down Expand Up @@ -340,6 +341,10 @@ TimerDriverInitialize (
EFI_STATUS Status;
UINT32 TimerVector;

if(ProbeTdGuest()) {
return EFI_UNSUPPORTED;
}

//
// Initialize the pointer to our notify function.
//
Expand Down
4 changes: 4 additions & 0 deletions OvmfPkg/8259InterruptControllerDxe/8259.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent

#include "8259.h"

#include <Library/TdxProbeLib.h>
//
// Global for the Legacy 8259 Protocol that is produced by this driver
//
Expand Down Expand Up @@ -586,6 +587,9 @@ Install8259 (
EFI_STATUS Status;
EFI_8259_IRQ Irq;

if(ProbeTdGuest()) {
return EFI_UNSUPPORTED;
}
//
// Initialze mask values from PCDs
//
Expand Down
1 change: 1 addition & 0 deletions OvmfPkg/8259InterruptControllerDxe/8259.inf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
UefiDriverEntryPoint
IoLib
PcdLib
TdxProbeLib

[Protocols]
gEfiLegacy8259ProtocolGuid ## PRODUCES
Expand Down

0 comments on commit 10b16da

Please sign in to comment.