1. 28 Dec, 2018 3 commits
  2. 24 Dec, 2018 4 commits
  3. 02 Jul, 2018 3 commits
  4. 21 Jun, 2018 1 commit
  5. 07 Jun, 2018 3 commits
  6. 29 May, 2018 10 commits
  7. 25 May, 2018 2 commits
  8. 24 May, 2018 2 commits
  9. 14 May, 2018 1 commit
  10. 04 Apr, 2018 1 commit
  11. 05 Mar, 2018 1 commit
  12. 14 Dec, 2017 1 commit
  13. 13 Dec, 2017 2 commits
  14. 11 Dec, 2017 1 commit
  15. 06 Nov, 2017 5 commits
    • Alexey Kardashevskiy's avatar
      fdt: Implement "fdt-fetch" method for client interface · ecda9590
      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: default avatarAlexey 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.
      ecda9590
    • Alexey Kardashevskiy's avatar
      rtas: Store RTAS address and entry in the device tree · f8d999c7
      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: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
      ---
      Changes:
      v5:
      * ditched rtas-entry, added rtas-size (which is always 20 bytes though)
      f8d999c7
    • Alexey Kardashevskiy's avatar
      board-qemu: Fix slof-build-id length · 608e416b
      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: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
      608e416b
    • Alexey Kardashevskiy's avatar
      fdt: Pass the resulting device tree to QEMU · e6fc8465
      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: default avatarAlexey 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.
      e6fc8465
    • Alexey Kardashevskiy's avatar
      fdt: Fix version and add a word for FDT header size · 7b61ea3e
      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: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
      Reviewed-by: default avatarGreg Kurz <groug@kaod.org>
      7b61ea3e