Skip to content

Commit

Permalink
plat/kvm: Enable Pointer Authentication in KVM
Browse files Browse the repository at this point in the history
Signed-off-by: Michalis Pappas <mpappas@fastmail.fm>
Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Razvan Virtan <virtanrazvan@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #686
  • Loading branch information
michpappas authored and unikraft-bot committed Feb 3, 2023
1 parent fb02d66 commit e742f9d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plat/kvm/Makefile.uk
Expand Up @@ -92,6 +92,9 @@ endif
ifeq ($(CONFIG_ENFORCE_W_XOR_X),y)
LIBKVMPLAT_SRCS-$(CONFIG_ARCH_ARM_64) += $(UK_PLAT_COMMON_BASE)/w_xor_x.c|common
endif
ifeq ($(CONFIG_ARM64_FEAT_PAUTH),y)
LIBKVMPLAT_SRCS-$(CONFIG_ARCH_ARM_64) += $(UK_PLAT_COMMON_BASE)/arm/pauth.c|common
endif
LIBKVMPLAT_SRCS-$(CONFIG_ARCH_ARM_64) += $(UK_PLAT_COMMON_BASE)/arm/cpu_native.c|common
LIBKVMPLAT_SRCS-$(CONFIG_ARCH_ARM_64) += $(UK_PLAT_COMMON_BASE)/arm/cache64.S|common
LIBKVMPLAT_SRCS-$(CONFIG_ARCH_ARM_64) += $(UK_PLAT_COMMON_BASE)/arm/smccc.c|common
Expand Down
10 changes: 10 additions & 0 deletions plat/kvm/arm/setup.c
Expand Up @@ -33,6 +33,10 @@
#include <arm/smccc.h>
#include <uk/arch/limits.h>

#ifdef CONFIG_ARM64_FEAT_PAUTH
#include <arm/arm64/pauth.h>
#endif /* CONFIG_ARM64_FEAT_PAUTH */

#ifdef CONFIG_HAVE_MEMTAG
#include <uk/arch/memtag.h>
#endif /* CONFIG_HAVE_MEMTAG */
Expand Down Expand Up @@ -311,6 +315,12 @@ void __no_pauth _libkvmplat_start(void *dtb_pointer)
#endif /* CONFIG_ENFORCE_W_XOR_X */
#endif /* CONFIG_PAGING */

#ifdef CONFIG_ARM64_FEAT_PAUTH
ret = ukplat_pauth_init();
if (unlikely(ret))
UK_CRASH("Could not initialize PAuth (%d)\n", ret);
#endif /* CONFIG_ARM64_FEAT_PAUTH */

#ifdef CONFIG_HAVE_MEMTAG
ret = ukarch_memtag_init();
if (unlikely(ret))
Expand Down

0 comments on commit e742f9d

Please sign in to comment.