Skip to contentSkip to conversation

kvm: drop work around for kernel header typo.

PATCH In review Nan Wang 2 participants 2 messages Feb 7, 2022

lore
Share & tools
lore

Nan Wang

author
#0 lore raw

PATCH 1/1 kvm: drop work around for kernel header typo.

From: "wangnan.light" <[email protected]>

Kernel header once had a typo(linux commit caa057a2cad6), qemu have to work around it with hardcode macro(qemu commit 6f131f13e68d). Now kernel fix it(linux commit 766d3571d8e5), so we can remove redundant code.

---
 target/i386/kvm/kvm.c | 4 ----
 1 file changed, 4 deletions(-)
target/i386/kvm/kvm.c +0 -4
index 2c8feb4a6f..f65ed37591 100644
@@ -2403,10 +2403,6 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
         int disable_exits = kvm_check_extension(s, KVM_CAP_X86_DISABLE_EXITS);
         int ret;
 
-/* Work around for kernel header with a typo. TODO: fix header and drop. */
-#if defined(KVM_X86_DISABLE_EXITS_HTL) && !defined(KVM_X86_DISABLE_EXITS_HLT)
-#define KVM_X86_DISABLE_EXITS_HLT KVM_X86_DISABLE_EXITS_HTL
-#endif
         if (disable_exits) {
             disable_exits &= (KVM_X86_DISABLE_EXITS_MWAIT |
                               KVM_X86_DISABLE_EXITS_HLT |
Signature · 1 line
2.11.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Nan Wang

From: "wangnan.light" <[email protected]>

Kernel header once had a typo(linux commit caa057a2cad6), qemu have to work around it with hardcode macro(qemu commit 6f131f13e68d). Now kernel fix it(linux commit 766d3571d8e5), so we can remove redundant code.

The other relevant git commit hash worth mentioning here is QEMU commit 77d361b13c19f, which is where we updated our copy of the kernel headers to a version that included that fix. You might also mention when these fixes happened, which was back in 2018.

Quoted 10 lines
---
 target/i386/kvm/kvm.c | 4 ----
 1 file changed, 4 deletions(-)
target/i386/kvm/kvm.c +0 -0
index 2c8feb4a6f..f65ed37591 100644

target/i386/kvm/kvm.c int kvm_arch_init(MachineState *ms, KVMState *s) · line 2408

Quoted 10 lines
target/i386/kvm/kvm.c +0 -4
@@ -2403,10 +2403,6 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
         int disable_exits = kvm_check_extension(s, KVM_CAP_X86_DISABLE_EXITS);
         int ret;
 
-/* Work around for kernel header with a typo. TODO: fix header and drop. */
-#if defined(KVM_X86_DISABLE_EXITS_HTL) && !defined(KVM_X86_DISABLE_EXITS_HLT)
-#define KVM_X86_DISABLE_EXITS_HLT KVM_X86_DISABLE_EXITS_HTL
-#endif
         if (disable_exits) {
             disable_exits &= (KVM_X86_DISABLE_EXITS_MWAIT |
                               KVM_X86_DISABLE_EXITS_HLT |

(Side note, I'm surprised that kernel fix was allowed in -- it breaks any userspace code that was relying on the typo'd #define name, which would have been easily avoidable by just defining both names. But that was years ago now, so it's done...)

thanks
-- PMM