OpenCloudOS-Kernel/arch/x86
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
..
boot x86/boot: Move mem_encrypt= parsing to the decompressor 2024-04-10 16:36:07 +02:00
coco x86/coco: Require seeding RNG with RDRAND on CoCo systems 2024-04-10 16:36:03 +02:00
configs !147 [next-6.6] Montage:add support for Montage Mont-TSSE Driver 2024-04-29 06:49:21 +00:00
crypto crypto: x86/sm2 - add Zhaoxin SM2 algorithm implementation 2024-04-12 20:42:02 +08:00
entry x86/bhi: Add support for clearing branch history at syscall entry 2024-04-10 16:36:07 +02:00
events Merge linux 6.6.26 2024-04-13 17:34:05 +08:00
hyperv x86/hyperv: Use per cpu initial stack for vtl context 2024-03-26 18:20:06 -04:00
ia32
include KVM: x86: Introduce control_{pre,post}_system_reset ioctl interfaces 2024-05-06 11:39:12 +08:00
kernel x86/cpu/hygon: Clear SME feature flag when not in use 2024-04-25 17:27:33 +08:00
kvm KVM: SVM: Force flush caches before reboot CSV guest 2024-05-06 11:39:20 +08:00
lib Merge linux 6.6.26 2024-04-13 17:34:05 +08:00
math-emu x86/fpu: Include asm/fpu/regset.h 2023-05-18 11:56:18 -07:00
mm x86/mm: Print CSV info into the kernel log 2024-04-25 14:40:28 +08:00
net x86/bpf: Fix IP after emitting call depth accounting 2024-04-10 16:35:48 +02:00
pci x86/pci: Reserve ECAM if BIOS didn't include it in PNP0C02 _CRS 2024-01-25 15:35:48 -08:00
platform efi/x86: Move EFI runtime call setup/teardown helpers out of line 2023-09-11 06:37:50 +00:00
power mm/treewide: replace pud_large() with pud_leaf() 2024-04-10 16:35:46 +02:00
purgatory x86/purgatory: Remove LTO flags 2023-09-17 09:49:03 +02:00
ras
realmode x86/realmode: Make stack lock work in trampoline_compat() 2023-05-30 14:11:47 +02:00
tools x86, relocs: Ignore relocations in .notes section 2024-03-26 18:19:35 -04:00
um um: Hard-code the result of 'uname -s' 2023-08-26 22:40:37 +02:00
video Merge drm/drm-next into drm-misc-next 2023-07-24 15:44:47 +02:00
virt/vmx/tdx
xen mm/treewide: replace pud_large() with pud_leaf() 2024-04-10 16:35:46 +02:00
.gitignore
Kbuild
Kconfig x86/mm: Provide a Kconfig entry to build the HYGON memory encryption support into the kernel 2024-04-25 14:37:07 +08:00
Kconfig.assembler x86/shstk: Add Kconfig option for shadow stack 2023-07-11 14:12:18 -07:00
Kconfig.cpu x86/Kconfig: Transmeta Crusoe is CPU family 5, not 6 2024-02-23 09:25:10 +01:00
Kconfig.debug docs: move x86 documentation into Documentation/arch/ 2023-03-30 12:58:51 -06:00
Makefile Kbuild updates for v6.6 2023-09-05 11:01:47 -07:00
Makefile.postlink x86/build: Avoid relocation information in final vmlinux 2023-06-14 19:54:40 +02:00
Makefile.um um: Only disable SSE on clang to work around old GCC bugs 2023-04-04 09:57:05 +02:00
Makefile_32.cpu