Unverified Commit 8d2e6d1b authored by Lyu Jinglin's avatar Lyu Jinglin Committed by Liu Zhehui
Browse files

HAOC: Add support for AArch64 Isolated Execution Environment(IEE).

community inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IBQKOW



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

The base framework of HAOC. Could isolate kernel critical data and
enforce all write access made and verified in IEE APIs.
Needs hardware support FEAT_HPDS.

Signed-off-by: default avatarLyu Jinglin <lvjl2022@zgclab.edu.cn>
Signed-off-by: default avatarZhang Shiyang <zhangsy2023@zgclab.edu.cn>
Signed-off-by: default avatarLiu Zhehui <liuzhh@zgclab.edu.cn>
parent ed6f512d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2684,3 +2684,5 @@ source "drivers/acpi/Kconfig"

source "arch/arm64/kvm/Kconfig"

source "arch/arm64/kernel/haoc/Kconfig"
+6 −0
Original line number Diff line number Diff line
@@ -771,6 +771,12 @@ CONFIG_ARCH_VCPU_STAT=y
CONFIG_VIRT_VTIMER_IRQ_BYPASS=y
CONFIG_CPU_MITIGATIONS=y

#
# Hardware Assisted OS Compartmentalization(HAOC)
#
# CONFIG_IEE is not set
# end of Hardware Assisted OS Compartmentalization(HAOC)

#
# General architecture-dependent options
#
+6 −0
Original line number Diff line number Diff line
@@ -25,6 +25,9 @@
#include <asm/pgtable-hwdef.h>
#include <asm/ptrace.h>
#include <asm/thread_info.h>
#ifdef CONFIG_IEE
#include <asm/haoc/iee-asm.h>
#endif

	/*
	 * Provide a wxN alias for each wN register so what we can paste a xN
@@ -491,6 +494,9 @@ alternative_endif
	.macro		load_ttbr1, pgtbl, tmp1, tmp2
	phys_to_ttbr	\tmp1, \pgtbl
	offset_ttbr1 	\tmp1, \tmp2
	#ifdef CONFIG_IEE
	orr \tmp1, \tmp1, #IEE_ASM_ASID
	#endif
	msr		ttbr1_el1, \tmp1
	isb
	.endm
+26 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * HAOC feature support
 *
 * Copyright (C) 2025 ZGCLAB
 * Authors: Lyu Jinglin <lvjl2022@zgclab.edu.cn>
 *          Zhang Shiyang <zhangsy2023@zgclab.edu.cn>
 */

#ifndef _LINUX_HAOC_DEF_H
#define _LINUX_HAOC_DEF_H

/* Place the enum entries in the order corresponding to iee_funcs array. */
enum {
	IEE_OP_MEMSET,
	IEE_FLAG_END
};

/* The entry gate of all IEE APIs. The first parameter must be a valid
 * IEE function index.
 */
extern unsigned long long iee_rw_gate(int flag, ...);

#define __iee_code		__section(".iee.text")

#endif
+18 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * HAOC feature support
 *
 * Copyright (C) 2025 ZGCLAB
 * Authors: Lyu Jinglin <lvjl2022@zgclab.edu.cn>
 *          Zhang Shiyang <zhangsy2023@zgclab.edu.cn>
 */

#ifndef _LINUX_HAOC_H
#define _LINUX_HAOC_H

#include <linux/types.h>
#include <linux/mm.h>

void _iee_memset(unsigned long __unused, void *ptr, int data, size_t n);

#endif
Loading