On 13 July 2012 04:37, Rusty Russell <rusty.russell at linaro.org> wrote: > int kvm_arch_init_vcpu(CPUARMState *env) > { > - return 0; > + struct kvm_sregs sregs; > + > + sregs.target = KVM_ARM_TARGET_CORTEX_A15; > + sregs.num_features = 0; We need to add a check somewhere that if we're not emulating an A15 then we either fail noisily or silently drop back to TCG. Then we should have an assert in here that env refers to an A15 I guess. [not yet figured out how to do that, I don't want to look at the cpu->midr, we only just finished cleaning out all the references to that. Maybe there should be a field in the struct ARMCPU which gives the KVM_ARM_TARGET_* value to use?] Unfortunately I can't find a good place to put the CPU type check -- ideally we would fail kvm_init() as this would make us fall back to TCG in the usual way, but in kvm_init() you don't yet know what guest CPU you're going to be emulating... > + > + /* Ignore failure for compatibility with old kvm versions. */ > + return kvm_vcpu_ioctl(env, KVM_SET_SREGS, &sregs) ? 0 : 0; I assume this weird "? 0 : 0" construct is going to go away when we drop the back-compat? Since this back-compat code is going to go away within a few weeks, it would make my life easier if all the back compat code was flagged with ifdefs or something, so we don't leave it in by mistake (and so I know what not to worry about reviewing in patches). -- PMM