On Tue, 4 Mar 2025 at 12:49, Gerd Hoffmann <[email protected]> wrote:
>
> The x86 variant of the device is mapped on the fixed address 0xfef10000
> and uses etc/hardware-info instead of FDT to pass the mapping location
> to the edk2 firmware. The latter allows to move the device to a
> different location should that turn out to be necessary in the future.
>
> Signed-off-by: Gerd Hoffmann <[email protected]>
> Message-ID: <[email protected]>
Hi; apologies for this very late comment, but I just
noticed this reading through the code:
> +static void uefi_vars_x64_realize(DeviceState *dev, Error **errp)
> +{
> + HARDWARE_INFO_SIMPLE_DEVICE hwinfo = {
> + .mmio_address = cpu_to_le64(0xfef10000),
> + };
> + SysBusDevice *sysbus = SYS_BUS_DEVICE(dev);
> +
> + uefi_vars_sysbus_realize(dev, errp);
> +
> + hardware_info_register(HardwareInfoQemuUefiVars,
> + &hwinfo, sizeof(hwinfo));
> + sysbus_mmio_map(sysbus, 0, hwinfo.mmio_address);
> +}
Device realize methods should generally not map things into
the system address space. Can we refactor this so
that the board/SoC/whatever devices that create the
device do the mapping ?
thanks
-- PMM