]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
KVM: SVM: Flush when freeing encrypted pages even on SME_COHERENT CPUs
authorMingwei Zhang <mizhang@google.com>
Thu, 21 Apr 2022 03:14:06 +0000 (03:14 +0000)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 22 Jun 2022 12:22:23 +0000 (14:22 +0200)
commit19fc3b1e51813f847f089039404b8e1f841b8577
tree29e4f08468945a2cdbabeb16d725dbb48abdc10f
parent4869a897e04b710ef19efb602c5968b8a8108817
KVM: SVM: Flush when freeing encrypted pages even on SME_COHERENT CPUs

BugLink: https://bugs.launchpad.net/bugs/1972905
commit d45829b351ee6ec5f54dd55e6aca1f44fe239fe6 upstream.

Use clflush_cache_range() to flush the confidential memory when
SME_COHERENT is supported in AMD CPU. Cache flush is still needed since
SME_COHERENT only support cache invalidation at CPU side. All confidential
cache lines are still incoherent with DMA devices.

Cc: stable@vger.kerel.org
Fixes: add5e2f04541 ("KVM: SVM: Add support for the SEV-ES VMSA")
Reviewed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Mingwei Zhang <mizhang@google.com>
Message-Id: <20220421031407.2516575-3-mizhang@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/x86/kvm/svm/sev.c