[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [PATCH 1/3] x86: fix warning without CONFIG_KVM
From: |
Jamie Lokier |
Subject: |
Re: [Qemu-devel] Re: [PATCH 1/3] x86: fix warning without CONFIG_KVM |
Date: |
Fri, 14 Nov 2008 03:22:19 +0000 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Anthony Liguori wrote:
> Jan Kiszka wrote:
> >Isn't it cleaner to provide an empty static inline in the !CONFIG_KVM
> >case? Not all compilers might be smart enough to optimize this function
> >away.
>
> kvm_enabled() is (0) when !CONFIG_KVM so that's why this is a warning
> and not an error. The function call disappears during linking from dead
> code elimination. There is no routine overhead when !CONFIG_KVM.
I think it's in reference to:
> static void host_cpuid(uint32_t function, uint32_t *eax, uint32_t *ebx,
> uint32_t *ecx, uint32_t *edx)
This compiles to an empty function if !CONFIG_KVM. Current GCC will
remove the function call by auto-inlining, but some compilers
(including older GCC) will produce an empty function.
If you're saying !CONFIG_KVM results in the _call_ to host_cpuid()
being removed, I'm thinking that the option to provide the guest with
the same features as the host CPU is still useful if KVM is
disabled... I have a real use-case for this. It's installing some
versions of Windows in a guest, to be used with KVM after
installation, because the install process is more reliable (and
faster!) with KVM disabled but after that it works.
-- Jamie