Commit Graph

389 Commits

Author SHA1 Message Date
Nikunj A Dadhania 1c17c13a57 rtas: Improve error handling in instantiate-rtas
Error handling, even when the call is not implemented,
code was printing failed.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-10-29 15:59:24 +05:30
Alexey Kardashevskiy 5cb3875785 version: update to 20140827 2014-08-27 15:57:34 +10:00
Nikunj A. Dadhania f9a60de304 Add private HCALL to inform updated RTAS base and entry
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>
2014-08-27 11:10:45 +05:30
Nikunj A Dadhania 706c69e46b xhci: fix port assignment
Port assignment logic was generating negative port number

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-07-17 12:43:29 +05:30
Nikunj A Dadhania f284ab3f03 version: update to 20140630 2014-06-30 12:19:36 +05:30
Nikunj A Dadhania e748fc4a37 Quieten the grub warning
Replace the warning with code comment

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-06-26 12:13:59 +05:30
Avik Sil 6180178869 Add boot menu support
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>
2014-06-13 12:33:54 +05:30
Nikunj A Dadhania f1c40e50b5 boot from disk having chrp-boot file
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>
2014-06-13 12:33:54 +05:30
Nikunj A Dadhania 4034b51fa0 fat16: fix read and remove debug messages
* 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>
2014-06-13 12:33:54 +05:30
Nikunj A Dadhania ac72005f77 version: update to 20140613 2014-06-13 00:22:04 +05:30
Nikunj A Dadhania 7fb8bdae84 dhcparch define missing in compilation
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>
2014-06-12 23:57:12 +05:30
Nikunj A Dadhania f4d823ffab version: update to 20140514 2014-05-14 16:43:26 +05:30
Nikunj A Dadhania e53c254178 pci-scan: reserve memory for pci-bridge without devices
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>
2014-05-14 16:29:40 +05:30
Nikunj A Dadhania 7cc0b6c5ce pci-bridge: Fix ranges when no device beyond the bridge
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>
2014-05-14 15:39:24 +05:30
Nikunj A Dadhania 3780818370 version: update to 20140429
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-04-29 13:48:55 +05:30
Nikunj A Dadhania 95bc88c53b Set dhcp arch in board-qemu config file
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-04-29 10:19:59 +05:30
Nikunj A Dadhania c228e9f9e4 version: update to 20140428
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-04-28 10:13:45 +05:30
Nikunj A Dadhania 49976ab5e7 xhci: fix controller stop
A bit operation bug left the controller in the running state causing
PCI EEH in the host when using pci-passthru for USB3 device.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-04-25 15:40:13 +05:30
Blake Rouse 37826933b2 dhcp: support client architecture code 93
Added support for the DHCP request to include the code 93 architecture
code. This is needed so the responding dhcp server, knows what
filename it should return for the system to netboot. Set the
qemu-board DHCPARCH type to 0x0c which is the correct value for slof.

Signed-off-by: Blake Rouse <blake.rouse@canonical.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-04-25 15:40:13 +05:30
Nikunj A Dadhania c365fe0393 virtio-blk: support variable block size
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>
2014-04-25 15:40:13 +05:30
Nikunj A Dadhania 4a53254d43 usb: use common pci dma alloc/mapping routines
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-04-25 15:40:13 +05:30
Thomas Huth e1b7b85031 Remove unused SLOF code
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>
2014-04-25 15:40:12 +05:30
Nikunj A Dadhania cc0a685057 pci-bridge: generic bridge needs to support pci dma functions
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>
2014-04-25 15:40:12 +05:30
Nikunj A Dadhania 1f30b24cb6 pci: extract dma functions as separate file
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>
2014-04-25 15:40:02 +05:30
Alexey Kardashevskiy c1ed2be8aa version: update to 20140415
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2014-04-15 19:09:47 +10:00
Nikunj A Dadhania cce8657eaa e1000: fix usage of multiple nics
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>
2014-04-08 17:45:09 +05:30
Alexey Kardashevskiy c90b50b505 version: update to 20140404
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2014-04-04 11:45:14 +11:00
Alexander Graf 9a44f99fa4 Isolate sc 1 detection logic
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>
2014-04-04 11:42:20 +11:00
Alexey Kardashevskiy 1e0ab50668 version: update to 20140331
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>

