diff --git a/x86_64.c b/x86_64.c index aec82b03..0c21eb82 100644 --- a/x86_64.c +++ b/x86_64.c @@ -6623,13 +6623,14 @@ x86_64_irq_eframe_link_init(void) /* * Calculate and verify the IRQ exception frame location from the - * stack reference at the top of the IRQ stack, possibly adjusting - * the ms->irq_eframe_link value. + * stack reference at the top of the IRQ stack, keep ms->irq_eframe_link + * as the most likely value, and try a few sizes around it. */ static ulong x86_64_irq_eframe_link(ulong stkref, struct bt_info *bt, FILE *ofp) { ulong irq_eframe; + int i, try[] = { 8, -8, 16, -16 }; if (x86_64_exception_frame(EFRAME_VERIFY, stkref, 0, bt, ofp)) return stkref; @@ -6639,9 +6640,9 @@ x86_64_irq_eframe_link(ulong stkref, struct bt_info *bt, FILE *ofp) if (x86_64_exception_frame(EFRAME_VERIFY, irq_eframe, 0, bt, ofp)) return irq_eframe; - if (x86_64_exception_frame(EFRAME_VERIFY, irq_eframe+8, 0, bt, ofp)) { - machdep->machspec->irq_eframe_link -= 8; - return (irq_eframe + 8); + for (i = 0; i < sizeof(try)/sizeof(int); i++) { + if (x86_64_exception_frame(EFRAME_VERIFY, irq_eframe+try[i], 0, bt, ofp)) + return (irq_eframe + try[i]); } return irq_eframe;