Re: [PATCH]3/5 Using kvm_arch prefix to define functions, and replace

Carsten Otte
2007-11-08T13:49:12Z

Zhang, Xiantao wrote:
> +void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu);
> +void kvm_arch_vcpu_decache(struct kvm_vcpu *vcpu);
> +void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu);
> +void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu);
> +struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int
> id);
> +
> +int kvm_arch_vcpu_reset(struct kvm_vcpu *vcpu);
> +void kvm_arch_hardware_enable(void *garbage);
> +void kvm_arch_hardware_disable(void *garbage);
> +int kvm_arch_hardware_setup(void);
> +void kvm_arch_hardware_unsetup(void);
> +void kvm_arch_check_processor_compat(void *rtn);
I don't like the generic introduction of all x86_ops wrappers into the
arch callbacks. I would rather prefer to work out a different split
between common and arch specifics - at least in the following cases:
- unloading the mmu needs to be moved out of kvm_free_vcpus into the
arch part, because we don't have a shaddow mmu on s390
- decache_vcpus_on_cpu should be arch-dependent alltogether, rather
than having a per cpu callback. We've got nothing to decache, so the
entire thing is a nop for us.
- vcpu_reset works very different for our architecture, we'd need an
initial processor status word. I'd prefer to keep the existence of
this callback arch dependent.
- hardware enable/disable/setup/unsetup/check_processor_compat does not
make any sense for us: all CPUs that have been sold since the 1970s have
proper hardware virtualization, and there's nothing to enable - it just
works.