[Android-virt] [PATCH v6 04/12] ARM: KVM: Hypervisor inititalization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 23, 2012 at 11:00 PM, Rusty Russell <rusty at rustcorp.com.au> wrote:
> On Thu, 23 Feb 2012 02:32:39 -0500, Christoffer Dall <c.dall at 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.
>

what you're saying is that static DEFINE_PER_CPU will still be
initialized to zero? I don't actually have experience with this, but I
assumed that the data..percpu section would not necessarily be zeroed
out when loading a module... Now I tried to look, but I couldn't
convince myself. Can you enlighten me?

>> + ? ? 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.
>
true, thanks.

-Christoffer



[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux