yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-target-i386-kvm-Use-symbolic-constant-for-DB-BP-exce.patch

4ec855
From 0168573b58d5e70a60c9fef319ba510aa9648f2d Mon Sep 17 00:00:00 2001
4ec855
From: Paolo Bonzini <pbonzini@redhat.com>
4ec855
Date: Mon, 22 Jul 2019 18:22:09 +0100
4ec855
Subject: [PATCH 28/39] target/i386: kvm: Use symbolic constant for #DB/#BP
4ec855
 exception constants
4ec855
4ec855
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
4ec855
Message-id: <20190722182220.19374-8-pbonzini@redhat.com>
4ec855
Patchwork-id: 89625
4ec855
O-Subject: [RHEL-8.1.0 PATCH qemu-kvm v3 07/18] target/i386: kvm: Use symbolic constant for #DB/#BP exception constants
4ec855
Bugzilla: 1689269
4ec855
RH-Acked-by: Peter Xu <zhexu@redhat.com>
4ec855
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
4ec855
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
4ec855
4ec855
From: Liran Alon <liran.alon@oracle.com>
4ec855
4ec855
Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
4ec855
Reviewed-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
4ec855
Signed-off-by: Liran Alon <liran.alon@oracle.com>
4ec855
Message-Id: <20190619162140.133674-4-liran.alon@oracle.com>
4ec855
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4ec855
(cherry picked from commit 37936ac70f6c20aec6f537349eb797fb98f9a99d)
4ec855
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
4ec855
---
4ec855
 target/i386/kvm.c | 8 ++++----
4ec855
 1 file changed, 4 insertions(+), 4 deletions(-)
4ec855
4ec855
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
4ec855
index 305809f..4138fe9 100644
4ec855
--- a/target/i386/kvm.c
4ec855
+++ b/target/i386/kvm.c
4ec855
@@ -2811,9 +2811,9 @@ static int kvm_guest_debug_workarounds(X86CPU *cpu)
4ec855
     unsigned long reinject_trap = 0;
4ec855
 
4ec855
     if (!kvm_has_vcpu_events()) {
4ec855
-        if (env->exception_injected == 1) {
4ec855
+        if (env->exception_injected == EXCP01_DB) {
4ec855
             reinject_trap = KVM_GUESTDBG_INJECT_DB;
4ec855
-        } else if (env->exception_injected == 3) {
4ec855
+        } else if (env->exception_injected == EXCP03_INT3) {
4ec855
             reinject_trap = KVM_GUESTDBG_INJECT_BP;
4ec855
         }
4ec855
         env->exception_injected = -1;
4ec855
@@ -3325,8 +3325,8 @@ static int kvm_handle_debug(X86CPU *cpu,
4ec855
     int ret = 0;
4ec855
     int n;
4ec855
 
4ec855
-    if (arch_info->exception == 1) {
4ec855
-        if (arch_info->dr6 & (1 << 14)) {
4ec855
+    if (arch_info->exception == EXCP01_DB) {
4ec855
+        if (arch_info->dr6 & DR6_BS) {
4ec855
             if (cs->singlestep_enabled) {
4ec855
                 ret = EXCP_DEBUG;
4ec855
             }
4ec855
-- 
4ec855
1.8.3.1
4ec855