public inbox for qemu-devel@nongnu.org
 help / color / mirror / Atom feed
From: Yodel Eldar <yodel.eldar@yodel.dev>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Subject: Re: [PATCH 03/15] hw/alpha/dp264: Validate kernel and initrd sizes
Date: Wed, 25 Mar 2026 21:04:23 -0500	[thread overview]
Message-ID: <7cd87657-f7fc-41c5-bdde-a5e6c5bf1399@yodel.dev> (raw)
In-Reply-To: <979d9029-c49b-4bdd-823c-ca356d63a1c3@linaro.org>

Hi, Richard

On 25/03/2026 19:11, Richard Henderson wrote:
> On 3/11/26 08:31, Yodel Eldar wrote:
>> @@ -192,7 +192,15 @@ static void clipper_init(MachineState *machine)
>>               }
>>               /* Put the initrd image as high in memory as possible.  */
>> -            initrd_base = (ram_size - initrd_size) & TARGET_PAGE_MASK;
>> +            if (usub64_overflow(ram_size, initrd_size, &initrd_base)) {
>> +                error_report("initial ram disk exceeds allotted ram 
>> size");
>> +                exit(1);
>> +            }
>> +            initrd_base &= TARGET_PAGE_MASK;
>> +            if (initrd_base <= kernel_high) {
>> +                warn_report("initial ram disk overlaps with kernel");
>> +            }
> 
> Why is the first an error and the second a warning?
> 

Initially, I had both as fatal, but then I figured a (mis)adventurous
user may actually want to experiment with kernel/initrd overlap, whereas
an underflow is something we can't allow (and initrd being larger than
RAM is physically impossible AFAIK). I could make the overlap fatal,
too, if that's better?

Thanks for the reviews in Patches 1-2, and for letting me know about
using cpu_to_le64 in Patch 4. v2 has seen some nontrivial changes in
the later patches, and I'll be sending it soon.

Thanks again,
Yodel

> 
> r~
> 



  reply	other threads:[~2026-03-26  2:05 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10 22:31 [PATCH 00/15] hw/alpha: QOMify Clipper and Typhoon Yodel Eldar
2026-03-10 22:31 ` [PATCH 01/15] hw/alpha/typhoon: Fix whitespace and block comment style problems Yodel Eldar
2026-03-26  0:11   ` Richard Henderson
2026-03-10 22:31 ` [PATCH 02/15] hw/alpha/dp264: Fix " Yodel Eldar
2026-03-26  0:11   ` Richard Henderson
2026-03-10 22:31 ` [PATCH 03/15] hw/alpha/dp264: Validate kernel and initrd sizes Yodel Eldar
2026-03-26  0:11   ` Richard Henderson
2026-03-26  2:04     ` Yodel Eldar [this message]
2026-03-26  3:07       ` Richard Henderson
2026-03-26 14:23         ` Yodel Eldar
2026-03-10 22:31 ` [PATCH 04/15] hw/alpha/dp264: Use rom_add_blob_fixed() for initrd params Yodel Eldar
2026-03-26  0:17   ` Richard Henderson
2026-03-10 22:31 ` [PATCH 05/15] hw/alpha/typhoon: Create instance_init and class_init Yodel Eldar
2026-03-11 12:43   ` Philippe Mathieu-Daudé
2026-03-11 18:07     ` Yodel Eldar
2026-03-10 22:31 ` [PATCH 06/15] hw/alpha/dp264: Add CPUs as children of the machine Yodel Eldar
2026-03-10 22:31 ` [PATCH 07/15] hw/alpha: Use QOM composition for the Typhoon chipset Yodel Eldar
2026-03-10 22:31 ` [PATCH 08/15] hw/alpha: Set CPU link properties and use them Yodel Eldar
2026-03-10 22:31 ` [PATCH 09/15] hw/alpha: Convert IRQ pointers to named GPIOs Yodel Eldar
2026-03-10 22:31 ` [PATCH 10/15] hw/alpha: Expose RAM to typhoon via QOM property link Yodel Eldar
2026-03-11 12:39   ` Philippe Mathieu-Daudé
2026-03-10 22:31 ` [PATCH 11/15] hw/alpha: Explicitly define TyphoonClass in alpha_sys.h Yodel Eldar
2026-03-10 22:31 ` [PATCH 12/15] hw/alpha: Move PCI IRQ mapping to TyphoonClass subclass Yodel Eldar
2026-03-10 22:31 ` [PATCH 13/15] hw/alpha: Move minimum PCI device slot to TyphoonClass Yodel Eldar
2026-03-10 22:31 ` [PATCH 14/15] hw/alpha: Use QOM path resolution to get Typhoon PCI bus Yodel Eldar
2026-03-11 13:05   ` Yodel Eldar
2026-03-10 22:31 ` [PATCH 15/15] hw/alpha: Split typhoon_init() into instance_init and realize Yodel Eldar

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=7cd87657-f7fc-41c5-bdde-a5e6c5bf1399@yodel.dev \
    --to=yodel.eldar@yodel.dev \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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