Skip to contentSkip to conversation

x86/HVM: use XVFREE() in hvmemul_cache_destroy()

PATCH In review Jan Beulich 3 participants 3 messages Feb 13, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/HVM: use XVFREE() in hvmemul_cache_destroy()

My adjustments to move from xmalloc() et al to respective xvmalloc() flavors was flawed - a freeing instance wasn't converted.

Fixes 23d60dbb0493 ("x86/HVM: allocate emulation cache entries dynamically")

---
Noticed while backporting, where the conversion needs undoing.

xen/arch/x86/include/asm/hvm/emulate.h +1 -1
@@ -123,7 +123,7 @@ static inline void hvmemul_cache_destroy(struct vcpu *v)
     unsigned int i;
 
     for ( i = 0; i < ARRAY_SIZE(v->arch.hvm.hvm_io.mmio_cache); ++i )
-        XFREE(v->arch.hvm.hvm_io.mmio_cache[i]);
+        XVFREE(v->arch.hvm.hvm_io.mmio_cache[i]);
     XVFREE(v->arch.hvm.hvm_io.cache);
 }
 bool hvmemul_read_cache(const struct vcpu *v, paddr_t gpa,
#2 lore raw
In reply to Jan Beulich
Quoted 7 lines · Jan Beulich

My adjustments to move from xmalloc() et al to respective xvmalloc() flavors was flawed - a freeing instance wasn't converted.

Fixes 23d60dbb0493 ("x86/HVM: allocate emulation cache entries dynamically")

---
Noticed while backporting, where the conversion needs undoing.

~ Oleksii

Quoted 12 lines
xen/arch/x86/include/asm/hvm/emulate.h +1 -1
@@ -123,7 +123,7 @@ static inline void hvmemul_cache_destroy(struct vcpu *v)
      unsigned int i;
 
      for ( i = 0; i < ARRAY_SIZE(v->arch.hvm.hvm_io.mmio_cache); ++i )
-        XFREE(v->arch.hvm.hvm_io.mmio_cache[i]);
+        XVFREE(v->arch.hvm.hvm_io.mmio_cache[i]);
      XVFREE(v->arch.hvm.hvm_io.cache);
  }
  bool hvmemul_read_cache(const struct vcpu *v, paddr_t gpa,