OvmfPkg/VirtNorFlashDxe: avoid array mode switch after each word write
NorFlashWriteSingleWord() switches into programming mode and back into array mode for every single word that it writes. Under KVM, this involves tearing down the read-only memslot, and setting it up again, which is costly and unnecessary. Instead, move the array mode switch into the callers, and only make the switch when the writing is done. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
This commit is contained in:
committed by
mergify[bot]
parent
83f11f9572
commit
ca01e6216a
@@ -280,6 +280,9 @@ NorFlashWriteFullBlock (
|
||||
}
|
||||
|
||||
EXIT:
|
||||
// Put device back into Read Array mode
|
||||
SEND_NOR_COMMAND (Instance->DeviceBaseAddress, 0, P30_CMD_READ_ARRAY);
|
||||
|
||||
if (!EfiAtRuntime ()) {
|
||||
// Interruptions can resume.
|
||||
gBS->RestoreTPL (OriginalTPL);
|
||||
|
Reference in New Issue
Block a user