Re: [PATCH v2] iscsi_ibft: Fix finding the iBFT under Xen Dom 0

From: Dave Hansen
Date: Thu Jun 01 2023 - 12:58:02 EST


On 5/30/23 08:01, Ross Lagerwall wrote:
> Since firmware doesn't indicate the iBFT in the E820, add a reserved
> region so that it gets identity mapped when running as Dom 0 so that it
> is possible to search for it. Move the call to reserve_ibft_region()
> later so that it is called after the Xen identity mapping adjustments
> are applied.
>
> Finally, instead of using isa_bus_to_virt() which doesn't do the right
> thing under Xen, use early_memremap() like the dmi_scan code does.

This is connecting Xen, iSCSI and x86. Some background here would be
*really* nice for dummies like me that deal heavily in only one of those
three.

One or two sentences like this:

Firmware can provide an iSCSI-specific table called the iBFT
which helps the OS boot from iSCSI devices.

can go a long way for dummies like me. As could some background about
why this:

... add a reserved region so that it gets identity mapped when
running as Dom 0 so that it is possible to search for it.

These are all English words, but off the top of my head, I have no idea
why reserved regions get identity mapped when running as Dom 0 or why
that makes it possible to search.

The addresses and size here:

> +#ifdef CONFIG_ISCSI_IBFT_FIND
> + /* Reserve 0.5 MiB to 1 MiB region so iBFT can be found */
> + xen_e820_table.entries[xen_e820_table.nr_entries].addr = 0x80000;
> + xen_e820_table.entries[xen_e820_table.nr_entries].size = 0x80000;
> + xen_e820_table.entries[xen_e820_table.nr_entries].type = E820_TYPE_RESERVED;
> + xen_e820_table.nr_entries++;
> +#endif

also appear to be conjured out of thin air.

As does the move of:

> + reserve_ibft_region();

I'm sure I can go figure this all out with some research. But, I'd
really appreciate some extra effort from you in this changelog to save
me the time. I bet you can explain it a lot more efficiently than I can
go figure it out.