Added compile flags for QEMU to not use sse3/sse4

Signed-off-by: Jonas Zaddach <zaddach@eurecom.fr>
Ignore Eclipse project files

Prevent accidental leakage of Eclipse metadata file into git,
as already happened with past ARM branch.

Signed-off-by: Luca Bruno <lucab@debian.org>
Synchronize S2E ARM machine configuration

Update arm-s2e-softmmu configuration with latest ARM requirements.

Signed-off-by: Luca Bruno <lucab@debian.org>
Fix banked registers handling on mode changes

This commit fixes a typo in banked registers handling code, which was
not correct during mode changes. It was preventing the proper loading of
recent Linux kernel images, resulting in infinite loops.

Signed-off-by: Luca Bruno <lucab@debian.org>
Fix S2E handling of ARM interrupts

An incorrect conflict resolution was causing infinite recursion between
doInterrupt() and do_interrupt() while handling ARM interrupts.
It was preventing the proper loading of recent Linux kernel images in
S2E mode, resulting in stack overflow. Fixed now.

Signed-off-by: Luca Bruno <lucab@debian.org>
Introduce target-specific macro for the concrete/symbolic limit

Define two target-specific macros, S2E_TARGET_CONC_LIMIT and
CPU_CONC_LIMIT, to specify the concrete/symbolic limit in CPU state.
These are often used to get the offset of each area on copying.
We currently support I386 (32/64 bits) and ARM targets.

Signed-off-by: Luca Bruno <lucab@debian.org>
Make use of S2E_TARGET_CONC_LIMIT and CPU_CONC_LIMIT

Minimize target-specific code and number of #ifdef, by reusing the
S2E_TARGET_CONC_LIMIT and CPU_CONC_LIMIT macro when handling CPU state
offsets and areas, in conjuction with the neutral CPUArchState struct.

Signed-off-by: Luca Bruno <lucab@debian.org>
Clean and fix BaseInstructions.o CFLAGS

Signed-off-by: Luca Bruno <lucab@debian.org>
Centralize S2E opcodes register usage definition

Make more esplicit the register usage of custom S2E opcodes.
This helps documenting the ASM interface and at the same time
removes a lot of target-specific code in favor of compile-time
constants.

Signed-off-by: Luca Bruno <lucab@debian.org>
Move debug messages to proper debug stream

Signed-off-by: Luca Bruno <lucab@debian.org>
Enable sleep opcode (0x32) for ARM

This commit enables the sleep custom instruction on ARM, and provides
one basic testcase for it.

Signed-off-by: Luca Bruno <lucab@debian.org>
Improve building of ARM testcases

Build all testcases via a proper Makefile and let passing environmental
options to it.

Signed-off-by: Luca Bruno <lucab@debian.org>
Enable building EdgeKiller plugin for ARM

Signed-off-by: Luca Bruno <lucab@debian.org>
Enable building CacheSim plugin for ARM

Signed-off-by: Luca Bruno <lucab@debian.org>
qemu-arm: bugfix: env is RO when the tlb is filled

An update of env will cause klee to throw an error:
"""
KLEE: ERROR: memory error: object read only
KLEE: NOTE: now ignoring this error at this location
"""

To trigger the error the following test case can be used:

	/* assuming D is not in the TLB */
	#define D (*((unsigned int *)0x85000000))

	static void my_test(void)
	{
	    char b;
	    s2e_make_symbolic(&b, 1, "my_buf");

	    if (b == 'A') {
	        D = 0;
	        s2e_kill_state(0, "A");
	    } else {
	        s2e_kill_state(0, "not A");
	    }
	}

The fix is just an old hack that has been introduced in the commit:
394a0e3b999c9c4d76691ff81163731d908cdebb

Signed-off-by: Lucian Cojocar <cojocar@gmail.com>
s2e-arm: bugfix: pass message pointer in r0 for s2earm calls

The pointer to the message for the s2e_{message,warning} calls was not
set in the 'r0' register.

Signed-off-by: Lucian Cojocar <cojocar@gmail.com>
Emit instr_translate_start also in full ARM mode

Signed-off-by: Luca BRUNO <lucab@debian.org>
Implemented execution state getFlags() function for ARM

Signed-off-by: Jonas Zaddach <zaddach@eurecom.fr>
Uniform opcodes handling across architectures

Signed-off-by: Luca Bruno <lucab@debian.org>
Port RawMonitor plugin to ARM

Make RawMonitor plugin no more x86-dependent, port to ARM and enable it
on all architectures.

Signed-off-by: Luca Bruno <lucab@debian.org>