xtf_failure("Fail: Expected #PF, got %pe\n", _p(got));
}
+static volatile bool test_hook_active;
bool do_unhandled_exception(struct cpu_regs *regs)
{
extern unsigned long hook_fault[], hook_fixup[];
+ if ( !test_hook_active )
+ return false;
+
if ( _p(regs->ip) != hook_fault )
{
xtf_failure("Fail: Expected fault at %p, got %p\n",
printk("Test: Unhandled Exception Hook\n");
/* Check that the hook catches the exception, and fix it up. */
+ test_hook_active = true;
asm volatile ("hook_fault: ud2a; hook_fixup:");
+ test_hook_active = false;
}
static bool test_extable_handler_handler_run;