Age | Commit message (Collapse) | Author | Files | Lines |
|
-Wextra enables a bunch of rather useful checks which this fixes.
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
|
|
This reverts commit 674d0d0cf66d4 ("rtas: Reserve space for FWNMI log")
which expanded the RTAS blob size to match the QEMU expectation about
the RTAS area available for FWNMI logs.
Instead, it relies on QEMU passing the "rtas-size" property and passes it
through untouched. This adds a check that QEMU allocated enough for
RTAS blob. This adds a fallback to the default 20 bytes "rtas-size" if
none specified by QEMU.
While we are here, replace 's" /rtas" find-node' with 'rtas-node' which
we just set above.
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
|
|
The Firmware Assisted Non-Maskable Interrupts Option (FWNMI) feature
requires some space for RTAS log which is in the RTAS blob area.
This expands the RTAS blob size to 2k.
More details here: https://patchwork.ozlabs.org/patch/1146765/
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
|
|
We implement RTAS as a simple binary blob which calls directly into QEMU
via a custom hcall. So far we were relying on QEMU putting the RTAS blob
to the guest memory with its location in linux,rtas-base/rtas-size.
The problems with this are:
1. we need to peek a location in the guest ram in addition to slof, FDT
and sometime kernel and init ram disk; having one less image makes QEMU's
life easier.
2. for secure VMs, it is yet another image which needs to be signed and
verified.
This implements "instantiate-rtas" completely in SLOF, including KVM PR
support ("broken sc1").
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
|
|
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>
|
|
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.
|
|
This reverts commits:
604d28cc3 "board-qemu: add private hcall to inform host on "phandle" update"
089fc18a9 "libhvcall: drop unused KVMPPC_H_REPORT_MC_ERR and KVMPPC_H_NMI_MCE defines"
1c17c13a5 "rtas: Improve error handling in instantiate-rtas"
f9a60de30 "Add private HCALL to inform updated RTAS base and entry"
A bigger hammer is coming soon which will pass the entire device
tree to QEMU, not just some random bits.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Greg Kurz <groug@kaod.org>
|
|
The "interrupt-map" property in each PHB node references the "phandle"
property of the "interrupt-controller" node. This is used by the guest
OS to setup IRQs for any PCI device plugged into the PHB. QEMU sets this
property to an arbitrary value in the flattened DT passed to SLOF.
Since commit 82954d4c1088, SLOF has some generic code to convert all
references to any "phandle" property to a SLOF specific value.
This is is perfectly okay for coldplug devices, since the guest OS only
sees the converted value in "interrupt-map". It is a problem though for
hotplug devices. Since they don't go through SLOF, the guest OS receives
the arbitrary value set by QEMU and fails to setup IRQs.
In order to support PHB hotplug, this patch introduces a new private
hcall, which allows SLOF to tell QEMU that a "phandle" was converted
from an old value to a new value.
Suggested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
|
|
These defines were introduced to add support for FWNMI in KVM guests. This
has been WIP since 2015 and the KVM part finally made it to kvm-ppc-next.
Latest work on the QEMU side [1] no longer needs KVMPPC_H_REPORT_MC_ERR.
The KVMPPC_HCALL_MAX define is never used anywhere, and moreover it
is bogus since there's no KVMPPC_H_NMI_MCE private hcall.
[1] http://lists.nongnu.org/archive/html/qemu-ppc/2015-12/msg00199.html
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
|
|
The code from the FAST_RFILL macro uses a local array as a
temporary buffer - which gets allocated in the stack frame
of the engine() function. Since engine() can be called
recursively, this can cause stack overflows. So let's
move the rfill code into a separate function to avoid
these problems.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
|
|
Make sure to include make.rules from the Makefiles in the common
lib folder to get some more sane console output during the build
process.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
|
|
This patch adds a private HCALL to inform qemu the updated
rtas-base and rtas-entry address when OS invokes the call
"instantiate-rtas". This is required as qemu allocates the
error reporting structure in RTAS space upon a machine check
exception and hence needs to know the updated RTAS.
Enhancements to qemu to handle the private HCALL, prepare
error log and invoke machine check notification routine
are in a separate patch.
Signed-off-by: Nikunj A. Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
Under weird circumstances we ended up with unsynchronized data and text
section references between the stage1 and paflof binaries.
This patch moves the initial sc 1 detection logic to work without any
persistent state, making it properly reentrant regardless of the place
we end up hitting the code at.
This fixes broken sc 1 detection for me on PR KVM.
Signed-off-by: Alexander Graf <agraf@suse.de>
[aik: added r0 to clobber list and $(FLAG) to AS1FLAGS as suggested by agraf, tested on pHyp]
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
|
|
When running a pseries guest in PR KVM on top of pHyp, sc 1 instructions
are handled directly by pHyp, so we don't get to see them.
That means we need to get inventive. Invent a new instruction that behaves
like sc 1, but really is a reserved instruction that traps. This instruction
can be used by KVM to emulate sc 1 behavior.
This patch adds the SLOF support for it. With this, SLOF detects whether
it's running on such a broken setup and if so patches itself to execute
the fake sc 1 instruction instead of the real one.
Furthermore, we also hook into "quiesce" which Linux calls when it boots.
This gives us the chance to also patch Linux when it boots up, so it uses
the fake sc 1 too.
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
Initial display output does not show up in the VGA/VNC window.
Create replay buffer to store the initial output and when vga/vnc
console starts, dump the buffer there.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
BenH still need to ACK this though.
From: Nikunj A. Dadhania <nikunj@linux.vnet.ibm.com>
* Determines size of the flash using device tree.
* Provides nvram access functions for RTAS_NVRAM
* Allocates temporary buffer of nvram in SLOF code and use that in C.
(sbrk not available)
* NVRAM_LENGTH is used at various places, make sure it is well guarded
and also use dynamically determined size once an RTAS-NVRAM is
found.
* Use NVRAM_LENGTH as a variable in case of RTAS_NVRAM, not very
elegant though
Signed-off-by: Nikunj A. Dadhania <nikunj@linux.vnet.ibm.com>
--
Changelog from v1:
* #define cleanups suggested by Thomas/Benh
* Fix makefile which missed passing $FLAG for building llfw
* renamed vio-nvram.fs as rtas-nvram.fs
|
|
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
We don't support 8-bytes PIO
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Currently the hvterm routines always use termno=0. This works because
QEMU has code that recognies termno=0 and chooses a "default" vty.
It would be more correct if the hvterm routines took the termno as an
argument. That way if we open a vty other than the default the output
will correctly go to that vty.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
|
|
The virtio devices are preferred way of providing virtualized devices on
KVM/qemu. Here's now the basic support for virtio block devices.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
|
|
H_PUT_TCE is needed for getting the DMA transfers working in the virtual
environment.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
|
|
Implemented the CI functions in cache.h (which are required by net-snk)
and fixed a bug in hv_logical_ci_store in libhvcall.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
|
|
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
|
|
Added a new board for SLOF running on KVM/qemu.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
|