Re: [PATCH v2 1/1] target/s390x: Allow 2G hugepages guest backing

Claudio Imbrenda <[email protected]>
Newsgroups gmane.comp.emulators.qemu
Organization IBM
Message-ID <20260730142001.760e057c@p-imbrenda>
On Wed, 29 Jul 2026 13:53:01 -0400
Matthew Rosato <[email protected]> wrote:

> > -        if (kvm_enabled() && kvm_s390_get_hpage_1m()) {
> > +        if (kvm_enabled() && kvm_s390_get_hpage()) {  
> 
> ...
> 
> >  
> > -    cap_hpage_1m = 1;
> > +int kvm_s390_get_hpage(void)
> > +{
> > +    return cap_hpage;
> >  }
> >  
> >  int kvm_s390_get_hpage_1m(void)
> >  {
> > -    return cap_hpage_1m;
> > +    return cap_hpage == 1;
> > +}
> > +
> > +int kvm_s390_get_hpage_2g(void)
> > +{
> > +    return cap_hpage == 2;
> >  }  
> 
> Hey Claudio,
> 
> Thanks for changing things to differentiate between 1m and 2g for the cap.
> 
> Overall LGTM but this patch now makes kvm_s390_get_hpage_1m() dead code
> (not referenced anywhere) as well as introduces a new function
> kvm_s390_get_hpage_2g() that is also unused.
> 
> Since this patch is by itself, why not just remove the functions
> until/if they are needed and only provide kvm_s390_get_hpage()?
> 
> Do you have planned future patches that you are confident will soon make
> use of these get_hpage_1m() and get_hpage_2g() helpers?

yes, which is why I put them there :)

but I understand that dead code is annoying, if you want I can simply
respin without the unused functions, and introduce them later when they
are actually needed.

> 
> Thanks,
> Matt
> 
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.