- 28 Dec, 2018 3 commits
-
-
Aurelien Jarno authored
-
Aurelien Jarno authored
Bump debhelper compat 10. This requires to undefine CFLAGS and LDFLAGS as the default flags are not usable to build a firmware.
-
Aurelien Jarno authored
-
- 24 Dec, 2018 4 commits
-
-
Aurelien Jarno authored
-
Aurelien Jarno authored
-
Aurelien Jarno authored
-
Aurelien Jarno authored
-
- 02 Jul, 2018 3 commits
-
-
Alexey Kardashevskiy authored
This is aimed to go to QEMU v3.0. Compared to 20180621, this fixes a couple issues related to gcc8.1. Signed-off-by:Alexey Kardashevskiy <aik@ozlabs.ru>
-
Thomas Huth authored
When compiling with a very recent toolchain, I get these warnings: ../../llfw/boot_abort.S: Assembler messages: ../../llfw/boot_abort.S:76: Warning: invalid register expression and: stage2_head.S: Assembler messages: stage2_head.S:57: Warning: invalid register expression The first one is using the wrong opcode, we should use "and" instead of "andi" here. The second one is using a register instead of a constant for load-immediate, which is non-sense, too. Fix it to use the right constant instead. Signed-off-by:
Thomas Huth <thuth@redhat.com> Reviewed-by:
Laurent Vivier <lvivier@redhat.com> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
Thomas Huth authored
When compiling SLOF with GCC 8.1, I currently get a lot of these errors: ERROR: Unhandled relocation (A) type 26 Type 26 is the "relative 32-bit" relocation. We can simply ignore it (like the other relative relocations - REL14, REL24 and REL64) to shut up these error messages. Signed-off-by:
Thomas Huth <thuth@redhat.com> Reviewed-by:
Laurent Vivier <lvivier@redhat.com> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
- 21 Jun, 2018 1 commit
-
-
Alexey Kardashevskiy authored
This is aimed to go to QEMU v3.0. Signed-off-by:Alexey Kardashevskiy <aik@ozlabs.ru>
-
- 07 Jun, 2018 3 commits
-
-
Thomas Huth authored
There are two small bugs in the pxelinux.cfg parser: 1. If the file does not end with a '\n', the code set 'eol = cfg + cfgsize' and later wrote a NUL character to *eol, i.e. it wrote the NUL character beyond the end of the buffer. We've got to use 'eol = cfg + cfgsize - 1' instead. 2. The code always replaced the last byte of the buffer with a NUL character to get a proper termination. If the config file ends with a required character (e.g. the last line is a KERNEL or INITRD line and the file does not have a '\n' at the end), the last character got lost. Move the obligation for the terminating NUL character to the caller instead so that we can be sure to have a proper terminated buffer in pxelinux_parse_cfg() without the need to blindly overwrite the last character here. Reviewed-by:
Greg Kurz <groug@kaod.org> Signed-off-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
Thomas Huth authored
The pxelinux_load_cfg() function always tried to load one byte less than its parameter said (so that we've got space for a terminating NUL-character later). This is not very intuitive, let's better ask for one byte less when we call the function. While we're at it, add a sanity check that the function really did not load more bytes than requested. Signed-off-by:
Thomas Huth <thuth@redhat.com> Reviewed-by:
Greg Kurz <groug@kaod.org> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
Thomas Huth authored
... useful for "this should never happen" situations, where you want to make sure that it really never happens. Signed-off-by:
Thomas Huth <thuth@redhat.com> Reviewed-by:
Greg Kurz <groug@kaod.org> [aik: removed extra ';' and empty line] Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
- 29 May, 2018 10 commits
-
-
Thomas Huth authored
Retrieve the UUID from the device tree and pass it to the pxelinux.cfg function, so that we can look there for UUID-based file names, too. Signed-off-by:
Thomas Huth <thuth@redhat.com> [aik: removed trailing space] Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
Thomas Huth authored
We will need to retrieve the UUID of the VM in the libnet code, so we need a function to get the contents from a device tree property. Signed-off-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
Thomas Huth authored
There are two dedicated DHCP options for loading PXELINUX config files, option 209 (config file name) and 210 (path prefix). We should support them, too, in case some users want to configure their boot flow this way. See RFC 5071 and the following URL for more details: https://www.syslinux.org/wiki/index.php?title=PXELINUX#DHCP_options Unlike most other strings in libnet, I've chosen to not use fixed-size arrays for these two strings, but to allocate the memory via malloc here. We always have to make sure not to overflow the stack in Paflof, so adding 2 * 256 byte arrays to struct filename_ip sounded just too dangerous to me. Signed-off-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
Thomas Huth authored
In case the normal network loading failed, try to load a pxelinux.cfg config file. If that succeeds, load the kernel and initrd with the information that could be found in this file. Signed-off-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
Thomas Huth authored
Booting a kernel via pxelinux.cfg files is common on x86 and also with ppc64 bootloaders like petitboot, so it would be nice to support this in SLOF, too. This patch adds functions for downloading and parsing such pxelinux.cfg files. See this URL for more details on pxelinux.cfg: https://www.syslinux.org/wiki/index.php?title=PXELINUX Signed-off-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
Thomas Huth authored
This way we can easily re-use the rc --> string translation in later patches. Reviewed-by:
Greg Kurz <groug@kaod.org> Signed-off-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
Thomas Huth authored
Code has been taken from the sprintf() function (which is almost the same, except that snprintf calls vsnprintf instead of vsprintf internally). Signed-off-by:
Thomas Huth <thuth@redhat.com> [aik: fixed traling spaces] Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
Thomas Huth authored
When we will support loading of pxelinux.cfg files later, we have to call the tftp load function multiple times from different places. To avoid that we've also got to pass around the ip_version information via function para- meters to all spots, let's rather put it into struct filename_ip instead since we've got this struct filename_ip info available everywhere already. While we're at it, also drop the __attribute__((packed)) from the struct. The struct is only used internally, without exchanging it with the outside world, so the attribute is certainly not necessary here. Signed-off-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
Laurent Vivier authored
Signed-off-by:
Laurent Vivier <lvivier@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
Laurent Vivier authored
We can select the console output, but it does not really work Implement term-io-emit, as we have term-io-key to really send characters to the output selected by stdout. Resolve xt and ihandle in the output command. Use them in the new term-io-emit function. Signed-off-by:
Laurent Vivier <lvivier@redhat.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> [aik: fixed commit log] Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
- 25 May, 2018 2 commits
-
-
Thomas Huth authored
The obp-tftp package is currently using an arbitrary large value as maximal load size. If the downloaded file is big enough, we can easily erase Paflof in memory this way. Let's make sure that this can not happen by limiting the size to the amount of memory below the Paflof binary (which is close to the end of the RAM) in case of board-qemu, or the amount of memory between the minimum RAM size and the load-base on board-js2x. Signed-off-by:
Thomas Huth <thuth@redhat.com> Reviewed-by:
Greg Kurz <groug@kaod.org> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
Thomas Huth authored
The blocksize is hard-coded to 1428 bytes in obp-tftp.fs, so instead of hardcoding this in the Forth code, we could also move this into tftp.c directly instead. A similar condition exists with the huge-tftp-load parameter. While this non-standard variable could still be changed in the obp-tftp package, it does not make much sense to set it to zero since you only lose the possibility to do huge TFTP loads with index wrap-around in that case. Signed-off-by:
Thomas Huth <thuth@redhat.com> Reviewed-by:
Greg Kurz <groug@kaod.org> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
- 24 May, 2018 2 commits
-
-
Thomas Huth authored
POSIX says that the free() function should simply do nothing if a NULL pointer argument has been specified. So let's be a little bit more compliant in our libc and add a NULL pointer check here, too. Reviewed-by:
Greg Kurz <groug@kaod.org> Signed-off-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
Thomas Huth authored
This function will be used in one of the next patches to find the last slash in a file name string. Reviewed-by:
Greg Kurz <groug@kaod.org> Signed-off-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
- 14 May, 2018 1 commit
-
-
Thomas Huth authored
For some strange reasons, the libnet code is using int8_t arrays for strings in a couple of places where it really does not make any sense. Therefor a lot of "(char *)" casts are needed when the code is using the string functions from the libc. Let's change the strings to use "char" instead of "int8_t" so we can get rid of a lot of these casts. Signed-off-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
- 04 Apr, 2018 1 commit
-
-
Nikunj A Dadhania authored
Recently, found that when DAWR was disabled by linux kernel, the hcall started returning H_UNSUPPORTED, and VM did not boot up as broken_sc1 patched up SC calls falsely. Instead of checking for various returns, check if its not in privilege mode and patch sc1 in that case. CC: Michael Ellerman <michael@ellerman.id.au> CC: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by:
Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
- 05 Mar, 2018 1 commit
-
-
Nikunj A Dadhania authored
Linux kernel commit 2a9d832cc9aae21ea827520fef635b6c49a06c6d (of: Add bindings for chosen node, stdout-path) deprecated chosen property "linux,stdout-path" and "stdout". Check for new property "stdout-path" first and as a fallback check "linux,stdout-path". This older property can be deprecated after 5 years. Signed-off-by:
Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
- 14 Dec, 2017 1 commit
-
-
Alexey Kardashevskiy authored
This is aimed to go to QEMU v2.12. Signed-off-by:Alexey Kardashevskiy <aik@ozlabs.ru>
-
- 13 Dec, 2017 2 commits
-
-
Nikunj A Dadhania authored
The catpad size is 1K size, which can overflow easily with around 20 devices having bootindex. Replace usage of $cat with a dynamically allocated buffer(16K) here. Introduce new words to work on the buffer (allocate, free and concatenate) Reported here: https://github.com/qemu/SLOF/issues/3 Signed-off-by:
Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
Nikunj A Dadhania authored
We were concatenating the word " parse-load" and $bootdev list that was input to evaluate. Open code EVALUATE work such that concatenation is not required. "load" and "load-next" does not use $cat anymore. Reported here: https://github.com/qemu/SLOF/issues/3 Signed-off-by:
Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
- 11 Dec, 2017 1 commit
-
-
Thomas Huth authored
The struct contains an uneven amount of bytes, so we should use the "packed" attribute to avoid padding problems here. So far the problems did not show up yet since the struct is filled by Forth code only and QEMU seems to be quite forgiving about the length of the descriptor, but anyway, let's better be safe than sorry here. Signed-off-by:
Thomas Huth <thuth@redhat.com> Reviewed-by:
Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru>
-
- 06 Nov, 2017 5 commits
-
-
Alexey Kardashevskiy authored
The guest kernel fetches the device tree via the client interface, calling it for every node and property, and traversing the entire tree twice - first to build strings blob, second - to build struct blob. On top of that there is also not so efficient implementation of the "getprop" method - it calls slow "get-property" which does full search for a property. As the result, on a 256 CPU + 256 Intel E1000 virtual devices, the guest's flatten_device_tree() takes roughly 8.5sec. However now we have a FDT rendering helper in SLOF which takes about 350ms to render the FDT. This implements a client interface call to allow the guest to read it during early boot and save time. The produced DTB is almost the same as the guest kernel would have produced itself - the differences are: 1. SLOF creates an empty reserved map; the guest can easily fix it up later; 2. SLOF only reuses 40 most popular strings; the guest reuses everything it can - on a 256CPU + 256 PCI devices guest, the difference is about 20KB for 350KB FDT blob. Note, that the guest also ditches the "name" property just like SLOF does: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/powerpc/kernel/prom_init.c?h=v4.13#n2302 Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> --- If the guest tries "fdt-fetch" and SLOF does not have it, than SLOF prints an error: === copying OF device tree... fdt-fetch NOT FOUNDBuilding dt strings... Building dt structure... === and the guest continues with the old method. We could suppress SLOF error for such unlikely situation though.
-
Alexey Kardashevskiy authored
At the moment we count on the guest kernel to update or create device tree properties pointing to the instantiated RTAS copy which is not very reliable. This stores rtas-base and rtas-size in the DT at the instantiation point so later on the H_UPDATE_DT hcall can supply QEMU with an updated location of RTAS. This superseeds f9a60de3 "Add private HCALL to inform updated RTAS base and entry". Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> --- Changes: v5: * ditched rtas-entry, added rtas-size (which is always 20 bytes though)
-
Alexey Kardashevskiy authored
The existing code hardcodes the length of /openprom/model to 10 characters even though it is less than that - len("aik")==3. All 10 chars go to the device tree blob and DTC complains on such a property as there are characters after terminating null: aik@fstn1-p1:~$ dtc -f -I dtb -O dts -o dbg.dts dbg.dtb Warning (model_is_string): "model" property in /openprom is not a string This uses the real length and limits it by 10 to avoid breaking something. Since the same code parses the build id field, this moves from-cstring to a common place for both js2x and qemu boards. Signed-off-by:Alexey Kardashevskiy <aik@ozlabs.ru>
-
Alexey Kardashevskiy authored
This creates flatten device tree and passes it to QEMU via a custom hypercall right before jumping to RTAS. This preloads strings with 40 property names from CPU and PCI device nodes and the strings lookup only searches within these. Test results on a guest with 256 CPUs and 256 virtual Intel E1000 devices running on a POWER8 box: FDTsize=366024 Strings=15888 Struct=350080 Reused str=12457 242 ms A simple guest (one CPU, no PCI) with this patch as is: FDTsize=15940 Strings=3148 Struct=12736 Reused str=84 7 ms While we are here, fix the version handling in fdt-init. It only matters a little for the fdt-debug==1 case though. Signed-off-by:Alexey Kardashevskiy <aik@ozlabs.ru> --- Changes: v6: * fix memory sizes for free-mem * store correct chosen-cpu to the header (used to be just 0) * fdt-skip-string uses zcount now and works 30% faster * moved to a new file - fdt-fl.fs v5: * applied latest comments from Segher * s/fdt-property/fdt-copy-property/, s/fdt-properties/fdt-copy-properties/ * reduced the temporary buffers to 1MB each as the guest uses 1MB in total anyway * do not pass root phandle to fdt-flatten-tree, it fetches it from device-tree itself * reworked fdt-copy-properties to use for-all-words proposed by Segher v4: * reworked fdt-properties, works lot faster * do not store "name" properties as nodes have names already v3: * fixed stack handling after hcall returned * fixed format versions in both rendering and parsing paths * rebased on top of removed unused hvcalls * renamed used variables to have fdtfl- prefixes as there are already some for parsing the initial dt v2: * fixed comments from review * added strings cache * changed last_compat_vers from 0x17 to 0x16 as suggested by dwg --- I tested the blob by storing it from QEMU to a file and decompiling it.
-
Alexey Kardashevskiy authored
This fixes the version handling in fdt-init. It only matters a little for the fdt-debug==1 case though. This defines /fdth word for the FDT header size; this will be used in the next patch. Signed-off-by:
Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by:
Greg Kurz <groug@kaod.org>
-