OXIESEC PANEL
- Current Dir:
/
/
usr
/
src
/
linux-headers-4.15.0-197
/
arch
/
arm
/
include
/
asm
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
11/17/2022 06:42:15 AM
rwxr-xr-x
📄
Kbuild
568 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
arch_gicv3.h
9.05 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
arch_timer.h
2.48 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
arm-cci.h
1.05 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
asm-offsets.h
35 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
assembler.h
10.46 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
atomic.h
13.22 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
auxvec.h
29 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
bL_switcher.h
2.28 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
barrier.h
2.84 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
bitops.h
8.62 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
bitrev.h
451 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
bug.h
2.46 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
bugs.h
546 bytes
11/01/2022 04:52:05 PM
rw-r--r--
📄
cache.h
813 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
cacheflush.h
15.54 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
cachetype.h
2.71 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
checksum.h
3.71 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
clocksource.h
153 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
cmpxchg.h
6.14 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
compiler.h
978 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
cp15.h
3.84 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
cpu.h
533 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
cpufeature.h
1.4 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
cpuidle.h
1.33 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
cputype.h
8.42 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
cti.h
3.62 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
dcc.h
1.01 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
delay.h
2.83 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
device.h
771 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
div64.h
3.17 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
dma-contiguous.h
265 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
dma-iommu.h
1.01 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
dma-mapping.h
7.44 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
dma.h
4.18 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
dmi.h
528 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
domain.h
3.65 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
ecard.h
5.98 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
edac.h
1.51 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
efi.h
3.04 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
elf.h
4.52 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
entry-macro-multi.S
726 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
exception.h
571 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
fb.h
375 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
fiq.h
1.36 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
firmware.h
1.82 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
fixmap.h
1.84 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
flat.h
915 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
floppy.h
3.61 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
fncpy.h
3.08 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
fpstate.h
1.73 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
ftrace.h
1.92 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
futex.h
4.24 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
glue-cache.h
3.51 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
glue-df.h
2.2 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
glue-pf.h
1.12 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
glue-proc.h
4.46 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
glue.h
759 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
gpio.h
693 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
hardirq.h
803 bytes
11/01/2022 04:52:05 PM
rw-r--r--
📁
hardware
-
11/17/2022 06:42:18 AM
rwxr-xr-x
📄
highmem.h
2.15 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
hugetlb-3level.h
2.03 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
hugetlb.h
1.78 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
hw_breakpoint.h
3.53 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
hw_irq.h
349 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
hwcap.h
378 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
hypervisor.h
140 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
ide.h
566 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
idmap.h
355 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
insn.h
636 bytes
11/01/2022 04:52:05 PM
rw-r--r--
📄
io.h
15.96 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
irq.h
1015 bytes
11/01/2022 04:52:05 PM
rw-r--r--
📄
irq_work.h
234 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
irqflags.h
3.88 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
jump_label.h
1009 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
kexec-internal.h
272 bytes
11/01/2022 04:52:05 PM
rw-r--r--
📄
kexec.h
2.3 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
kgdb.h
2.72 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
kmap_types.h
190 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
kprobes.h
2.65 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
kvm_arm.h
7.6 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
kvm_asm.h
2.84 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
kvm_coproc.h
1.99 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
kvm_emulate.h
7.84 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
kvm_host.h
10.31 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
kvm_hyp.h
4.49 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
kvm_mmio.h
1.34 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
kvm_mmu.h
7.27 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
limits.h
166 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
linkage.h
216 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📁
mach
-
11/17/2022 06:42:18 AM
rwxr-xr-x
📄
mc146818rtc.h
720 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
mcpm.h
11.92 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
mcs_spinlock.h
570 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
memblock.h
248 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
memory.h
10.12 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
mmu.h
953 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
mmu_context.h
3.94 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
module.h
1.57 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
mpu.h
2.15 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
mtd-xip.h
666 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
neon.h
1.16 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
nwflash.h
252 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
opcodes-sec.h
742 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
opcodes-virt.h
1.32 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
opcodes.h
8.07 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
outercache.h
3.78 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
page-nommu.h
957 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
page.h
3.61 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
paravirt.h
454 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
patch.h
438 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
pci.h
956 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
percpu.h
1.56 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
perf_event.h
850 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
pgalloc.h
3.79 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
pgtable-2level-hwdef.h
3.45 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
pgtable-2level-types.h
1.84 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
pgtable-2level.h
8.51 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
pgtable-3level-hwdef.h
3.95 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
pgtable-3level-types.h
1.89 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
pgtable-3level.h
9.54 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
pgtable-hwdef.h
467 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
pgtable-nommu.h
2.66 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
pgtable.h
11.68 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
probes.h
1.73 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
proc-fns.h
4.79 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
processor.h
3.4 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
procinfo.h
1.27 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
prom.h
715 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
psci.h
771 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
ptrace.h
4.89 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
sections.h
189 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
set_memory.h
1.04 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
setup.h
934 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
shmparam.h
419 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
signal.h
500 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
smp.h
3.1 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
smp_plat.h
2.48 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
smp_scu.h
1.32 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
smp_twd.h
908 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
sparsemem.h
716 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
spectre.h
906 bytes
11/01/2022 04:52:05 PM
rw-r--r--
📄
spinlock.h
5.49 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
spinlock_types.h
541 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
stackprotector.h
1.09 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
stacktrace.h
742 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
stage2_pgtable.h
2.12 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
string.h
1.43 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
suspend.h
369 bytes
11/01/2022 04:52:05 PM
rw-r--r--
📄
swab.h
1005 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
switch_to.h
1.03 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
sync_bitops.h
1.03 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
syscall.h
2.48 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
system_info.h
763 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
system_misc.h
1.14 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
tcm.h
937 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
therm.h
655 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
thread_info.h
5.2 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
thread_notify.h
1.2 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
timex.h
577 bytes
11/01/2022 04:52:05 PM
rw-r--r--
📄
tlb.h
7.37 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
tlbflush.h
17.88 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
tls.h
3.09 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
topology.h
1.18 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
traps.h
1.17 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
trusted_foundations.h
2.29 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
uaccess-asm.h
2.83 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
uaccess.h
16.22 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
ucontext.h
2.98 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
unaligned.h
846 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
unified.h
1.61 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
unistd.h
1.68 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
unwind.h
1.71 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
uprobes.h
1.07 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
user.h
4.2 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
v7m.h
2.93 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
vdso.h
507 bytes
11/01/2022 04:52:05 PM
rw-r--r--
📄
vdso_datapage.h
1.69 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
vfp.h
2.86 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
vfpmacros.h
2.1 KB
11/01/2022 04:52:05 PM
rw-r--r--
📄
vga.h
305 bytes
01/28/2018 09:20:33 PM
rw-r--r--
📄
virt.h
2.9 KB
01/28/2018 09:20:33 PM
rw-r--r--
📄
word-at-a-time.h
2.08 KB
01/28/2018 09:20:33 PM
rw-r--r--
📁
xen
-
11/17/2022 06:42:18 AM
rwxr-xr-x
📄
xor.h
5.22 KB
01/28/2018 09:20:33 PM
rw-r--r--
Editing: kvm_emulate.h
Close
/* * Copyright (C) 2012 - Virtual Open Systems and Columbia University * Author: Christoffer Dall <c.dall@virtualopensystems.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, write to the Free Software * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef __ARM_KVM_EMULATE_H__ #define __ARM_KVM_EMULATE_H__ #include <linux/kvm_host.h> #include <asm/kvm_asm.h> #include <asm/kvm_mmio.h> #include <asm/kvm_arm.h> #include <asm/cputype.h> /* arm64 compatibility macros */ #define COMPAT_PSR_MODE_ABT ABT_MODE #define COMPAT_PSR_MODE_UND UND_MODE #define COMPAT_PSR_T_BIT PSR_T_BIT #define COMPAT_PSR_I_BIT PSR_I_BIT #define COMPAT_PSR_A_BIT PSR_A_BIT #define COMPAT_PSR_E_BIT PSR_E_BIT #define COMPAT_PSR_IT_MASK PSR_IT_MASK unsigned long *vcpu_reg(struct kvm_vcpu *vcpu, u8 reg_num); static inline unsigned long *vcpu_reg32(struct kvm_vcpu *vcpu, u8 reg_num) { return vcpu_reg(vcpu, reg_num); } unsigned long *vcpu_spsr(struct kvm_vcpu *vcpu); static inline unsigned long host_spsr_to_spsr32(unsigned long spsr) { return spsr; } static inline unsigned long vcpu_get_reg(struct kvm_vcpu *vcpu, u8 reg_num) { return *vcpu_reg(vcpu, reg_num); } static inline void vcpu_set_reg(struct kvm_vcpu *vcpu, u8 reg_num, unsigned long val) { *vcpu_reg(vcpu, reg_num) = val; } bool kvm_condition_valid32(const struct kvm_vcpu *vcpu); void kvm_skip_instr32(struct kvm_vcpu *vcpu, bool is_wide_instr); void kvm_inject_undef32(struct kvm_vcpu *vcpu); void kvm_inject_dabt32(struct kvm_vcpu *vcpu, unsigned long addr); void kvm_inject_pabt32(struct kvm_vcpu *vcpu, unsigned long addr); void kvm_inject_vabt(struct kvm_vcpu *vcpu); static inline void kvm_inject_undefined(struct kvm_vcpu *vcpu) { kvm_inject_undef32(vcpu); } static inline void kvm_inject_dabt(struct kvm_vcpu *vcpu, unsigned long addr) { kvm_inject_dabt32(vcpu, addr); } static inline void kvm_inject_pabt(struct kvm_vcpu *vcpu, unsigned long addr) { kvm_inject_pabt32(vcpu, addr); } static inline bool kvm_condition_valid(const struct kvm_vcpu *vcpu) { return kvm_condition_valid32(vcpu); } static inline void kvm_skip_instr(struct kvm_vcpu *vcpu, bool is_wide_instr) { kvm_skip_instr32(vcpu, is_wide_instr); } static inline void vcpu_reset_hcr(struct kvm_vcpu *vcpu) { vcpu->arch.hcr = HCR_GUEST_MASK; } static inline unsigned long vcpu_get_hcr(const struct kvm_vcpu *vcpu) { return vcpu->arch.hcr; } static inline void vcpu_set_hcr(struct kvm_vcpu *vcpu, unsigned long hcr) { vcpu->arch.hcr = hcr; } static inline bool vcpu_mode_is_32bit(const struct kvm_vcpu *vcpu) { return 1; } static inline unsigned long *vcpu_pc(struct kvm_vcpu *vcpu) { return &vcpu->arch.ctxt.gp_regs.usr_regs.ARM_pc; } static inline unsigned long *vcpu_cpsr(const struct kvm_vcpu *vcpu) { return (unsigned long *)&vcpu->arch.ctxt.gp_regs.usr_regs.ARM_cpsr; } static inline void vcpu_set_thumb(struct kvm_vcpu *vcpu) { *vcpu_cpsr(vcpu) |= PSR_T_BIT; } static inline bool mode_has_spsr(struct kvm_vcpu *vcpu) { unsigned long cpsr_mode = vcpu->arch.ctxt.gp_regs.usr_regs.ARM_cpsr & MODE_MASK; return (cpsr_mode > USR_MODE && cpsr_mode < SYSTEM_MODE); } static inline bool vcpu_mode_priv(struct kvm_vcpu *vcpu) { unsigned long cpsr_mode = vcpu->arch.ctxt.gp_regs.usr_regs.ARM_cpsr & MODE_MASK; return cpsr_mode > USR_MODE;; } static inline u32 kvm_vcpu_get_hsr(const struct kvm_vcpu *vcpu) { return vcpu->arch.fault.hsr; } static inline int kvm_vcpu_get_condition(const struct kvm_vcpu *vcpu) { u32 hsr = kvm_vcpu_get_hsr(vcpu); if (hsr & HSR_CV) return (hsr & HSR_COND) >> HSR_COND_SHIFT; return -1; } static inline unsigned long kvm_vcpu_get_hfar(struct kvm_vcpu *vcpu) { return vcpu->arch.fault.hxfar; } static inline phys_addr_t kvm_vcpu_get_fault_ipa(struct kvm_vcpu *vcpu) { return ((phys_addr_t)vcpu->arch.fault.hpfar & HPFAR_MASK) << 8; } static inline bool kvm_vcpu_dabt_isvalid(struct kvm_vcpu *vcpu) { return kvm_vcpu_get_hsr(vcpu) & HSR_ISV; } static inline bool kvm_vcpu_dabt_iswrite(struct kvm_vcpu *vcpu) { return kvm_vcpu_get_hsr(vcpu) & HSR_WNR; } static inline bool kvm_vcpu_dabt_issext(struct kvm_vcpu *vcpu) { return kvm_vcpu_get_hsr(vcpu) & HSR_SSE; } static inline bool kvm_vcpu_dabt_issf(const struct kvm_vcpu *vcpu) { return false; } static inline int kvm_vcpu_dabt_get_rd(struct kvm_vcpu *vcpu) { return (kvm_vcpu_get_hsr(vcpu) & HSR_SRT_MASK) >> HSR_SRT_SHIFT; } static inline bool kvm_vcpu_abt_iss1tw(const struct kvm_vcpu *vcpu) { return kvm_vcpu_get_hsr(vcpu) & HSR_DABT_S1PTW; } static inline bool kvm_vcpu_dabt_is_cm(struct kvm_vcpu *vcpu) { return !!(kvm_vcpu_get_hsr(vcpu) & HSR_DABT_CM); } /* Get Access Size from a data abort */ static inline int kvm_vcpu_dabt_get_as(struct kvm_vcpu *vcpu) { switch ((kvm_vcpu_get_hsr(vcpu) >> 22) & 0x3) { case 0: return 1; case 1: return 2; case 2: return 4; default: kvm_err("Hardware is weird: SAS 0b11 is reserved\n"); return -EFAULT; } } /* This one is not specific to Data Abort */ static inline bool kvm_vcpu_trap_il_is32bit(struct kvm_vcpu *vcpu) { return kvm_vcpu_get_hsr(vcpu) & HSR_IL; } static inline u8 kvm_vcpu_trap_get_class(const struct kvm_vcpu *vcpu) { return kvm_vcpu_get_hsr(vcpu) >> HSR_EC_SHIFT; } static inline bool kvm_vcpu_trap_is_iabt(const struct kvm_vcpu *vcpu) { return kvm_vcpu_trap_get_class(vcpu) == HSR_EC_IABT; } static inline bool kvm_vcpu_trap_is_exec_fault(const struct kvm_vcpu *vcpu) { return kvm_vcpu_trap_is_iabt(vcpu) && !kvm_vcpu_abt_iss1tw(vcpu); } static inline u8 kvm_vcpu_trap_get_fault(struct kvm_vcpu *vcpu) { return kvm_vcpu_get_hsr(vcpu) & HSR_FSC; } static inline u8 kvm_vcpu_trap_get_fault_type(struct kvm_vcpu *vcpu) { return kvm_vcpu_get_hsr(vcpu) & HSR_FSC_TYPE; } static inline bool kvm_vcpu_dabt_isextabt(struct kvm_vcpu *vcpu) { switch (kvm_vcpu_trap_get_fault(vcpu)) { case FSC_SEA: case FSC_SEA_TTW0: case FSC_SEA_TTW1: case FSC_SEA_TTW2: case FSC_SEA_TTW3: case FSC_SECC: case FSC_SECC_TTW0: case FSC_SECC_TTW1: case FSC_SECC_TTW2: case FSC_SECC_TTW3: return true; default: return false; } } static inline u32 kvm_vcpu_hvc_get_imm(struct kvm_vcpu *vcpu) { return kvm_vcpu_get_hsr(vcpu) & HSR_HVC_IMM_MASK; } static inline unsigned long kvm_vcpu_get_mpidr_aff(struct kvm_vcpu *vcpu) { return vcpu_cp15(vcpu, c0_MPIDR) & MPIDR_HWID_BITMASK; } static inline void kvm_vcpu_set_be(struct kvm_vcpu *vcpu) { *vcpu_cpsr(vcpu) |= PSR_E_BIT; } static inline bool kvm_vcpu_is_be(struct kvm_vcpu *vcpu) { return !!(*vcpu_cpsr(vcpu) & PSR_E_BIT); } static inline unsigned long vcpu_data_guest_to_host(struct kvm_vcpu *vcpu, unsigned long data, unsigned int len) { if (kvm_vcpu_is_be(vcpu)) { switch (len) { case 1: return data & 0xff; case 2: return be16_to_cpu(data & 0xffff); default: return be32_to_cpu(data); } } else { switch (len) { case 1: return data & 0xff; case 2: return le16_to_cpu(data & 0xffff); default: return le32_to_cpu(data); } } } static inline unsigned long vcpu_data_host_to_guest(struct kvm_vcpu *vcpu, unsigned long data, unsigned int len) { if (kvm_vcpu_is_be(vcpu)) { switch (len) { case 1: return data & 0xff; case 2: return cpu_to_be16(data & 0xffff); default: return cpu_to_be32(data); } } else { switch (len) { case 1: return data & 0xff; case 2: return cpu_to_le16(data & 0xffff); default: return cpu_to_le32(data); } } } #endif /* __ARM_KVM_EMULATE_H__ */