blob: 790993581c6c086f0038ca3b32678f7482ab2af1 [file] [log] [blame]
Olivier Deprez26357852021-02-11 18:10:02 +01001/*
2 * Copyright 2021 The Hafnium Authors.
3 *
4 * Use of this source code is governed by a BSD-style
5 * license that can be found in the LICENSE file or at
6 * https://opensource.org/licenses/BSD-3-Clause.
7 */
8
9#pragma once
10
11#define HF_INVALID_VM_ID 0x7fff
12
13/**
14 * The bit of the VM ID which indicates whether the VM ID is allocated by the
15 * normal world or the secure world.
16 */
17#define HF_VM_ID_WORLD_MASK 0x8000
18
19/** The special VM ID reserved for the hypervisor in the normal world. */
20#define HF_HYPERVISOR_VM_ID 0
21
22/**
23 * An offset to use when assigning VM IDs within the current world.
24 * The offset from HF_VM_ID_BASE is needed because VM ID `HF_VM_ID_BASE + 0` is
25 * reserved for the hypervisor/SPM.
26 */
27#define HF_VM_ID_OFFSET (HF_VM_ID_BASE + 1)
28
29/** The index of the primary VM, if it exists in this world. */
30#define HF_PRIMARY_VM_INDEX 0
31
32/**
33 * The special VM ID reserved for the OS or SPMC running in the trusted
34 * execution environment, e.g. secure EL1 or EL2 on AArch64.
35 */
36#define HF_TEE_VM_ID 0x8000