Re: Some warnings occur in hyperv.c.

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

 



Haiwei Li <lihaiwei.kernel@xxxxxxxxx> writes:

> Hi, When i build kvm, some warnings occur. Just like:
>
> /home/kernel/data/linux/arch/x86/kvm//hyperv.c: In function ‘kvm_hv_flush_tlb’:
> /home/kernel/data/linux/arch/x86/kvm//hyperv.c:1436:1: warning: the
> frame size of 1064 bytes is larger than 1024 bytes
> [-Wframe-larger-than=]
>  }
>  ^
> /home/kernel/data/linux/arch/x86/kvm//hyperv.c: In function ‘kvm_hv_send_ipi’:
> /home/kernel/data/linux/arch/x86/kvm//hyperv.c:1529:1: warning: the
> frame size of 1112 bytes is larger than 1024 bytes
> [-Wframe-larger-than=]
>  }
>  ^
>
> Then i get the two functions in hyperv.c. Like:
>
> static u64 kvm_hv_send_ipi(struct kvm_vcpu *current_vcpu, u64 ingpa, u64 outgpa,
>                            bool ex, bool fast)
> {
>         struct kvm *kvm = current_vcpu->kvm;
>         struct hv_send_ipi_ex send_ipi_ex;
>         struct hv_send_ipi send_ipi;
>         u64 vp_bitmap[KVM_HV_MAX_SPARSE_VCPU_SET_BITS];
>         DECLARE_BITMAP(vcpu_bitmap, KVM_MAX_VCPUS);
>         unsigned long *vcpu_mask;
>         unsigned long valid_bank_mask;
>         u64 sparse_banks[64];
>         int sparse_banks_len;
>         u32 vector;
>         bool all_cpus;
>
> static u64 kvm_hv_flush_tlb(struct kvm_vcpu *current_vcpu, u64 ingpa,
>                             u16 rep_cnt, bool ex)
> {
>         struct kvm *kvm = current_vcpu->kvm;
>         struct kvm_vcpu_hv *hv_vcpu = &current_vcpu->arch.hyperv;
>         struct hv_tlb_flush_ex flush_ex;
>         struct hv_tlb_flush flush;
>         u64 vp_bitmap[KVM_HV_MAX_SPARSE_VCPU_SET_BITS];
>         DECLARE_BITMAP(vcpu_bitmap, KVM_MAX_VCPUS);
>         unsigned long *vcpu_mask;
>         u64 valid_bank_mask;
>         u64 sparse_banks[64];
>         int sparse_banks_len;
>         bool all_cpus;
>
> The definition of sparse_banks for X86_64 is 512 B.  So i tried to
> refactor it by
> defining it for both tlb and ipi. But no preempt disable in the flow.
> How can i do?

I don't think preemption is a problem here if you define a per-vCPU
buffer: we can never switch to serving some new request for the same
vCPU before finishing the previous one so this is naturally serialized.

To not waste memory I'd suggest you allocate this buffer dinamically
upon first usage. We can also have a union for struct
hv_tlb_flush*/struct hv_send_ipi* as these also can't be used
simultaneously.

-- 
Vitaly




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux