Age | Commit message (Collapse) | Author | Files | Lines |
|
Every caller of SLOF_alloc_mem_aligned() assumes the size is the first
argument while it is not.
This switches align and size and fixes random memory corruptions.
This is grep for SLOF_alloc_mem_aligned with this patch applied:
include/helpers.h|27| extern void *SLOF_alloc_mem_aligned(long size, long align);
lib/libveth/veth.c|103| buffer_list = SLOF_alloc_mem_aligned(8192, 4096);
lib/libveth/veth.c|105| rx_queue = SLOF_alloc_mem_aligned(rx_queue_len, 16);
lib/libvirtio/virtio-net.c|101| vq[i].desc = SLOF_alloc_mem_aligned(virtio_vring_size(vq[i].size), 4096);
slof/helpers.c|70| void *SLOF_alloc_mem_aligned(long size, long align)
Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
|
|
The "Open Firmware Recommended Practice: 16-color Text Extension"
document specifies how the first 16 colors of a palette should be
set. So let's use these colors in SLOF, too.
Also move the function for initializing the palette into the
common graphics.fs file so that we do not have to do this change
twice.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
draw-rectangle, fill-rectangle and read-rectangle were only working
with 8-bit color depth displays so far. This is fixed now for 16-bit,
24-bit and 32-bit color depths, too, by taking the "screen-depth"
into account.
And while we're at it, consolidate all the same copies of these
functions into one common file (graphics.fs) so that we do not
have to do these modifications multiple times in different files.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
There's no need for a device_type property here, but according
to IEEE1275, it should have a "relative-addressing" propery instead.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
|
|
At the moment SLOF adds a "device_type" property automatically for
every single PCI device based on its class even if there is no SLOF
driver for such a device. OF1275 says that "device_type" is for
implemented interfaces only. A side effect of this is virtio-balloon
getting device_type=="memory" while it should not have.
This removes automatic call to device-type from the common PCI code.
Since now, we rely on existing SLOF PCI drivers to call device-type if
needed. virtio-blk/net, e1000, ohci/ehci/xhci do this. virtio-scsi
does not create the property for itself but disks on its bus do.
virtio-ballon won't get the device_type property as there is no driver
for it.
While we are here, remove device-type from usb-mouse as well.
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
Changes:
v2:
* removed usb mouse as well - slof does not implement it
|
|
Add support for the new ranges property for 64bit BARs. This will
enable devices with higher BAR requirements. Currently, the device
could not get more than 256MB, as the 512MB memory range passed by
Qemu was divided between prefetchable and non-prefetchable MMIO range.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
|
|
In certain cases when a PCI device is passthru and is frozen before it
reaches SLOF. All PCI read result reading FF. This exposed a bug in
the pci scan code which would wrongly take it as a pci brigde and try
to scan devices below that and that would enter an infinite loop.
Explicitly scan for type 0/1 and rest are not supported.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
term-io-key simply did nothing when the stdin had not been set yet.
Especially, it even did not put an output item on the stack, which led
to very ugly crashes in case we dropped to the Forth prompt before
the console had been set up. Fix it by running the behaviour of the
previous key handler instead.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
Replace the warning with code comment
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>
|
|
SLES when creating an LVM, creates a boot partition with
CHRP-BOOT. This was only being handled for CDROM case. Add this for
the hard-disk as well.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
* fat16 code had old debug prints, get rid of that
* yaboot tried reading a file beyond the size of file, fix read
routine to override and read only till the file-size
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
A pci-bridge without a downstream device will end up with no memory
range allocated. For cases like hotplug, reserve some memory for the
bridge device.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
Before starting pci-bridge probing the ranges property is set to the
max limit, and then pci bridge is probed. Once the probe is over we
would update the ranges property.
In case when there is no device beyond the bridge, ranges will be null
and the code moves ahead. The actual problem here is that before
probing the bridge the ranges property was set to max limit. That
stays and cause overlapping ranges for sibling devices.
So empty the ranges property for this bridge when there is no device present.
Signed-off-by: Nikunj A Dadhania <nikunj@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>
|
|
With a generic pci bridge and a pci device on that bridge, any call to
dma functions would fail as generic pci-bridge does not support
them. This would result in TCE entries not getting populated either in
the host(vfio) or qemu.
Reviewed-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>
|
|
It is seen that guests booting in compatibility mode (like Power7)
will issue a client-architecture-service call which will result in
QEMU rebuilding the device tree. The size of the device tree to be
built, which is passed from SLOF is currently 4 kB. This is
insufficient to contain more than 48 CPU nodes. Increase this size in
SLOF so that 255 CPUs (max limit in QEMU) can be supported.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
Qemu ignores the controller type while coding the bootindex. Changing
the representation of name accordingly.
Earlier a USB controller device representation was:
/pci@800000020000000/ohci@1/usb-storage@1/disk@101000000000000
/pci@800000020000000/ehci@2/usb-storage@1/disk@101000000000000
/pci@800000020000000/xhci@3/usb-storage@1/disk@101000000000000
The patch changes this to:
/pci@800000020000000/usb@1/storage@1/disk@101000000000000
/pci@800000020000000/usb@2/storage@1/disk@101000000000000
/pci@800000020000000/usb@3/storage@1/disk@101000000000000
Controller name is preserved in " device_type" property in the node.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
Trampoline code in the LE binary were helping fix this. This patch now
takes care of switching the mode to LE for LE elf binaries.
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
|
|
Currently strings are stored in the dictionary using "string," which
stores the length as a byte. This brings in the limitation of only 255
byte string. The issue got exposed when using "boot-device" which was
more than 256 bytes, and the string length was equal to (length & 0xFF)
With this patch, we are storing the length in dictionary in a cell and
copying the string after that.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
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>
|
|
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>
|
|
Since client-architecture-support is not support by the mainline QEMU yet,
this warning might be confusing so remove it.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
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>
|
|
When passing a 1KB disk, it goes on looping inside the deblocker,
ignoring the unability of driver to read from out-of-bound blocks.
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
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>
|
|
16 is too less, push it to 256
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
* disk alias names are not correct
* also drop stack variable in case we overflow max-alias
Signed-off-by: Nikunj A Dadhania <nikunj@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>
|
|
Code still does not support xhci, disable creation of xhci node, as it
was causing crash in the quiesce path.
Also check if ops pointer is verified before accessing function
pointers during usb_hcd_exit.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
This fixed size of reading the version (which is actually 32bit), this
removes confusing "cas not implemented" message from the guest.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
Changes:
v2:
* replaced w@ (16 bit) with l@ (32 bit)
|
|
This removes dropping allocated memory buffer off the stack in the case
when no change to the tree was generated by QEMU.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
|
|
Add device tree parsing code and setting properties.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
Commit ec5c9e8b (Use root.fs on qemu as well) would set the bootargs/bootpath
to null string even in case when the /chosen node exist, the /chosen and boot
property were populated during fdt parsing so do not change in case its already
set.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
The code in close for calling quiesce looks if there is stdin and
checks whether is being closed. That condition was being used to call
quiesce.
So in case when the ihandle is not that of stdin, close-dev was missing.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
Add support for booting from a GPT partitioned disk.
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
* Add Reset Recovery procedure
* Zero cbw and csw memory everytime
* Add delays during cbw, data and csw stage
* Increment tag after every command
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
* Some usb devices do not like report-luns, assume it as single lun device
and move further.
* Make inquiry of the device first for 36bytes and then determine what
is the additional size to read.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
Use the allocator with dma-map-in so it does not create duplicate TCE
entries.
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
Without the close-dev successive ping command fails to get the arguments,
because the net device is not instantiated as the open-count is not
decremented.
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@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>
|
|
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
As per 1275 standard, canon converts the possibly ambiguous
device-specifier to a fully qualified pathname (see 6.3.2.2). It is kind
of find-alias for clients. Earlier canon implementation was not complete,
it was not at all returning the full path name. So grub was not getting
the alias path by calling canon and it was breaking.
In this patch I'm checking if the passed string is already a full path
by comparing the first character with '/'. In that case I return the
passed string as is. Otherwise I return the find-alias.
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
|
SCSI layer represents DIR as TRUE or FALSE, and for SLOF TRUE is -1
and FALSE is 0, convert that to proper direction when building the
CBW
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|