summaryrefslogtreecommitdiff
path: root/drivers/ptp/ptp_kvm_arm.c
diff options
context:
space:
mode:
authorJeremi Piotrowski <jpiotrowski@linux.microsoft.com>2023-03-08 18:05:31 +0300
committerJakub Kicinski <kuba@kernel.org>2023-03-18 07:57:52 +0300
commit6365ba64b4dbe8b59ddaeaa724b281f3787715d5 (patch)
tree22b37a8da0da4dcbb9ef3d98511d60c9f9ab3bcf /drivers/ptp/ptp_kvm_arm.c
parent1118aa4c70a6978afb0c4391ad29826c14b842b3 (diff)
downloadlinux-6365ba64b4dbe8b59ddaeaa724b281f3787715d5.tar.xz
ptp: kvm: Use decrypted memory in confidential guest on x86
KVM_HC_CLOCK_PAIRING currently fails inside SEV-SNP guests because the guest passes an address to static data to the host. In confidential computing the host can't access arbitrary guest memory so handling the hypercall runs into an "rmpfault". To make the hypercall work, the guest needs to explicitly mark the memory as decrypted. Do that in kvm_arch_ptp_init(), but retain the previous behavior for non-confidential guests to save us from having to allocate memory. Add a new arch-specific function (kvm_arch_ptp_exit()) to free the allocation and mark the memory as encrypted again. Signed-off-by: Jeremi Piotrowski <jpiotrowski@linux.microsoft.com> Link: https://lore.kernel.org/r/20230308150531.477741-1-jpiotrowski@linux.microsoft.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/ptp/ptp_kvm_arm.c')
-rw-r--r--drivers/ptp/ptp_kvm_arm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/ptp/ptp_kvm_arm.c b/drivers/ptp/ptp_kvm_arm.c
index b7d28c8dfb84..e68e6943167b 100644
--- a/drivers/ptp/ptp_kvm_arm.c
+++ b/drivers/ptp/ptp_kvm_arm.c
@@ -22,6 +22,10 @@ int kvm_arch_ptp_init(void)
return 0;
}
+void kvm_arch_ptp_exit(void)
+{
+}
+
int kvm_arch_ptp_get_clock(struct timespec64 *ts)
{
return kvm_arch_ptp_get_crosststamp(NULL, ts, NULL);