Commit 7c5b95a2 authored by Yu Zhang's avatar Yu Zhang
Browse files

KVM: x86/mmu: Introduce the on_unlock hook to flush the cache for SEV

Intel inclusion
category: feature
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I7S3VQ


CVE: NA

----------------------------------------------------------------------

Add on_unlock in struct kvm_hva_range, which is initialized to
kvm_arch_guest_memory_reclaimed(), so that the CPU caches can be
flushed when memory is reclaimed from an SEV guest.

This is done in upstreaming commit 683412cc ("KVM: SEV: add cache
flush to solve SEV cache incoherency issues"), and backported into
openEuler without using the on_unlock hook in commit 5e0a0560,
supposedly due to the lack of a group of MMU notifier consolidation
and optimization patches - especially upstreaming commit f922bd9b
("KVM: Move MMU notifier's mmu_lock acquisition into common helper"),
and commit 8931a454 ("KVM: Take mmu_lock when handling MMU notifier
iff the hva hits a memslot").

With these 2 patches backported, we cook this seperate patch to align
with upstreaming methods to flush cache when page is reclaimed for SEV
guests.

Signed-off-by: default avatarYu Zhang <yu.c.zhang@linux.intel.com>
parent dea4c3b2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment