Also, add a small delay after the 0xCF9 hard reset request -- on qemu/kvm the port access is translated to the qemu-internal system reset request by the CPU thread, and it might progress some more before the IO thread acts upon the system reset request.
MicroSecondDelay() is implemented by OvmfPkg's own AcpiTimerLib. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <[email protected]> --- OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c | 5 +++++ OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf | 2 +- 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c index 85af7f1..d075fbe 100644 --- a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c +++ b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c @@ -17,6 +17,7 @@ #include <Library/BaseLib.h> #include <Library/DebugLib.h> #include <Library/IoLib.h> +#include <Library/TimerLib.h> VOID AcpiPmControl ( @@ -46,7 +47,10 @@ ResetCold ( ) { IoWrite8 (0xCF9, BIT2 | BIT1); // 1st choice: PIIX3 RCR, RCPU|SRST + MicroSecondDelay (50); + IoWrite8 (0x64, 0xfe); // 2nd choice: keyboard controller + CpuDeadLoop (); } /** @@ -63,6 +67,7 @@ ResetWarm ( ) { IoWrite8 (0x64, 0xfe); + CpuDeadLoop (); } /** diff --git a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf index 0694b4d..c4d8ce5 100644 --- a/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf +++ b/OvmfPkg/Library/ResetSystemLib/ResetSystemLib.inf @@ -35,4 +35,4 @@ [LibraryClasses] DebugLib IoLib - + TimerLib -- 1.7.1 ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb _______________________________________________ edk2-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/edk2-devel
