OpenCloudOS-Kernel/arch
hanliyang 2fb5abf978 KVM: SVM: Force flush caches before reboot CSV guest
Upstream: no

For memory encrypted guest, its pages' encrypt status will changed at
runtime. When user reboot the guest, the pages' encrypt status during
last boot were ignored. So during the boot flow of reboot, there may
be 2 versions of memory data lies in cache as follows:

                  +--------+        |              |
                  |        |        +--------------+  --+
                  |        |        |              |     \
                  |________|        |              |      \
cacheline for  -> |________| <-+    |              |       \
 pa1(c=0)         |        |    \   |______________|        \
                  |        |     \_ 64 bytes aligned <- pa1  \
                  |        |      _ |______________|           4K
                  |        |     /  |              |           page
cacheline for     |________|    /   |              |         /
 pa1(c=1)      -> |________| <-+    |              |        /
                  |        |        |              |       /
                  |        |        |              |      /
                  |        |        |              |     /
                  |        |        +--------------+  --+
                  |        |        |              |

If the older version cache was flushed after that of newer version, and
guest read the memory again, then it will get corrupted data and may
lead to crash.

In this change, for any memory encrypted guest, the cache is forcibly
flushed to memory before the next boot flow, which ensures that memory
access is up-to-date.

Signed-off-by: hanliyang <hanliyang@hygon.cn>
2024-05-06 11:39:20 +08:00
..
alpha rtc: Add support for configuring the UIP timeout for RTC reads 2024-01-31 16:18:56 -08:00
arc work around gcc bugs with 'asm goto' with outputs 2024-02-23 09:24:47 +01:00
arm ARM: prctl: reject PR_SET_MDWE on pre-ARMv6 2024-04-03 15:28:54 +02:00
arm64 add 3snic 3s9xx driver 2024-04-17 17:34:29 +08:00
csky work around gcc bugs with 'asm goto' with outputs 2024-02-23 09:24:47 +01:00
hexagon hexagon: vmlinux.lds.S: handle attributes section 2024-04-03 15:28:55 +02:00
ia64 cpu-hotplug: Provide prototypes for arch CPU registration 2023-10-11 14:27:37 +02:00
loongarch Merge linux 6.6.24 2024-04-13 14:08:38 +08:00
m68k mm: Introduce flush_cache_vmap_early() 2024-02-16 19:10:52 +01:00
microblaze Microblaze patches for 6.6-rc1 2023-09-05 10:15:22 -07:00
mips MIPS: Clear Cause.BD in instruction_pointer_set 2024-03-26 18:19:10 -04:00
nios2 mm: Introduce flush_cache_vmap_early() 2024-02-16 19:10:52 +01:00
openrisc OpenRISC updates for 6.6 2023-09-05 10:09:31 -07:00
parisc prctl: generalize PR_SET_MDWE support check to be per-arch 2024-04-03 15:28:54 +02:00
powerpc Merge linux 6.6.26 2024-04-13 17:34:05 +08:00
riscv Merge linux 6.6.26 2024-04-13 17:34:05 +08:00
s390 Merge linux 6.6.26 2024-04-13 17:34:05 +08:00
sh mm: Introduce flush_cache_vmap_early() 2024-02-16 19:10:52 +01:00
sparc mm/treewide: replace pud_large() with pud_leaf() 2024-04-10 16:35:46 +02:00
um um: Fix adding '-no-pie' for clang 2024-02-23 09:25:03 +01:00
x86 KVM: SVM: Force flush caches before reboot CSV guest 2024-05-06 11:39:20 +08:00
xtensa work around gcc bugs with 'asm goto' with outputs 2024-02-23 09:24:47 +01:00
.gitignore
Kconfig scs: add CONFIG_MMU dependency for vfree_atomic() 2024-02-23 09:24:54 +01:00