On Thu, May 21, 2026 at 03:27:17PM +0200, Eric Auger wrote:
> On 5/21/26 2:26 PM, Shameer Kolothum Thodi wrote:
> >>> + /* Ignore any invalid address. This may come as part of reset etc. */
> >>> + if (!address_space_range_is_ram(&address_space_memory, addr, size)) {
> >> why do you need to test the whole range and not only the start addressa
> > That was to make it more defensive based on v4 discussion here:
> > https://lore.kernel.org/qemu-devel/aft%[email protected]/
> >
> > Please let me know if there is a better way.
> Well it is unclear to me. You want to make sure the GPA was fully set
> through the H and L regs. To me that's enough. As far as I understand
> Nicolin's reply, the kernel checks the rest. But please sync with Jason
> or Nicolin
Yes. Kernel checks if the range is in the stage-2 page table, i.e.,
mapped GPAs. One caveat: mapped GPA doesn't guarantee it's is_ram.
So, what if the GPA is in the IO space (PCI BAR) or reserved space
(firmware)?
AFAIK, kernel doesn't have a way to know. So, it's VMM's job to do
so.
Nicolin