Re: [PATCH v2] test: Add IDT framework

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux