On 06/11/2010 10:52 AM, Sheng Yang wrote:
+void do_handle_exception(struct ex_regs *regs) +{ + struct ex_record *ex; + unsigned ex_val; + + printf("exception: vector %ld error %lx rip %lx\n", regs->vector, + regs->error_code, regs->rip); + + ex_val = regs->vector | (regs->error_code<< 16); + + asm("mov %0, %%gs:4" : : "r"(ex_val)); + + for (ex =&exception_table_start; ex !=&exception_table_end; ++ex) { + printf("ex_table: %lx %lx\n", ex->rip, ex->handler);How about use something like #ifdef VERBOSE? (Well, in fact I didn't use unit test much, if you don't mind the format of output, it's also fine.)
That was just debugging code I forgot to remove. It shouldn't be there except for the unhandled exception case.
+int test(void) +{ + int r; + + setup_idt(); + printf("GP testing: "); + r = test_gp(); + report(r == GP_VECTOR, "#GP"); + r = test_ud2(); + report(r == UD_VECTOR, "#UD");Miss a "UD testing"?
Yeah :( -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
