summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [eoib] Silently ignore EoIB heartbeat packetsMichael Brown2016-03-091-0/+45
| | | | | | | | | | | Some EoIB implementations transmit a vendor-proprietary heartbeat packet on the same multicast group used to provide the EoIB broadcast domain. Silently ignore these heartbeat packets, to avoid cluttering up the network interface error statistics. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [eoib] Add Ethernet over Infiniband (EoIB) driverMichael Brown2016-03-093-0/+815
| | | | | | | | | | | | | | | | | | | | EoIB is a fairly simple protocol in which raw Ethernet frames (excluding the CRC) are encapsulated within Infiniband Unreliable Datagrams, with a four-byte fixed EoIB header (which conveys no actual information). The Ethernet broadcast domain is provided by a multicast group, similar to the IPoIB IPv4 multicast group. The mapping from Ethernet MAC addresses to Infiniband address vectors is achieved by snooping incoming traffic and building a peer cache which can then be used to map a MAC address into a port GID. The address vector is completed using a path record lookup, as for IPoIB. Note that this requires every packet to include a GRH. Add basic support for EoIB devices. This driver is substantially derived from the IPoIB driver. There is currently no mechanism for automatically creating EoIB devices. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Make IPoIB support configurable at build timeMichael Brown2016-03-093-3/+13
| | | | | | | Add a build configuration option VNIC_IPOIB to control whether or not IPoIB support is included for Infiniband devices. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ifmgmt] Include human-readable error message for configuration failureMichael Brown2016-03-081-0/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Increase number of transmit work queue entriesMichael Brown2016-03-081-2/+2
| | | | | | Avoid running out of transmit work queue entries under heavy load. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Resimplify test for received broadcast packetsMichael Brown2016-03-082-2/+5
| | | | | | | | | | | | Commit e62e52b ("[ipoib] Simplify test for received broadcast packets") relies upon the multicast LID being present in the destination address vector as passed to ipoib_complete_recv(). Unfortunately, this information is not present in many Infiniband devices' completion queue entries. Fix by testing instead for the presence of a multicast GID. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Retrieve GID flag from cached path entriesMichael Brown2016-03-081-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Add "ibstat" commandMichael Brown2016-03-085-0/+165
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Assign names to queue pairsMichael Brown2016-03-086-12/+19
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Assign names to CMRC connectionsMichael Brown2016-03-083-40/+53
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pcbios] Restrict external memory allocations to the low 4GBMichael Brown2016-03-082-85/+53Star
| | | | | | | | | | | | When running the 64-bit BIOS version of iPXE, restrict external memory allocations to the low 4GB to ensure that allocations (such as for initrds) fall within our identity-mapped memory region, and will be accessible to the potentially 32-bit operating system. Move largest_memblock() back to memtop_umalloc.c, since this change imposes a restriction that applies only to BIOS builds. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Allow for the creation of multicast groupsMichael Brown2016-03-083-11/+18
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Simplify test for received broadcast packetsMichael Brown2016-03-081-4/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Avoid unnecessary path record lookup for broadcast addressMichael Brown2016-03-081-15/+27
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Parse MLID, rate, and SL from multicast membership recordMichael Brown2016-03-083-62/+74
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Record multicast GID attachment as part of group membershipMichael Brown2016-03-083-18/+16Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Do not use GRH for local pathsMichael Brown2016-03-081-7/+6Star
| | | | | | | Avoid including an unnecessary GRH in packets sent to unicast destinations within the local subnet. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Use correct transaction identifier in CM responsesMichael Brown2016-03-083-17/+31
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Use connection's local ID as debug message identifierMichael Brown2016-03-082-25/+33
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Use "%d" as format specifier for LIDsMichael Brown2016-03-082-4/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Use "%#lx" as format specifier for queue pair numbersMichael Brown2016-03-084-12/+12
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Assign names to Infiniband devices for debug messagesMichael Brown2016-03-088-118/+140
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Add support for performing service record lookupsMichael Brown2016-03-083-1/+106
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Avoid multiple calls to ib_cmrc_shutdown()Michael Brown2016-03-081-0/+3
| | | | | | | | | | | | | | | | | | | When a CMRC connection is closed, the deferred shutdown process calls ib_destroy_qp(). This will cause the receive work queue entries to complete in error (since they are being cancelled), which will in turn reschedule the deferred shutdown process. This eventually leads to ib_destroy_conn() being called on a connection that has already been freed. Fix by explicitly cancelling any pending shutdown process after the shutdown process has completed. Ironically, this almost exactly reverts commit 019d4c1 ("[infiniband] Use a one-shot process for CMRC shutdown"); prior to the introduction of one-shot processes the only way to achieve a one-shot process was for the process to cancel itself. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Remove concept of whole-device owner dataMichael Brown2016-03-072-35/+45
| | | | | | | Remove the implicit assumption that the IPoIB protocol owns the whole Infiniband device. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Refuse to create duplicate network device namesMichael Brown2016-03-071-0/+8
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Support ioremap() for addresses above 4GB in a 64-bit buildMichael Brown2016-02-266-1/+216
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ioapi] Split ioremap() out to a separate IOMAP APIMichael Brown2016-02-269-44/+163
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Add support for running in 64-bit long modeMichael Brown2016-02-244-61/+498
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for running the BIOS version of iPXE in 64-bit long mode. A 64-bit BIOS version of iPXE can be built using e.g. make bin-x86_64-pcbios/ipxe.usb make bin-x86_64-pcbios/8086100e.mrom The 64-bit BIOS version should appear to function identically to the normal 32-bit BIOS version. The physical memory layout is unaltered: iPXE is still relocated to the top of the available 32-bit address space. The code is linked to a virtual address of 0xffffffffeb000000 (in the negative 2GB as required by -mcmodel=kernel), with 4kB pages created to cover the whole of .textdata. 2MB pages are created to cover the whole of the 32-bit address space. The 32-bit portions of the code run with VIRTUAL_CS and VIRTUAL_DS configured such that truncating a 64-bit virtual address gives a 32-bit virtual address pointing to the same physical location. The stack pointer remains as a physical address when running in long mode (although the .stack section is accessible via the negative 2GB virtual address); this is done in order to simplify the handling of interrupts occurring while executing a portion of 32-bit code with flat physical addressing via PHYS_CODE(). Interrupts may be enabled in either 64-bit long mode, 32-bit protected mode with virtual addresses, 32-bit protected mode with physical addresses, or 16-bit real mode. Interrupts occurring in any mode other than real mode will be reflected down to real mode and handled by whichever ISR is hooked into the BIOS interrupt vector table. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Rename prot_call() to virt_call()Michael Brown2016-02-224-39/+39
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Support userptr_t in 64-bit buildsMichael Brown2016-02-211-1/+23
| | | | | | | | | | | | | | In a 64-bit build, the entirety of the 32-bit address space is identity-mapped and so any valid physical address may immediately be used as a virtual address. Conversely, a virtual address that is already within the 32-bit address space may immediately be used as a physical address. A valid virtual address that lies outside the 32-bit address space must be an address within .textdata, and so can be converted to a physical address by adding virt_offset. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Mark virt_offset, text16, data16, rm_cs, and rm_ds as constantMichael Brown2016-02-211-5/+5
| | | | | | | | The physical locations of .textdata, .text16 and .data16 are constant from the point of view of C code. Mark the relevant variables as constant to allow gcc to optimise out redundant reads. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Do not preserve flags unnecessarilyMichael Brown2016-02-211-17/+11Star
| | | | | | | No callers of prot_to_phys, phys_to_prot, or intr_to_prot require the flags to be preserved. Remove the unnecessary pushfl/popfl pairs. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Add phys_call() wrapper for calling code with physical addressingMichael Brown2016-02-213-153/+212
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a phys_call() wrapper function (analogous to the existing real_call() wrapper function) for calling code with flat physical addressing, and use this wrapper within the PHYS_CODE() macro. Move the relevant functionality inside librm.S, where it more naturally belongs. The COMBOOT code currently uses explicit calls to _virt_to_phys and _phys_to_virt. These will need to be rewritten if our COMBOOT support is ever generalised to be able to run in a 64-bit build. Specifically: - com32_exec_loop() should be restructured to use PHYS_CODE() - com32_wrapper.S should be restructured to use an equivalent of prot_call(), passing parameters via a struct i386_all_regs - there appears to be no need for com32_wrapper.S to switch between external and internal stacks; this could be omitted to simplify the design. For now, librm.S continues to expose _virt_to_phys and _phys_to_virt for use by com32.c and com32_wrapper.S. Similarly, librm.S continues to expose _intr_to_virt for use by gdbidt.S. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix building on older versions of binutilsMichael Brown2016-02-192-10/+20
| | | | | | | | | | | | | Some older versions of binutils have issues with both the use of PROVIDE() and the interpretation of numeric literals within a section description. Work around these older versions by defining the required numeric literals outside of any section description, and by automatically determining whether or not to generate extra space for page tables rather than relying on LDFLAGS. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Generate page tables for 64-bit buildsMichael Brown2016-02-193-2/+197
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Prepare for long-mode memory mapMichael Brown2016-02-196-35/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bulk of the iPXE binary (the .textdata section) is physically relocated at runtime to the top of the 32-bit address space in order to allow space for an OS to be loaded. The relocation is achieved with the assistance of segmentation: we adjust the code and data segment bases so that the link-time addresses remain valid. Segmentation is not available (for normal code and data segments) in long mode. We choose to compile the C code with -mcmodel=kernel and use a link-time address of 0xffffffffeb000000. This choice allows us to identity-map the entirety of the 32-bit address space, and to alias our chosen link-time address to the physical location of our .textdata section. (This requires the .textdata section to always be aligned to a page boundary.) We simultaneously choose to set the 32-bit virtual address segment bases such that the link-time addresses may simply be truncated to 32 bits in order to generate a valid 32-bit virtual address. This allows symbols in .textdata to be trivially accessed by both 32-bit and 64-bit code. There is no (sensible) way in 32-bit assembly code to generate the required R_X86_64_32S relocation records for these truncated symbols. However, subtracting the fixed constant 0xffffffff00000000 has the same effect as truncation, and can be represented in a standard R_X86_64_32 relocation record. We define the VIRTUAL() macro to abstract away this truncation operation, and apply it to all references by 32-bit (or 16-bit) assembly code to any symbols within the .textdata section. We define "virt_offset" for a 64-bit build as "the value to be added to an address within .textdata in order to obtain its physical address". With this definition, the low 32 bits of "virt_offset" can be treated by 32-bit code as functionally equivalent to "virt_offset" in a 32-bit build. We define "text16" and "data16" for a 64-bit build as the physical addresses of the .text16 and .data16 sections. Since a physical address within the 32-bit address space may be used directly as a 64-bit virtual address (thanks to the identity map), this definition provides the most natural access to variables in .text16 and .data16. Note that this requires a minor adjustment in prot_to_real(), which accesses .text16 using 32-bit virtual addresses. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [relocate] Preserve page alignment during relocationMichael Brown2016-02-191-12/+10Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Transition to protected mode within init_librm()Michael Brown2016-02-192-107/+127
| | | | | | | | | | | | | Long-mode operation will require page tables, which are too large to sensibly fit in our .data16 segment in base memory. Add a portion of init_librm() running in 32-bit protected mode to provide access to high memory. Use this portion of init_librm() to initialise the .textdata variables "virt_offset", "text16", and "data16", eliminating the redundant (re)initialisation currently performed on every mode transition as part of real_to_prot(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Provide an abstraction wrapper for prot_callMichael Brown2016-02-1920-60/+77
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Convert prot_call() to a real-mode near callMichael Brown2016-02-1816-23/+6Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Standardise calls to prot_call()Michael Brown2016-02-182-11/+28
| | | | | | | Use the standard "pushl $function ; pushw %cs ; call prot_call" sequence everywhere that prot_call() is used. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Simplify definitions for prot_call() and real_call() stack framesMichael Brown2016-02-181-14/+17
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Use garbage-collectable section namesMichael Brown2016-02-181-20/+20
| | | | | | Allow unused sections of libprefix.o to be removed via --gc-sections. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bios] Use an 8kB stack for x86_64Michael Brown2016-02-181-1/+7
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Use garbage-collectable section namesMichael Brown2016-02-181-22/+26
| | | | | | Allow unused sections of librm.o to be removed via --gc-sections. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bios] Make uses of REAL_CODE() and PHYS_CODE() 64-bit cleanMichael Brown2016-02-185-13/+17
| | | | | | | | | | | | | | | | | | | | | | | On a 64-bit CPU, any modification of a register by 32-bit or 16-bit code will destroy the invisible upper 32 bits of the corresponding 64-bit register. For example: a 32-bit "pushl %eax" followed by a "popl %eax" will zero the upper half of %rax. This differs from the treatment of upper halves of 32-bit registers by 16-bit code: a "pushw %ax" followed by a "popw %ax" will leave the upper 16 bits of %eax unmodified. Inline assembly generated using REAL_CODE() or PHYS_CODE() will therefore have to preserve the upper halves of all registers, to avoid clobbering registers that gcc expects to be preserved. Output operands from REAL_CODE() and PHYS_CODE() assembly may therefore contain undefined values in the upper 32 bits. Fix by using explicit variable widths (e.g. uint32_t) for non-discarded output operands, to ensure that undefined values in the upper 32 bits of 64-bit registers are ignored. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Align PMM temporary decompression area to a page boundaryMichael Brown2016-02-181-6/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Align INT 15,88 temporary decompression area to a page boundaryMichael Brown2016-02-181-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Discard argument as part of return from real_call()Michael Brown2016-02-172-2/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>