Commit Graph

725 Commits

Author SHA1 Message Date
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
Alexey Kardashevskiy a9958ef37d version: update
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2014-01-21 20:17:39 +11:00
Avik Sil a7e87e0b63 Reset obp-tftp arguments before parsing
This avoids junk values assigned to obp-tftp arguments

Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
2014-01-20 17:19:47 +05:30
Avik Sil d81ffe71db Enable seamless netboot on IPv6 network
To boot from an IPv6 network user has to type "boot net:ipv6" from SLOF prompt. This
is inconvenient in auto-install environment. This patch addresses this issue by falling
back to IPv6 booting in case IPv4 booting fails (No DHCPv4 response).

Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
2014-01-20 17:19:47 +05:30
Nikunj A Dadhania a8c1a27c16 Fix shutdown for virtio devices
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-01-20 17:19:47 +05:30
Avik Sil eab9584a40 Fix zero checksum in UDP header
As per RFC 768 (UDP), if the computed checksum  is zero, it is transmitted as all ones
(the equivalent in one's complement arithmetic).

Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-01-20 17:19:47 +05:30
Avik Sil 0852f3807f Handle router advertisement message properly
process_ra_options was going through infinite loop due to improper handling of option_length.
Also introduction of is_ra_received() makes booting time faster since it returns as soon as
router advertisement mesage is received.

Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-01-20 17:19:47 +05:30
Nikunj A Dadhania 673997ee74 [oex]hci_exit: Check before freeing/unmapping memory
While doing cleanup of the allocated memory, make sure addresses being
unmapped/free were really allocated. During error conditions, some
address would not have been.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2014-01-20 17:19:47 +05:30
Alexander Graf dd53579ae8 Work around missing sc 1 traps on pHyp
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>
2013-12-17 11:01:46 +05:30
Alexander Graf 69c6fc492c fix print_version() to return where it came from
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>
2013-12-16 17:04:26 +05:30
Nikunj A Dadhania 8281a9333c usb-xhci: memory freeing and using returns as bool uniformly
* Fix freeing of memory in error path
* Boolean and int were used interchangebly at various points,
  consolidate it to use boolean

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-12-16 15:40:04 +05:30
Nikunj A Dadhania 79f0600b9a Output banner and initial display output in VNC window
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>
2013-12-16 11:56:42 +05:30
Alexey Kardashevskiy e086e9992c use VERSION file to generate FW version
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2013-12-09 20:23:28 +11:00
Alexey Kardashevskiy 5354659cf5 cas: remove warning
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>
2013-12-09 12:21:39 +05:30
Anton Blanchard 7d0c284328 Add support for loading little endian ELF binaries.
We byte swap the entire header in place in elf_check_file.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-12-06 16:30:34 +05:30