Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
1df3e23
Documentation
arch
alpha
arc
arm
arm64
boot
configs
crypto
include
asm
xen
Kbuild
acenv.h
acpi.h
alternative.h
arch_gicv3.h
arch_timer.h
arm-cci.h
asm-offsets.h
assembler.h
atomic.h
atomic_ll_sc.h
atomic_lse.h
barrier.h
bitops.h
bitrev.h
boot.h
brk-imm.h
bug.h
cache.h
cacheflush.h
cachetype.h
cmpxchg.h
compat.h
compiler.h
cpu.h
cpu_ops.h
cpufeature.h
cpuidle.h
cputype.h
dcc.h
debug-monitors.h
device.h
dma-mapping.h
dmi.h
efi.h
elf.h
esr.h
exception.h
exec.h
fb.h
fixmap.h
fpsimd.h
fpsimdmacros.h
ftrace.h
futex.h
hardirq.h
hugetlb.h
hw_breakpoint.h
hwcap.h
hypervisor.h
insn.h
io.h
irq.h
irq_work.h
irqflags.h
jump_label.h
kasan.h
kernel-pgtable.h
kgdb.h
kvm_arm.h
kvm_asm.h
kvm_coproc.h
kvm_emulate.h
kvm_host.h
kvm_hyp.h
kvm_mmio.h
kvm_mmu.h
kvm_psci.h
linkage.h
lse.h
memblock.h
memory.h
mmu.h
mmu_context.h
mmzone.h
module.h
neon.h
numa.h
opcodes.h
page.h
paravirt.h
pci.h
percpu.h
perf_event.h
pgalloc.h
pgtable-hwdef.h
pgtable-prot.h
pgtable-types.h
pgtable.h
proc-fns.h
processor.h
ptrace.h
seccomp.h
shmparam.h
signal32.h
smp.h
smp_plat.h
sparsemem.h
spinlock.h
spinlock_types.h
stackprotector.h
stacktrace.h
stage2_pgtable-nopmd.h
stage2_pgtable-nopud.h
stage2_pgtable.h
stat.h
string.h
suspend.h
sync_bitops.h
syscall.h
sysreg.h
system_misc.h
thread_info.h
timex.h
tlb.h
tlbflush.h
topology.h
traps.h
uaccess.h
unistd.h
unistd32.h
vdso.h
vdso_datapage.h
virt.h
word-at-a-time.h
uapi
kernel
kvm
lib
mm
net
xen
Kconfig
Kconfig.debug
Kconfig.platforms
Makefile
avr32
blackfin
c6x
cris
frv
h8300
hexagon
ia64
m32r
m68k
metag
microblaze
mips
mn10300
nios2
openrisc
parisc
powerpc
s390
score
sh
sparc
tile
um
unicore32
x86
xtensa
.gitignore
Kconfig
block
certs
crypto
drivers
firmware
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.get_maintainer.ignore
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
REPORTING-BUGS
Breadcrumbs
linux
/
arch
/
arm64
/
include
/
asm
/
virt.h
Copy path
Blame
Blame
Latest commit
Marc Zyngier
and
Christoffer Dall
arm/arm64: KVM: Export __hyp_text_start/end symbols
Jul 3, 2016
1df3e23
·
Jul 3, 2016
History
History
95 lines (77 loc) · 2.71 KB
Breadcrumbs
linux
/
arch
/
arm64
/
include
/
asm
/
virt.h
Top
File metadata and controls
Code
Blame
95 lines (77 loc) · 2.71 KB
Raw
/* * Copyright (C) 2012 ARM Ltd. * Author: Marc Zyngier <marc.zyngier@arm.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef __ASM__VIRT_H #define __ASM__VIRT_H /* * The arm64 hcall implementation uses x0 to specify the hcall type. A value * less than 0xfff indicates a special hcall, such as get/set vector. * Any other value is used as a pointer to the function to call. */ /* HVC_GET_VECTORS - Return the value of the vbar_el2 register. */ #define HVC_GET_VECTORS 0 /* * HVC_SET_VECTORS - Set the value of the vbar_el2 register. * * @x1: Physical address of the new vector table. */ #define HVC_SET_VECTORS 1 #define BOOT_CPU_MODE_EL1 (0xe11) #define BOOT_CPU_MODE_EL2 (0xe12) #ifndef __ASSEMBLY__ #include <asm/ptrace.h> /* * __boot_cpu_mode records what mode CPUs were booted in. * A correctly-implemented bootloader must start all CPUs in the same mode: * In this case, both 32bit halves of __boot_cpu_mode will contain the * same value (either 0 if booted in EL1, BOOT_CPU_MODE_EL2 if booted in EL2). * * Should the bootloader fail to do this, the two values will be different. * This allows the kernel to flag an error when the secondaries have come up. */ extern u32 __boot_cpu_mode[2]; void __hyp_set_vectors(phys_addr_t phys_vector_base); phys_addr_t __hyp_get_vectors(void); /* Reports the availability of HYP mode */ static inline bool is_hyp_mode_available(void) { return (__boot_cpu_mode[0] == BOOT_CPU_MODE_EL2 && __boot_cpu_mode[1] == BOOT_CPU_MODE_EL2); } /* Check if the bootloader has booted CPUs in different modes */ static inline bool is_hyp_mode_mismatched(void) { return __boot_cpu_mode[0] != __boot_cpu_mode[1]; } static inline bool is_kernel_in_hyp_mode(void) { u64 el; asm("mrs %0, CurrentEL" : "=r" (el)); return el == CurrentEL_EL2; } #ifdef CONFIG_ARM64_VHE extern void verify_cpu_run_el(void); #else static inline void verify_cpu_run_el(void) {} #endif /* The section containing the hypervisor idmap text */ extern char __hyp_idmap_text_start[]; extern char __hyp_idmap_text_end[]; /* The section containing the hypervisor text */ extern char __hyp_text_start[]; extern char __hyp_text_end[]; #endif /* __ASSEMBLY__ */ #endif /* ! __ASM__VIRT_H */
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
You can’t perform that action at this time.