Signed-off-by: Andrea Bastoni <[email protected]>
---
 hypervisor/arch/x86/control.c               | 2 +-
 hypervisor/arch/x86/entry.S                 | 3 ++-
 hypervisor/arch/x86/include/asm/processor.h | 2 ++
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/hypervisor/arch/x86/control.c b/hypervisor/arch/x86/control.c
index 2aea807a..2bc47a6a 100644
--- a/hypervisor/arch/x86/control.c
+++ b/hypervisor/arch/x86/control.c
@@ -238,7 +238,7 @@ x86_exception_handler(struct exception_frame *frame)
 {
        panic_printk("FATAL: Jailhouse triggered exception #%lld\n",
                     frame->vector);
-       if (frame->error != -1)
+       if (frame->error != EXCEPTION_NO_ERROR)
                panic_printk("Error code: %llx\n", frame->error);
        panic_printk("Physical CPU ID: %lu\n", phys_processor_id());
        panic_printk("RIP: 0x%016llx RSP: 0x%016llx FLAGS: %llx\n", frame->rip,
diff --git a/hypervisor/arch/x86/entry.S b/hypervisor/arch/x86/entry.S
index 3ee11a99..295f0845 100644
--- a/hypervisor/arch/x86/entry.S
+++ b/hypervisor/arch/x86/entry.S
@@ -10,6 +10,7 @@
  * the COPYING file in the top-level directory.
  */
 
+#include <asm/processor.h>
 #include <asm/asm-defines.h>
 
 /* Entry point for Linux loader module on JAILHOUSE_ENABLE */
@@ -73,7 +74,7 @@ arch_entry:
 
 .macro no_error_entry vector
        .balign 16
-       pushq $-1
+       pushq $(EXCEPTION_NO_ERROR)
        common_exception_entry \vector
 .endm
 
diff --git a/hypervisor/arch/x86/include/asm/processor.h 
b/hypervisor/arch/x86/include/asm/processor.h
index d22a60d7..3a7d9f93 100644
--- a/hypervisor/arch/x86/include/asm/processor.h
+++ b/hypervisor/arch/x86/include/asm/processor.h
@@ -164,6 +164,8 @@
 #define PF_VECTOR                                      14
 #define AC_VECTOR                                      17
 
+#define EXCEPTION_NO_ERROR                             0xffffffffffffffff
+
 #define DESC_TSS_BUSY                                  (1UL << (9 + 32))
 #define DESC_PRESENT                                   (1UL << (15 + 32))
 #define DESC_CODE_DATA                                 (1UL << (12 + 32))
-- 
2.28.0

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/20201028210933.138379-22-andrea.bastoni%40tum.de.

Reply via email to