#include <linux/kvm_host.h>
#include <asm/kvm_emulate.h>
#include <asm/kvm_hyp.h>
Go to the source code of this file.
|
static const unsigned short | cc_map [16] |
|
◆ kvm_adjust_itstate()
static void kvm_adjust_itstate |
( |
struct kvm_vcpu * |
vcpu | ) |
|
|
static |
adjust_itstate - adjust ITSTATE when emulating instructions in IT-block @vcpu: The VCPU pointer
When exceptions occur while instructions are executed in Thumb IF-THEN blocks, the ITSTATE field of the CPSR is not advanced (updated), so we have to do this little bit of work manually. The fields map like this:
IT[7:0] -> CPSR[26:25],CPSR[15:10]
Definition at line 96 of file aarch32.c.
98 unsigned long itbits, cond;
99 unsigned long cpsr = *vcpu_cpsr(vcpu);
100 bool is_arm = !(cpsr & PSR_AA32_T_BIT);
102 if (is_arm || !(cpsr & PSR_AA32_IT_MASK))
105 cond = (cpsr & 0xe000) >> 13;
106 itbits = (cpsr & 0x1c00) >> (10 - 2);
107 itbits |= (cpsr & (0x3 << 25)) >> 25;
110 if ((itbits & 0x7) == 0)
113 itbits = (itbits << 1) & 0x1f;
115 cpsr &= ~PSR_AA32_IT_MASK;
117 cpsr |= (itbits & 0x1c) << (10 - 2);
118 cpsr |= (itbits & 0x3) << 25;
119 *vcpu_cpsr(vcpu) = cpsr;
◆ kvm_condition_valid32()
bool kvm_condition_valid32 |
( |
const struct kvm_vcpu * |
vcpu | ) |
|
Definition at line 47 of file aarch32.c.
54 if (kvm_vcpu_get_esr(vcpu) >> 30)
58 cond = kvm_vcpu_get_condition(vcpu);
62 cpsr = *vcpu_cpsr(vcpu);
68 it = ((cpsr >> 8) & 0xFC) | ((cpsr >> 25) & 0x3);
78 cpsr_cond = cpsr >> 28;
80 if (!((
cc_map[cond] >> cpsr_cond) & 1))
static const unsigned short cc_map[16]
◆ kvm_skip_instr32()
void kvm_skip_instr32 |
( |
struct kvm_vcpu * |
vcpu | ) |
|
kvm_skip_instr - skip a trapped instruction and proceed to the next @vcpu: The vcpu pointer
Definition at line 126 of file aarch32.c.
128 u32 pc = *vcpu_pc(vcpu);
131 is_thumb = !!(*vcpu_cpsr(vcpu) & PSR_AA32_T_BIT);
132 if (is_thumb && !kvm_vcpu_trap_il_is32bit(vcpu))
static void kvm_adjust_itstate(struct kvm_vcpu *vcpu)
◆ cc_map
const unsigned short cc_map[16] |
|
static |
Initial value:= {
0xF0F0,
0x0F0F,
0xCCCC,
0x3333,
0xFF00,
0x00FF,
0xAAAA,
0x5555,
0x0C0C,
0xF3F3,
0xAA55,
0x55AA,
0x0A05,
0xF5FA,
0xFFFF,
0
}
Definition at line 25 of file aarch32.c.