aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-08-10[intelxl] Fix invocation of intelxlvf_admin_queues()Michael Brown1-1/+1
The second parameter to intelxlvf_admin_queues() is a boolean used to select the VF opcode, rather than the raw VF opcode itself. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-08-08[intelxl] Use function-level reset instead of PFGEN_CTRL.PFSWRMichael Brown4-39/+18
Remove knowledge of the PFGEN_CTRL register (which changes location between XL710 and E810 register maps), and instead use PCIe FLR to reset the physical function. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-08-08[pci] Generalise function-level reset mechanismMichael Brown3-20/+26
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-08-08[intelxl] Update list of PCI IDsMichael Brown1-0/+5
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-08-08[intelxl] Include admin command response data buffer in debug outputMichael Brown1-1/+5
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-08-08[intelxl] Identify rings consistently in debug messagesMichael Brown1-4/+3
Use the tail register offset (which exists for all ring types) as the ring identifier in all relevant debug messages. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-08-08[intelxl] Add missing padding bytes to receive queue contextMichael Brown1-0/+2
For the sake of completeness, ensure that all 32 bytes of the receive queue context are programmed (including the unused final 8 bytes). Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-08-08[intelxl] Fix bit width of function number in PFFUNC_RID registerMichael Brown1-1/+1
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-08-08[intelxl] Fix retrieval of switch configuration via admin queueMichael Brown1-9/+11
Commit 8f3e648 ("[intelxl] Use one admin queue buffer per admin queue descriptor") changed the API for intelxl_admin_command() such that the caller now constructs the command directly within the next available descriptor ring entry, rather than relying on intelxl_admin_command() to copy the descriptor to and from the descriptor ring. This introduced a regression in intelxl_admin_switch(), since the second and subsequent iterations of the loop will not have constructed a valid command in the new descriptor ring entry before calling intelxl_admin_command(). Fix by constructing the command within the loop. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-06-10[acpi] Expose system MAC address via ${sysmac} settingsysmacMichael Brown1-0/+37
Expose the system MAC address (if any) via the ${sysmac} setting. This allows scripts to access the system MAC address even when iPXE has decided not to apply it to a network device (e.g. because the cached DHCPACK MAC address was selected in order to match the behaviour of a previous boot stage). The setting is named ${sysmac} rather than ${acpimac} in order to allow for forward compatibility with non-ACPI mechanisms that may exist in future for specifying a system MAC address. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-05-23[cachedhcp] Allow cached DHCPACK to override a temporary MAC addresshwmacMichael Brown1-9/+42
When running on a system with an ACPI-provided system-specific MAC address, iPXE will apply this address to an ECM or NCM USB NIC. If iPXE has been chainloaded from a previous stage that does not understand the ACPI MAC mechanism then this can result in iPXE using a different MAC address than the previous stage, which is surprising to users. Attempt to minimise surprise by allowing the MAC address found in a cached DHCPACK packet to override a temporary MAC address, if the DHCPACK MAC address matches the network device's permanent MAC address. When a previous stage has chosen to use the network device's permanent MAC address (e.g. because it does not understand the ACPI MAC mechanism), this will cause iPXE to make the same choice. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-05-23[ecm] Treat ACPI MAC address as being a non-permanent MAC addressMichael Brown3-14/+18
When applying an ACPI-provided system-specific MAC address, apply it to netdev->ll_addr rather than netdev->hw_addr. This allows iPXE scripts to access the permanent MAC address via the ${netX/hwaddr} setting (and thereby provides scripts with a mechanism to ascertain that the NIC is using a MAC address other than its own permanent hardware address). Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-04-06[cloud] Allow aws-import script to run on Python 3.6Michael Brown1-1/+1
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-03-25[acpi] Support the "_RTXMAC_" format for ACPI-based MAC addressesMichael Brown2-28/+144
Some newer HP products expose the host-based MAC (HBMAC) address using an ACPI method named "RTMA" returning a part-binary string of the form "_RTXMAC_#<mac>#", where "<mac>" comprises the raw MAC address bytes. Extend the existing support to handle this format alongside the older "_AUXMAC_" format (which uses a base16-encoded MAC address). Reported-by: Andreas Hammarskjöld <junior@2PintSoftware.com> Tested-by: Andreas Hammarskjöld <junior@2PintSoftware.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-03-24[acpi] Add MAC address extraction self-testsMichael Brown2-0/+239
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-03-24[linux] Add stub phys_to_user() implementationMichael Brown1-1/+14
For symmetry with the stub user_to_phys() implementation, provide phys_to_user() with the same underlying assumption that virtual addresses are physical (since there is no way to know the real physical address when running as a Linux userspace executable). Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-03-24[acpi] Allow for the possibility of overriding ACPI tables at link timeMichael Brown5-5/+26
Allow for linked-in code to override the mechanism used to locate an ACPI table, thereby opening up the possibility of ACPI self-tests. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-03-15[efi] Support Unicode character output via framebuffer consoleMichael Brown1-3/+48
Extend the glyph cache to include a number of dynamic entries that are populated on demand whenever a non-ASCII character needs to be drawn. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-03-15[fbcon] Support Unicode character outputMichael Brown4-74/+161
Accumulate UTF-8 characters in fbcon_putchar(), and require the frame buffer console's .glyph() method to accept Unicode character values. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-03-15[efi] Support Unicode character output via text consoleMichael Brown1-1/+17
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-03-15[utf8] Add UTF-8 accumulation self-testsMichael Brown2-0/+165
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-03-01[utf8] Add ability to accumulate Unicode characters from UTF-8 bytesMichael Brown2-0/+206
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-23[dns] Always start DNS queries using the first configured DNS serverdns_primaryMichael Brown1-5/+4
We currently define the active DNS server as a global variable. All queries will start by attempting to contact the active DNS server, and the active DNS server will be changed only if we fail to get a response. This effectively treats the DNS server list as expressing a weak preference ordering: we will try servers in order, but once we have found a working server we will stick with that server for as long as it continues to respond to queries. Some sites are misconfigured to hand out DNS servers that do not have a consistent worldview. For example: the site may hand out two DNS server addresses, the first being an internal DNS server (which is able to resolve names in private DNS domains) and the second being a public DNS server such as 8.8.8.8 (which will correctly return NXDOMAIN for any private DNS domains). This type of configuration is fundamentally broken and should never be used, since any DNS resolver performing a query for a name within a private DNS domain may obtain a spurious NXDOMAIN response for a valid private DNS name. Work around these broken configurations by treating the DNS server list as expressing a strong preference ordering, and always starting DNS queries from the first server in the list (rather than maintaining a global concept of the active server). This will have the debatable benefit of converting permanent spurious NXDOMAIN errors into transient spurious NXDOMAIN errors, which can at least be worked around at a higher level (e.g. by retrying a download in a loop within an iPXE script). The cost of always starting DNS queries from the first server in the list is a slight delay introduced when the first server is genuinely unavailable. This should be negligible in practice since DNS queries are relatively infrequent and the failover expiry time is short. Treating the DNS server list as a preference ordering is permitted by the language of RFC 2132, which defines DHCP option 6 as a list in which "[DNS] servers SHOULD be listed in order of preference". No specification defines a precise algorithm for how this preference order should be applied in practice: this new approach seems as good as any. Requested-by: Andreas Hammarskjöld <junior@2PintSoftware.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-16[console] Include mappings for AltGr-Shift-<key>Michael Brown20-3/+118
The BIOS console's interpretation of LShift+RShift as equivalent to AltGr requires the shifted ASCII characters to be present in the AltGr mapping table, to allow AltGr-Shift-<key> to be interpreted in the same way as AltGr-<key>. For keyboard layouts that have different ASCII characters for AltGr-<key> and AltGr-Shift-<key>, this will potentially leave the character for AltGr-<key> inaccessible via the BIOS console if the BIOS requires the use of the LShift+RShift workaround. This theoretically affects the numeric keys in the Lithuanian ("lt") keyboard layout (where the numerals are accessed via AltGr-<key> and punctuation characters via AltGr-Shift-<key>), but the simple workaround for that keyboard layout is to avoid using AltGr and Shift entirely since the unmodified numeric keys are not remapped anyway. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-16[console] Support changing keyboard map at runtimeMichael Brown4-2/+174
Provide the special keyboard map named "dynamic" which allows the active keyboard map to be selected at runtime via the ${keymap} setting, e.g.: #define KEYBOARD_MAP dynamic iPXE> set keymap uk Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-16[settings] Always process all settings applicatorsMichael Brown1-7/+3
Settings applicators are entirely independent, and there is no reason why a failure in one applicator should prevent other applicators from being processed. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-16[console] Ensure that US keyboard map appears at start of linker tableMichael Brown3-3/+7
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-16[xsigo] Avoid storing unused uninitialised fields in gateway addressMichael Brown1-0/+1
As reported by Coverity, xsmp_rx_xve_modify() currently passes a partially initialised struct ib_address_vector to xve_update_tca() and thence to eoib_set_gateway(), which uses memcpy() to store the whole structure including the (unused and unneeded) uninitialised fields. Silence the Coverity warning by zeroing the whole structure. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-16[pci] Ensure that pci_read_config() initialises all fieldsMichael Brown1-0/+5
As per the general pattern for initialisation functions in iPXE, pci_init() saves code size by assuming that the caller has already zeroed the underlying storage (e.g. as part of zeroing a larger containing structure). There are several places within the code where pci_init() is deliberately used to initialise a transient struct pci_device without zeroing the entire structure, because the calling code knows that only the PCI bus:dev.fn address is required to be initialised (e.g. when reading from PCI configuration space). Ensure that using pci_init() followed by pci_read_config() will fully initialise the struct pci_device even if the caller did not previously zero the underlying storage, since Coverity reports that there are several places in the code that rely upon this. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-16[image] Do not clear current working URI when executing embedded imageMichael Brown1-2/+5
Embedded images do not have an associated URI. This currently causes the current working URI (cwuri) to be cleared when starting an embedded image. If the current working URI has been set via a ${next-server} setting from a cached DHCP packet then this will result in unexpected behaviour. An attempt by the embedded script to use a relative URI to download files from the TFTP server will fail with the error: Could not start download: Operation not supported (ipxe.org/3c092083) Rerunning the "dhcp" command will not fix this error, since the TFTP settings applicator will not see any change to the ${next-server} setting and so will not reset the current working URI. Fix by setting the current working URI to the image's URI only if the image actually has an associated URI. Debugged-by: Ignat Korchagin <ignat@cloudflare.com> Originally-fixed-by: Ignat Korchagin <ignat@cloudflare.com> Tested-by: Ignat Korchagin <ignat@cloudflare.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-15[console] Fix definition of unreachability for remapped keysMichael Brown19-23/+137
The AltGr remapping table is constructed to include only keys that are not reachable after applying the basic remapping table. The logic currently fails to include keys that are omitted entirely from the basic remapping table since they would map to a non-ASCII character. Fix this logic by allowing the remapping tables to include null mappings, which are then elided only at the point of constructing the C code fragment. Reported-by: Christian Nilsson <nikize@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-15[console] Add Swedish "se" keymapMichael Brown1-0/+53
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-15[build] Avoid invoking genkeymap.py via PerlMichael Brown2-1/+2
The build process currently invokes the Python genkeymap.py script via the Perl executable. Strangely, this appears to work. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-15[console] Ensure that all ASCII characters are reachable in all keymapsMichael Brown1-0/+6
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-15[console] Remove "az" keymapMichael Brown1-40/+0
The "az" keymap has several unreachable ASCII characters, with no obvious closest equivalent keys. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-15[console] Fix unreachable characters in "mt" keymapMichael Brown2-1/+5
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-15[console] Fix unreachable characters in "il" keymapMichael Brown2-0/+7
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-15[console] Treat dead keys as producing their ASCII equivalentsMichael Brown15-7/+61
Treat dead keys in target keymaps as producing the closest equivalent ASCII character, since many of these characters are otherwise unrepresented on the keyboard. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-15[console] Support AltGr to access ASCII characters via remappingMichael Brown37-5/+332
Several keyboard layouts define ASCII characters as accessible only via the AltGr modifier. Add support for this modifier to ensure that all ASCII characters are accessible. Experiments suggest that the BIOS console is likely to fail to generate ASCII characters when the AltGr key is pressed. Work around this limitation by accepting LShift+RShift (which will definitely produce an ASCII character) as a synonym for AltGr. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-15[console] Centralise handling of key modifiersMichael Brown6-37/+116
Handle Ctrl and CapsLock key modifiers within key_remap(), to provide consistent behaviour across different console types. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-15[console] Allow for named keyboard mappingsMichael Brown33-130/+373
Separate the concept of a keyboard mapping from a list of remapped keys, to allow for the possibility of supporting multiple keyboard mappings at runtime. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-14[tables] Add ability to declare static table start and end markersMichael Brown1-0/+27
The compound statement expression within __table_entries() prevents the use of top-level declarations such as static struct thing *things = table_start ( THINGS ); Define TABLE_START() and TABLE_END() macros that can be used as: static TABLE_START ( things_start, THINGS ); static struct thing *things = things_start; Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-10[console] Handle remapping of scancode 86Michael Brown28-6/+93
The key with scancode 86 appears in the position between left shift and Z on a US keyboard, where it typically fails to exist entirely. Most US keyboard maps define this nonexistent key as generating "\|", with the notable exception of "loadkeys" which instead reports it as generating "<>". Both of these mapping choices duplicate keys that exist elsewhere in the map, which causes problems for our ASCII-based remapping mechanism. Work around these quirks by treating the key as generating "\|" with the high bit set, and making it subject to remapping. Where the BIOS generates "\|" as expected, this allows us to remap to the correct ASCII value. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-10[console] Update genkeymap to work with current databasesMichael Brown25-485/+434
Rewrite genkeymap.pl in Python with added sanity checks, and update the list of keyboard mappings to remove those no longer supported by the underlying "loadkeys" tool. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-10[efi] Support keyboard remapping via the EFI consoleMichael Brown1-0/+8
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-10[usb] Handle upper/lower case and Ctrl-<key> after applying remappingMichael Brown1-6/+11
Some keyboard layouts (e.g. "fr") swap letter and punctuation keys. Apply the logic for upper and lower case and for Ctrl-<key> only after applying remapping, in order to handle these layouts correctly. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-10[usb] Support keyboard remapping via the native USB keyboard driverMichael Brown1-0/+5
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-10[console] Avoid attempting to remap numeric keypad on BIOS consoleMichael Brown1-3/+18
To minimise code size, our keyboard mapping works on the basis of allowing the BIOS to convert the keyboard scancode into an ASCII character and then remapping the ASCII character. This causes problems with keyboard layouts such as "fr" that swap the shifted and unshifted digit keys, since the ASCII-based remapping will spuriously remap the numeric keypad (which produces the same ASCII values as the digit keys). Fix by checking that the keyboard scancode is within the range of keys that vary between keyboard mappings before attempting to remap the ASCII character. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-10[console] Generalise bios_keymap() as key_remap()Michael Brown3-17/+55
Allow the keyboard remapping functionality to be exposed to consoles other than the BIOS console. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2022-02-10[efi] Enable IMAGE_GZIP by default for AArch64Michael Brown1-0/+4
AArch64 kernels tend to be distributed as gzip compressed images. Enable IMAGE_GZIP by default for AArch64 to avoid the need for uncompressed images to be provided. Originally-implemented-by: Alessandro Di Stefano <aleskandro@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>