lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABgObfbGXpEWtfYNYsEhEANNaR+1to1U-O0s5h1bBsY-u2384g@mail.gmail.com>
Date: Fri, 13 Jun 2025 13:25:35 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: avinashlalotra <abinashlalotra@...il.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org, vkuznets@...hat.com, 
	seanjc@...gle.com, tglx@...utronix.de, mingo@...hat.com, bp@...en8.de, 
	dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com, 
	avinashlalotra <abinashsinghlalotra@...il.com>
Subject: Re: [RFC PATCH] KVM: x86: Dynamically allocate bitmap to fix
 -Wframe-larger-than error

On Fri, Jun 13, 2025 at 1:11 PM avinashlalotra <abinashlalotra@...il.com> wrote:
> diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
> index 24f0318c50d7..78bb8d58fe94 100644
> --- a/arch/x86/kvm/hyperv.c
> +++ b/arch/x86/kvm/hyperv.c
> @@ -2005,7 +2005,7 @@ static u64 kvm_hv_flush_tlb(struct kvm_vcpu *vcpu, struct kvm_hv_hcall *hc)
>         struct kvm *kvm = vcpu->kvm;
>         struct hv_tlb_flush_ex flush_ex;
>         struct hv_tlb_flush flush;
> -       DECLARE_BITMAP(vcpu_mask, KVM_MAX_VCPUS);
> +       unsigned long *vcpu_mask;

The default KVM_MAX_VCPUS is 1024, which is not too bad; you're
probably compiling with CONFIG_MAXSMP and accepting the default limit
of 4096. Adding an allocation for every hypercall is not great, I'd
rather add it to struct kvm_vcpu_arch* instead.

If instead we go for having the allocation, you can use this:

unsigned long *vcpu_mask __free(bitmap) = NULL;

and avoid changing the returns to gotos everywhere else.

Paolo


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