On 06/10/2010 06:31 AM, Sheng Yang wrote:
+
+#define EXCEPTION_REGION_BEGIN(r, lb) \
+ asm volatile("pushq $"lb"\n\t" \
+ "mov $2, %0\n\t" \
+ : "=r"(r))
+#define EXCEPTION_REGION_END(r, lb) \
+ asm volatile("popq %%rdx\n\t" \
+ "mov $0, %0\n\t" \
+ lb":\n\t": \
+ "=r"(r) :: "%rdx")
These mess up the stack, no? So if any intervening code uses %rsp based
addressing, it will get incorrect information.
I suggest using a special data section like the kernel.
Also, most tests that use asm don't need an exception region, but will
want to trap an exception on a single address. So need a macro designed
to be placed in asm in front of the faulting instruction.
--
error compiling committee.c: too many arguments to function
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html