On Fri, 2013-06-14 at 09:24 +0900, Sengul Thomas wrote:> Hello,
>
> I saw some scary magic numbers in linux/arch/arm/hypercall.S, which are:
>
> #define XEN_IMM 0xEA1
>
>
> and in arch/arm/include/asm/opcodes-virt.h, which are
>
> #define __HVC(imm16) __inst_arm_thumb32( \
> 0xE1400070 | (((imm16) & 0xFFF0) << 4) | ((imm16) &
0x000F), \
> 0xF7E08000 | (((imm16) & 0xF000) << 4) | ((imm16) &
0x0FFF) \
> )
>
> all that I know is those are used for hypercalls.
> Could you give any hint or reference that I can learn those magic numbers?
XEN_IMM is just an arbitrary number which we picked to use as the
immediate to the hvc (hypercall) instruction to try and distinguish it
from hypercalls for other hypervisors (to help detect confused guests
and such).
The __HVC macro is a helper for encoding the hvc instruction, because
not all versions of binutils which the kernel can be built with know
about that instruction.
Ian.