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>
This patch adds boot menu support to SLOF. When boot menu is enabled from qemu
commandline with '-boot menu=on', on pressing F12 key it displays the list of
devices to boot from and waits for user's input. This is in line with x86 qemu
bios feature.
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Include DHCPARCH define in the FLAG variable
Set the flag, so that dhcp request would contain DHCPARCH
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Current code only works with 512 bytes read.
Moreover, Qemu ignores the guest set features request. In the set
features request SLOF indicates to qemu that it is not support
VIRTIO_BLK_F_BLK_SIZE feature. Code in qemu suggests that virtio-blk
is not implementing set_guest_feature.
Tested-by: Bharata B Rao <bharata@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
This patch removes some code that is obsolete and completely unused
nowadays.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
DMA alloc/mapping functions needs to be used by pci generic bridge as well.
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
When using multiple e1000 network interface netboot would fail if we
try to boot from the first interface.
During first e1000 device initialization, m_e1k.m_baseaddr_u64 (static
variable) is set to read/write pci registers. Later the second device
does process. When first e1000 driver tries netboot, it has an
assumption that m_e1k.m_baseaddr_u64 is correct, which is not the
case.
Ensure reinitialization for m_e1k.m_baseaddr_u64 when open interface
of device is called.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@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>
commit 66119a19 changed the stack representation of go-64 calls, this
call site needs update as well. r12 is not passed as an argument
anymore.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Qemu can create console-less machine, aka no output device. And there
are dependencies in the guest which expects a valid output device. Add
this dummy device that gobbles up all the output send, and keeps the
guest happy.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
alloc-mem in SLOF does not always return aligned values it
seems, so we need to align it manually. While messing around I
hit a case where after a close and re-open via the client interface
vscsi would fail to initialize without this fix.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[ free the allocated size ]
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
The virtio device shutdown method is called during quiesce in order to
reset the device. This implies writing to the I/O region of the device
and this only makes sense if the device is opened, otherwise we hit an
"unassigned write" handler in qemu.
This happens for example while booting a guest from a virtio-blk or
virtio-scsi device, when the guest kernel reaches the end of prom_init().
Reported-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
add-quiesce-xt adds a different method virtio-scsi-shutdown which is not intended to
be added, since the intended method shares the same name with the un-intended one.
This makes call to the wrong method with wrong parameter which makes it unable to reset
virtion-scsi device during quiesce. This patch fixes this by renaming the method name.
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
--
v2: With the parameters changed for go-64, kernel loading from commandline broke
v3: (client-exec) calls start-elf64 directly, fix args
Hypercall for ibm,client-architecture-support could return
nodes that isn't there in the guest DT, in such cases error should
be returned to the guest kernel.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
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>
The print_version() is jumping through hoops to get back to where
it was called from, though it actually does get called with "bl"
already, so it knows.
Just return to where we came from after print_version(), making it
a function we can call from other places in the code.
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>
This patch generaliazes the device alias name enumeration for all scsi disks, virtio-blk
disks and network devices.
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
QEMU supports a bootindex property for every device in the command line.
With the respective support from the QEMU side, this change is enough
to make SLOF go through the list and try to boot.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
drmgr expects ibm,my-drc-index and ibm,loc-code OF properties in
the corresponding device tree node to determine whether a
pre-populated slot is hotpluggable/unpluggable. This is also
stated as a boot-time requirement for DR-capable devices in SPAPR,
though it does not specify there how these entries are to be generated.
In the case of QEMU, hotpluggable slots are allocated entries based on
bus/slotno values, so we can determine these entries statically at
boot-time, rather than relying on RTAS calls as we would during
OS-driven configuration.
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
While netbooting with yaboot, code was failing at
dma-map-out.
Remember my-handle and store for further reference,
which is needed for dma-map-out during close. yaboot for
some reason does not set the current-node while calling
close.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
So if there is no boot order from qemu, nvram, the default
boot order will be to try from "disk" aliases, "cdrom" aliases
and lastly "net" aliases
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
PCI window bars sometimes returns 0 as the a start address. This will
be used by the allocator. Devices or Software can take it as null
address.
Mark 0 address as always allocated during initialization.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Currently we only boot from " disk" and " cdrom", we can do better by
iterating through the diskN/cdromN aliases created during disk probing.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Current fdt.fs takes device-tree start address from fdt-start,
this needs to be made generic for parsing device tree at later
point
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
When multiple clients are active simultaneously, they might open network
devices that is already opened by other clients. This results in failure
to transfer packets since obp-tftp package is not instantiated on each open.
This patch resolves it by instantiating obp-tftp on each open.
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
The previous scheme always put 0 as a parent slot#. However it is
not always the case and QEMU's PCI bridge does not support putting
device at slot#0 as it claims SHPC support for hotplug.
This modifies the interrups map to let the linux guest resolve XICS
global interrupt number correctly.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
The driver has been moved to libvirtio
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
* Build fixes to include scsi files
* Move usb-setup-hcidev out of board-qemu
* Fix pci-bridge-probe to assign temporary ranges
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
We had lots of duplication of code between root.fs and fdt.fs
The reason we didn't use root.fs in the first place is that it tried
to create the root node and the chosen node which we already have via
the fdt.
Instead, modify root.fs to check for their presence and only "extend"
them in that case.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Support for usb generic hub driver.
Todo: Detect disconnects and remove device
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Portions of keyboard driver(usb-key.h and usb-hid.c) inherited from
code originally written by former SLOF team
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
* Configures the newly found usb devices.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Fixes-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>