Re: [PATCH v6 04/12] ARM: KVM: Hypervisor inititalization

Rusty Russell
2012-02-24T04:08:05Z

On Thu, 23 Feb 2012 02:32:39 -0500, Christoffer Dall <c.dall@virtualopensystems.com> wrote:
> + /*
> + * Allocate stack pages for Hypervisor-mode
> + */
> + for_each_possible_cpu(cpu)
> + per_cpu(kvm_arm_hyp_stack_page, cpu) = NULL;

This is weird; we can't call this init function multiple times without
reloading the module.

> + for_each_possible_cpu(cpu) {
> + void *stack_page;
> +
> + stack_page = (void *)__get_free_page(GFP_KERNEL);

Actually, if you change kvm_arm_hyp_stack_page to an unsigned long, and
your mapping functions to take unsigned long too, you can avoid many
casts.

Cheers,
Rusty.