mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-01 23:04:54 +01:00
pKVM does support memory encryption, expose that to the rest of the kernel through cc_platform_has() At the moment, all devices inside the guest are emulated which requires its memory to be shared back to the host (decrypted), so set force_dma_unencrypted() to always return true. Although, typically pKVM guests rely on restricted-dma-pools to bounce traffic, with this change, it is possible to solely rely on the default SWIOTLB for that (assuming the appropriate size is set from the command line) Signed-off-by: Mostafa Saleh <[email protected]> Reviewed-by: Catalin Marinas <[email protected]> Tested-by: Aneesh Kumar K.V (Arm) <[email protected]> Signed-off-by: Will Deacon <[email protected]>
36 lines
720 B
C
36 lines
720 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _ASM_ARM64_HYPERVISOR_H
|
|
#define _ASM_ARM64_HYPERVISOR_H
|
|
|
|
#include <asm/xen/hypervisor.h>
|
|
#include <linux/jump_label.h>
|
|
|
|
DECLARE_STATIC_KEY_FALSE(pkvm_guest);
|
|
|
|
void kvm_init_hyp_services(void);
|
|
bool kvm_arm_hyp_service_available(u32 func_id);
|
|
void kvm_arm_target_impl_cpu_init(void);
|
|
|
|
#ifdef CONFIG_ARM_PKVM_GUEST
|
|
void pkvm_init_hyp_services(void);
|
|
|
|
static inline bool is_protected_kvm_guest(void)
|
|
{
|
|
return static_branch_unlikely(&pkvm_guest);
|
|
}
|
|
#else
|
|
static inline void pkvm_init_hyp_services(void) { };
|
|
|
|
static inline bool is_protected_kvm_guest(void)
|
|
{
|
|
return false;
|
|
}
|
|
#endif
|
|
|
|
static inline void kvm_arch_init_hyp_services(void)
|
|
{
|
|
pkvm_init_hyp_services();
|
|
};
|
|
|
|
#endif
|