1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-22 07:20:00 +00:00
freebsd/sys/x86/acpica
Roger Pau Monné 1b5e5ff68c xen/pvh: fix initialization of environment
Xen PVH entry point requires to modify the environment provided by the boot
loader, so that the ACPI RSDP is re-written to use the Xen generated RSDP
instead of the native one.

The current logic in the PVH entry point reserves a single page (4K) in order
to copy the contents of the environment passed from the boot loader, so that
the bootloader provided "acpi.rsdp" is dropped and a Xen specific one is added
afterwards.

This however doesn't scale well, as it's possible for the environment to be
bigger than 4K.  Bumping the buffer, or attempting to peek at the size of the
metadata all seem to just add more complexity to a sensitive path.  Instead
introduce a new ACPI hook that allows setting the RSDP address directly, and
use it from the PVH entry point to set the position of the Xen generated RSDP.

This allows to reduce the logic in the PVH metadata processing, as there's no
need to parse and filter the bootloader provided environment.

Note that modifying the environment blob in-place is likely to not work.  The
RSDP address is provided as a string, it's possible the new RSDP location is
higher than the current one, and the string with the new location would overrun
the space used by the previous one.

Sponsored by: Cloud Software Group
PR: 277200
MFC: 3 days
Reviewed by: markj kib
Differential revision: https://reviews.freebsd.org/D46089
2024-08-02 12:41:52 +02:00
..
acpi_apm.c acpi/apm: Improve APM ioctl interface emulation 2024-01-10 17:05:00 -07:00
madt.c madt: print CPU APIC ID as signed int 2024-05-10 15:20:40 -04:00
OsdEnvironment.c xen/pvh: fix initialization of environment 2024-08-02 12:41:52 +02:00
srat.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00