qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Elena Afanasova <eafanasova@gmail.com>
Cc: Thomas Huth <thuth@redhat.com>,
	qemu-trivial@nongnu.org, jasowang@redhat.com,
	qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH] hw/net: move allocation to the heap due to very large stack frame
Date: Fri, 16 Oct 2020 11:32:18 +1100	[thread overview]
Message-ID: <20201016003218.GF7078@yekko.fritz.box> (raw)
In-Reply-To: <96fa5d23ca57363e063b9b5006ad8f71e6b1b307.camel@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1332 bytes --]

On Wed, Oct 14, 2020 at 07:15:47AM -0700, Elena Afanasova wrote:
> On Tue, 2020-10-13 at 16:32 +1100, David Gibson wrote:
> > On Mon, Oct 12, 2020 at 03:45:02PM +0200, Paolo Bonzini wrote:
> > > On 12/10/20 12:44, Thomas Huth wrote:
> > > > I think this is one of the tasks from:
> > > > 
> > > >  
> > > > https://wiki.qemu.org/Contribute/BiteSizedTasks#Compiler-driven_cleanups
> > > > 
> > > > It has been added by Paolo in 2016:
> > > > 
> > > >  
> > > > https://wiki.qemu.org/index.php?title=Contribute/BiteSizedTasks&diff=5368&oldid=5367
> > > > 
> > > > ... so maybe Paolo can comment on the size that has been chosen
> > > > here...?
> > > 
> > > I used 16K, mostly because it is a nice round number.  8k is too
> > > small
> > > due to PATH_MAX-sized variables.  16k seemed to be plenty and
> > > triggered
> > > in few-enough places that the cleanup is viable.
> > 
> > Ok.  Why are large stack frames bad in qemu?
> > 
> 
> I think that the main issue here is alloca() because it can lead to UB.

That's a fair point.  I've applied the patch to ppc-for-5.2, with a
tweak to the commit message.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-10-16  0:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09 14:02 [PATCH] hw/net: move allocation to the heap due to very large stack frame Elena Afanasova
2020-10-09 14:14 ` Richard Henderson
2020-10-09 14:25 ` Philippe Mathieu-Daudé
2020-10-09 14:48 ` Greg Kurz
2020-10-09 14:55 ` Li Qiang
2020-10-10  6:07 ` David Gibson
2020-10-10 15:53   ` Elena Afanasova
2020-10-12  5:30     ` David Gibson
2020-10-12 10:44       ` Thomas Huth
2020-10-12 13:45         ` Paolo Bonzini
2020-10-13  5:32           ` David Gibson
2020-10-14 14:15             ` Elena Afanasova
2020-10-16  0:32               ` David Gibson [this message]
2020-10-11  2:23   ` Li Qiang
2020-10-12  5:28     ` David Gibson
2020-10-12 11:09   ` Philippe Mathieu-Daudé
2020-10-12 11:48     ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201016003218.GF7078@yekko.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=eafanasova@gmail.com \
    --cc=jasowang@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).