From 83516ba7f0e816a7e1f17a711c8cdef2e633738c Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sat, 13 Feb 2021 19:41:03 +0000 Subject: [cloud] Use PCIAPI_DIRECT for cloud images The version of SeaBIOS found on some AWS EC2 instances (observed with t3a.nano in eu-west-1) has no support for the INT 1A PCI BIOS calls. Bring config/ioapi.h into the named-configuration set of headers, and specify the use of PCIAPI_DIRECT for CONFIG=cloud, to work around the missing PCI BIOS support. Switching to a different named configuration will now unfortunately cause an almost complete rebuild of iPXE. As described in commit c801cb2 ("[build] Allow for named configurations at build time"), this is the reason why config/ioapi.h was not originally in the named-configuration set of header files. This rebuild cost is acceptable given that build times are substantially faster now than seven years ago, and that very few people are likely to be switching named configurations on a regular basis. Signed-off-by: Michael Brown --- src/config/cloud/ioapi.h | 7 +++++++ src/config/ioapi.h | 3 +++ src/config/qemu/ioapi.h | 0 src/config/rpi/ioapi.h | 0 src/config/vbox/ioapi.h | 0 5 files changed, 10 insertions(+) create mode 100644 src/config/cloud/ioapi.h create mode 100644 src/config/qemu/ioapi.h create mode 100644 src/config/rpi/ioapi.h create mode 100644 src/config/vbox/ioapi.h diff --git a/src/config/cloud/ioapi.h b/src/config/cloud/ioapi.h new file mode 100644 index 0000000..c7c917f --- /dev/null +++ b/src/config/cloud/ioapi.h @@ -0,0 +1,7 @@ +/* Work around missing PCI BIOS calls in the cut-down SeaBIOS found in + * some AWS EC2 instances. + */ +#ifdef PLATFORM_pcbios +#undef PCIAPI_PCBIOS +#define PCIAPI_DIRECT +#endif diff --git a/src/config/ioapi.h b/src/config/ioapi.h index abe5a50..a149848 100644 --- a/src/config/ioapi.h +++ b/src/config/ioapi.h @@ -14,6 +14,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); //#undef PCIAPI_PCBIOS /* Access via PCI BIOS */ //#define PCIAPI_DIRECT /* Direct access via Type 1 accesses */ +#include +#include NAMED_CONFIG(ioapi.h) #include +#include LOCAL_NAMED_CONFIG(ioapi.h) #endif /* CONFIG_IOAPI_H */ diff --git a/src/config/qemu/ioapi.h b/src/config/qemu/ioapi.h new file mode 100644 index 0000000..e69de29 diff --git a/src/config/rpi/ioapi.h b/src/config/rpi/ioapi.h new file mode 100644 index 0000000..e69de29 diff --git a/src/config/vbox/ioapi.h b/src/config/vbox/ioapi.h new file mode 100644 index 0000000..e69de29 -- cgit v1.1