Guillaume Thouvenin wrote:
This patch emulates CPUID instruction. It should work but when I'm
testing it in kvm-userspace, the cpuid instruction seems to have no
effect (I mean eax == ebx == ecx == edx == 0x0). Should
kvm_cpuid_emulate() be modified? Is cpuid instruction correctly
implemented?
It doesn't have any effect because writeback() writes back the cached
registers back into vcpu->arch.regs, overwriting kvm_cpuid_emulate()'s
effect.
You need to first modify kvm_cpuid_emulate() to accept the registers as
in/out parameters, and pass the emulator's registers which can be later
written back.
An alternative implementation can modify the emulator not to work on a
temporarary copy, instead something like this:
decode():
copy registers to backup store
execute():
start executing
if fail:
copy registers from backup store to main state
The later approach is more invasive, but has the advantage of speeding
up the emulator (since usually emulation will succeed, so we don't need
to writeback)
--
error compiling committee.c: too many arguments to function
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html