From 86a06c60679e20bd157308b4acd99e95f1920c78 Mon Sep 17 00:00:00 2001 From: Antti Kantee Date: Thu, 3 Dec 2015 20:10:44 +0000 Subject: [PATCH] fix amd64 fattrap to correctly account for error codes --- platform/hw/arch/amd64/intr.S | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platform/hw/arch/amd64/intr.S b/platform/hw/arch/amd64/intr.S index 0e38ec0..0a9d796 100644 --- a/platform/hw/arch/amd64/intr.S +++ b/platform/hw/arch/amd64/intr.S @@ -66,11 +66,14 @@ fattrapstr##num: ;\ ENTRY(x86_trap_##num) \ movq $fattrapstr##num, %rdi ;\ movq %cr2, %rdx ;\ - mov $##num, %rcx ;\ - test $14, %rcx ;\ + movq $##num, %rcx ;\ + cmpq $13, %rcx ;\ je 1f ;\ - addq $8, %rsp ;\ + cmpq $14, %rcx ;\ + jne 2f ;\ 1: ;\ + addq $8, %rsp ;\ +2: ;\ movq 0(%rsp), %rsi ;\ call cpu_fattrap ;\ hlt ;\ -- 2.39.5