]> xenbits.xensource.com Git - unikraft/unikraft.git/commit
plat/kvm: Do not unconditionally clean and invalidate the cache
authorMichalis Pappas <michalis@unikraft.io>
Thu, 13 Jul 2023 11:06:08 +0000 (13:06 +0200)
committerUnikraft <monkey@unikraft.io>
Tue, 15 Aug 2023 19:23:41 +0000 (19:23 +0000)
commita3c74da53303ff1eab828d2c753a8624fddec7bf
tree45cd8c9b4adbaaa5d6f25694a87bba2c497be747
parentad856986c86b3b4fdf78be76582530c96ec47cb1
plat/kvm: Do not unconditionally clean and invalidate the cache

The arm64 linux boot protocol provides the requirements for
the system's state before jumping into the kernel [1]. Among
these it is required that upon entry:

- The MMU is off
- The D-cache for the region corresponging to the loaded image
  must be cleaned to the point of coherence.

Skip expensive cache clean & invalidate operations if the MMU is
found to be disabled at boot. Although this heuristic is not
strictly required it provides with some additional confidence
that the bootloader behaves as expected.

With a clean cache, additionally optmize cache invalidations by
limiting them to the regions accessed before the MMU is enabled.

[1] https://www.kernel.org/doc/Documentation/arm64/booting.txt

Signed-off-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #1049
plat/kvm/arm/entry64.S