qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH for-6.0 v2 4/5] hw/core/loader: Add new function rom_ptr_for_


From: Peter Maydell
Subject: Re: [PATCH for-6.0 v2 4/5] hw/core/loader: Add new function rom_ptr_for_as()
Date: Thu, 18 Mar 2021 21:28:33 +0000

On Thu, 18 Mar 2021 at 21:14, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> On 3/18/21 1:02 PM, Peter Maydell wrote:
> >>> +     * Note that we do not check @as against the 'as' member in the
> >>> +     * 'struct Rom' returned by rom_ptr(). The Rom::as is the
> >>> +     * AddressSpace which the rom blob should be written to...
> ...
> >> Should you really have this special case?  Nowhere is this going to verify 
> >> that
> >> @addr is in @as.
> >
> > It's the "happens almost all the time" case. Nothing verifies
> > that @addr is in @as anyway -- see the "Note that" part of the
> > comment above.
>
> The comment explains why we don't examine Rom::as.
> But we do check @addr vs @as via @as -> @fv -> flatview_translate.

All we do is look for "every other address in the AS that
maps to the same MR as the address we started with".
Are you asking about the !cbdata.mr exit ? That's for the
implausible corner case that the caller asked us about an
address with no RAM. In that case the early "check rom_ptr()
directly against @address" gets us the "did the user load
an image at that address", and we can skip the "check for
other aliases, because by there aren't going to be any
aliases to no MR at all.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]