From c88b1e06d5ad6d24b5cb0cb6f80ae35d94002ef5 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 19 Aug 2009 13:02:31 +0100 Subject: x86: miscellaneous emulator adjustments Defer fail_if()-s as much as possible (in favor of possibly generating exceptions), and avoid generating exceptions when not strictly necessary. Avoid fail_if()-s for simple return code checks (making the code that used them consistent with other, longer existing code). Eliminate redundant generate_exception_if()-s checking lock_prefix (which is already covered by the general check prior to decoding operands). Also fix the testing code to add PROT_EXEC for the mapping that is intended to have instruction executed from. Signed-off-by: Jan Beulich --- tools/tests/test_x86_emulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/tests') diff --git a/tools/tests/test_x86_emulator.c b/tools/tests/test_x86_emulator.c index 4215686888..dca401f93d 100644 --- a/tools/tests/test_x86_emulator.c +++ b/tools/tests/test_x86_emulator.c @@ -76,7 +76,7 @@ int main(int argc, char **argv) ctxt.addr_size = 32; ctxt.sp_size = 32; - res = mmap((void *)0x100000, MMAP_SZ, PROT_READ|PROT_WRITE, + res = mmap((void *)0x100000, MMAP_SZ, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_FIXED|MAP_PRIVATE|MAP_ANONYMOUS, 0, 0); if ( res == MAP_FAILED ) { -- cgit v1.2.3