s Please enter the commit message for your changes. Lines starting
2014-03-31 14:33:01 +11:00
Nikunj A Dadhania 8415208ae4 build: auto-detect ppc64 architecture
Remove the silliness of running make on powerpc like this;

$ CROSS= make

The default value of CROSS prevented this, detect the architecture in
the makefile and sent the CROSS accordingly.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-03-27 15:55:15 +05:30
Nikunj A Dadhania 5635b6cc92 cas: increase hcall buffer size to accomodate 256 cpus
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>
2014-03-27 15:48:04 +05:30
Nikunj A Dadhania d2a8113c78 usb: change device tree naming
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>
2014-03-26 11:34:00 +05:30
Nikunj A Dadhania a6c2d4cfd2 usb-core: adjust port numbers in set_address
There is a mismatch between the port number between qemu and slof. Was
unearthed while using bootindex.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-03-26 10:10:48 +05:30
Nikunj A Dadhania e59d25edd0 virtio-scsi: correct srplun comment
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-03-19 13:50:11 +05:30
Alexey Kardashevskiy 70ac40369f version: update to 20140318
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2014-03-18 20:17:15 +11:00
Nikunj A Dadhania 34db0f6e27 Fix kernel loading
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>
2014-03-18 20:17:15 +11:00
Avik Sil 259f8bcba8 Workaround to make grub2 assign server ip from dhcp ack packet only
Sometimes the bootp reply message from a dhcp nak packet is passed to bootloader
(grub2) through "bootp-response" property. Grub2 does not verify if it is an
ack or nak packet and goes on picking up the server ip address from the message.
This makes grub2 unable to make further communication. The workaround here is
made to avoid this situation by copying the bootp reply message only when it is
from dhcp ack packet.

Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-03-18 17:06:49 +11:00
Nikunj A Dadhania c3d633a044 ELF: Enter LE binary in LE mode
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>
2014-03-18 17:06:47 +11:00
Nikunj A Dadhania 4099049c25 ELF loading should fail for virt != phys
Prevent loading of elf files which does not have virtual address same
as physical address.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-03-18 17:06:37 +11:00
Alexey Kardashevskiy af6b7bf587 version: update to 20140304
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2014-03-04 12:52:03 +11:00
Nikunj A Dadhania 5ea509fd12 Introduce dummy console device
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>
2014-03-04 12:52:03 +11:00
Benjamin Herrenschmidt ae98d1464c vio-vscsi: Fix CRQ allocation alignment
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>
2014-03-04 12:52:03 +11:00
Alexey Kardashevskiy 10306b50d9 version: update to 20140204
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2014-02-04 19:51:10 +11:00
Nikunj A Dadhania 9cd415f87a virtio-9p: disable unused structure
In file included from ./board.code:140:0,
                 from /home/nikunj/work/power/code/slof/SLOF/slof/paflof.c:106:
/home/nikunj/work/power/code/slof/SLOF/slof/paflof.c: In function ‘engine’:
/home/nikunj/work/power/code/slof/SLOF/lib/libvirtio/virtio-9p.h:23:3: warning: typedef ‘virtio_9p_config_t’ locally defined but not used [-Wunused-local-typedefs]
 } virtio_9p_config_t;

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-02-04 19:49:46 +11:00
Avik Sil 479f0387f9 Make "boot net:dhcp" boot from IPv4 only
The default network boot method "boot net" tries to boot from both IPv4 and IPv6
networks. The "boot net:ipv6" allows to boot from IPv6 network only. But there
is no option for booting from IPv4 network only. This patch addresses this issue.

Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-02-04 19:49:46 +11:00
Avik Sil 020220e637 Fix virtio device shutdown
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>
2014-02-04 19:49:46 +11:00
Avik Sil 295a033a25 Change shutdown method name for virtio-scsi
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>
2014-02-04 19:49:46 +11:00
Nikunj A Dadhania c2358afb40 Add support for 64bit LE ABI v1 and v2 support
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
2014-02-04 19:49:46 +11:00
Nikunj A Dadhania 41a3405503 Change representation of string environment variable
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>
2014-02-04 19:49:46 +11:00
Nikunj A Dadhania 51802b3dc9 cas: return error when unknown node found
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>
2014-02-04 19:49:46 +11:00