qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 03/13] accel: Elide kvm_update_guest_debug by checking kvm_su


From: Richard Henderson
Subject: Re: [PATCH 03/13] accel: Elide kvm_update_guest_debug by checking kvm_supports_guest_debug
Date: Wed, 9 Feb 2022 09:16:02 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 2/9/22 02:22, Philippe Mathieu-Daudé wrote:
-int kvm_update_guest_debug(CPUState *cpu, unsigned long reinject_trap)
-{
-    return -ENOSYS;
-}
-
  int kvm_insert_breakpoint(CPUState *cpu, target_ulong addr,
                            target_ulong len, int type)
  {
diff --git a/cpu.c b/cpu.c
index 97d42b6b2a..834e2b4cdb 100644
--- a/cpu.c
+++ b/cpu.c
@@ -350,7 +350,7 @@ void cpu_single_step(CPUState *cpu, int enabled)
  {
      if (cpu->singlestep_enabled != enabled) {
          cpu->singlestep_enabled = enabled;
-        if (kvm_enabled()) {
+        if (kvm_enabled() && kvm_supports_guest_debug()) {
              kvm_update_guest_debug(cpu, 0);

Why is this second hunk required?

I would think the stub would be removable on its own, since it is protected by kvm_enabled, which will expand to false exactly like kvm_supports_guest_debug expands to false.

As an aside, I wonder about the non-checking of the update return value...


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]