Commit graph

133 commits

Author SHA1 Message Date
Benjamin Romer 18b87ed1d0 staging: unisys: move chipsetready to sysfs
Move the chipsetready proc entry to sysfs under a new directory guest. This
entry is used by Unisys application software on the guest to acknowledge
completion of specific events for integration purposes, but these
acknowledgements are not required for the guest to operate correctly.

The store function is simplified as well, to use scanf() instead of copying
the buffer and using strsep().

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-24 15:06:44 -07:00
Benjamin Romer 422af17c67 staging: unisys: move installer to sysfs and split fields
The installer entry in /proc/visorchipset/installer was composed of three
separate fields as one entry. This patch removes the proc entry and associated
functions, and creates new fields with distinct entries under sysfs in the
visorchipset/install directory. The fields are:

	textid: used to send the ID of a string that should be displayed on
		s-Par's automatic installation progress screen. Setting this
		field when not in installation mode (boottotool was set on
		the previous guest boot) has no effect.

	remaining_steps: used to set the value of the progress bar on the
		s-Par automatic installation progress screen. This field has
		no effect if not in installation mode.

	error: used to send the ID of a string that should be displayed on
		s-Par's automatic installation progress screen when an error
		is encountered during installation. This field has no effect
		if not in installation mode.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-24 15:06:44 -07:00
Erik Arfvidson cfe4571f72 staging: unisys: fix and remove virthba comments
This patch fixes formatting and cleans up unneeded comments

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-22 16:18:56 -07:00
Benjamin Romer 54b3122900 staging: unisys: move boottotool out of proc to sysfs
Move the proc entry controlling the boottotool flag to procfs. The field
appears in /sys/devices/platform/visorchipset/install/boottotool.

The boottotool flag controls s-Par behavior on the next boot of this guest.
Setting the flag will cause the guest to boot from the utility and installation
image, which will use the value in the toolaction field to determine what
operation is being requested.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-22 16:11:00 -07:00
Benjamin Romer 19f6634f41 staging: unisys: add toolaction to sysfs
Move the proc entry for controlling the toolaction field to sysfs. The field
appears in /sys/devices/platform/visorchipset/install/toolaction.

This field is used to tell s-Par which type of recovery tool action to perform
on the next guest boot-up. The meaning of the value is dependent on the type
of installation software used to commission the guest.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-22 16:11:00 -07:00
Erik Arfvidson 79014eb1f2 staging: unisys: added virthba enable_ints entry
This patch adds enable_ints entry to virthba directory

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21 14:27:34 -07:00
Erik Arfvidson 5d1501913b staging: unisys: added virthba rqwait entry
This patch adds the rqwait entry into the virthba debugfs directory

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21 14:27:34 -07:00
Erik Arfvidson d9c5607e51 staging: unisys: added virthba debugfs dir and info entry
This patch adds virthba debugfs directory and info entry

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21 14:25:17 -07:00
Erik Arfvidson 29a2600ce4 staging: unisys: remove virthba proc files
This patch removes all proc entries, directories, and functions

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-21 14:23:08 -07:00
Benjamin Romer 8a1182eb34 staging: unisys: detect controlvm channel on module load
The controlvm channel is not removable from a guest after the guest starts,
so it makes no sense to constantly check for it. Move the channel address
discovery to visorchipset_init(), and remove all of the checks for the channel
address from the rest of the module, as the module will not load if the
channel pointer is not valid.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-17 18:11:33 -07:00
Benjamin Romer 524b0b63a1 staging: unisys: simplify controlvm channel address function
There is no reason to have controlvm_get_channel_address() defined in a
separate file. Move it to visorchipset_main.c, remove the no-op functions
controlvm_init() and controlvm_deinit() from visorchipset_main.c, and remove
the controlvm.h and controlvm_direct.c files from the module.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-17 18:11:33 -07:00
Erik Arfvidson 0f9e530120 staging: unisys: added virtpci info entry
This patch adds the virtpci debugfs directory and the info entry
inside of it.

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-16 13:21:38 -07:00
Benjamin Romer 1783319f47 staging: unisys: remove proc entries from /proc/visorchipset/controlvm
Remove the code that generates proc entries for the controlVM channel.
These entries are no longer necessary for debug.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-15 21:41:36 -07:00
Erik Arfvidson 5b796fe8fc staging: unisys: remove all proc entries from virtpci
This patch removes all proc entries from virtpci

Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-08 15:39:30 -07:00
Ken Cox e4c293c9a3 Staging: unisys: Fix noderef sparse warnings in vbusdeviceinfo.h
vbuschannel_devinfo_to_string() was declared with the devinfo argument
as a pointer to __iomem space.  No callers of this function need the
__iomem space, so I removed that constraint.

Same thing goes for vbuschannel_sanitize_buffer().  It doesn't need to
operate on I/O space.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-08 15:38:47 -07:00
Ken Cox b7801a2e6b Staging: unisys: Remove ultra_vbus_init_channel function
The function ultra_vbus_init_channel() is never called since
previous server code was removed.  Remove the dead code.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-08 15:38:47 -07:00
Ken Cox 548950a261 Staging: unisys: Remove isServer arg from init_vbus_channel()
The init_vbus_channel() function is never called with the isServer
argument equal to TRUE, so just get rid of the argument altogether.
This also means that the code in the function that would be executed
in the server case can be removed since it is never executed.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-08 15:37:59 -07:00
Ken Cox 960e0a5fbb Staging: unisys: use Linux coding convention for function names
Change function names to conform to Linux kernel coding convention.
    ULTRA_VBUS_init_channel() --> ultra_vbus_init_channel()
    VBUSCHANNEL_devInfoToStringBuffer() --> vbuschannel_devinfo_to_string()
    VBUSCHANNEL_sanitize_buffer() --> vbuschannel_sanitize_buffer()
    VBUSCHANNEL_itoa() --> vbuschannel_itoa()

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-08 15:37:59 -07:00
Ken Cox 55afa336f9 Staging:unisys: Add Kconfig dependency on UNISYS_VISORUTIL to UNISYS_CHANNELSTUB
The visorchannelstub module references the variable unisys_spar_platform
which is declared in the visorutil module.  Add the proper dependency to
Kconfig to ensure that visorutil is enabled when building visorchannelstub.

This address the build error:
   drivers/built-in.o: In function `channel_mod_init':
   chanstub.c:(.init.text+0xbe24): undefined reference to `unisys_spar_platform'

Reported by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-08 15:37:59 -07:00
Ken Cox d93b88eb76 Staging: unisys Remove BROKEN from Kconfig to allow compilation
The unisys drivers now properly check to make sure they are running
on the s-Par platform before they will initialize.  This was fixed in
commit fcd0157ece so it is safe to allow the unisys drivers to be built.

This has been tested in the same qemu environment that originally
produced the panic and the kernel now runs as expected.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Tested-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26 20:16:39 -04:00
Ken Cox 836bee9eee Staging: unisys: remove references to __DATE__ and __TIME__
The use of __DATE__ and __TIME__ is no longer allowed in the kernel so this
commit removes those.  They were once useful when the drivers were being
built externally, but now that the drivers are in the kernel the use of the
macros is redundant since the kernel already has the same information
elsewhere.

In addition, using these macros breaks the build if using gcc 4.9.0

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26 20:15:27 -04:00
Paul Bolle 5573e4f615 staging: unisys: remove unused macros
The macros CONFIG_SPAR_GUEST, GUESTDRIVERBUILD, and NOAUTOVERSION are
defined in Makefiles for the Unisys SPAR driver. They are never used.
Remove the lines that define these macros.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26 20:13:40 -04:00
Masanari Iida 12df0c3542 staging: unisys: Remove trailing semicolon from macro
This patch removed trailing semicolon from macro in guestlinuxdebug.h

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 17:14:45 -07:00
Ken Cox 2079c4aaf6 Staging: unisys: visorchipset: Remove filexfer.c
There is not any code using the functionality in filexfer.c so I removed it
and filexfer.h.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 20:21:10 +09:00
Ken Cox e40d1c8ad9 Staging: unisys: Fixup sparse warnings for dereferencing noderef types.
Fixed the usage of the following so they don't try to dereference
pointers to iomem.
	CHANNEL_U64_MISMATCH
	CHANNEL_U32_MISMATCH
	wait_for_valid_guid

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 20:21:10 +09:00
Ken Cox 60e1741fc3 Staging: unisys: Remove unused macros from visorchannel/visorchannel.h
VISORCHANNEL_CHANGE_SERVER_STATE and VISORCHANNEL_CHANGE_CLIENT_STATE
are never used in any of the source so they have been removed.

VISORCHANNEL_CHANGE_CLIENT_STATE would have caused a broken kernel build
after commit  a8d7f21d, but since it was never used the kernel continued
to build.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 20:21:10 +09:00
Ken Cox 385914c39d Staging: unisys: virthba: declare virthba_queue_command as static
virthba_queue_command() is only used inside virthba.c so declare it static.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 20:21:10 +09:00
Ken Cox 3db5540dfd Staging: unisys: Fix sparse warnings
Fix sparse warnings caused by incorrect references to IO space.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 20:21:10 +09:00
Masaru Nomura e03e1e39b6 staging: unisys: visorutil: Add a blank line
Add a blank line after declarations to meet kernel coding style.

Signed-off-by: Masaru Nomura <massa.nomura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 09:56:32 -07:00
Benjamin Romer c79d84517c staging: unisys: remove remaining proc directory entries
Finally, remove /proc/uislib and all remaining, redundant entries created
under /proc/uislib/vbus.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 09:49:52 -07:00
Benjamin Romer 7ec967208d staging: unisys: move uislib/info proc entry to debugfs
Convert /proc/uislib/info to an equivalent entry under debugfs.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 09:49:52 -07:00
Benjamin Romer e564f3a07c staging: unisys: remove functions made redundant in uislib.c
The patches to move proc files have made the functions
uislib_proc_read_writeonly() and stop_chipset() redundant. Remove them.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 09:49:51 -07:00
Benjamin Romer 81d2d7de0b staging: unisys: move uislib/smart_wakeup proc entry to debugfs
Convert /proc/uislib/smart_wakeup to an equivalent entry in debugfs.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 09:49:51 -07:00
Benjamin Romer b913a2ef77 staging: unisys: move uislib/cycles_before_wait proc entry to debugfs
Convert /proc/uislib/cycles_before_wait to an equivalent entry in debugfs.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 09:49:51 -07:00
Benjamin Romer 28fa597f43 staging: unisys: move uislib/platform proc entry to debugfs
Convert /proc/uislib/platform to an equivalent entry in debugfs.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 09:49:51 -07:00
Benjamin Romer b27a00de27 staging: unisys: remove testing proc interfaces from uislib
Several proc interfaces in the uislib module were intended for debug and
testing during initial driver development. They are no longer needed, so
we should remove them from the module.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 09:45:56 -07:00
Benjamin Romer 90addb0218 staging: unisys: Replace GUID with uuid_le
This patch replaces the GUID type with uuid_le. It removes the header file
guidutils.h, updates all uses of the GUID type to uuid_le, and replaces all
function calls that used the GUID type with their uuid_le equivalents.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 09:45:15 -07:00
Ken Cox 37b7e990ff Staging: unisys: visorutil: Add MODULE_LICENSE("GPL")
The visorutil module was lacking license info.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 09:44:17 -07:00
Ken Cox fcd0157ece Staging: unisys: detect s-Par firmware
This patch adds support for detection of s-Par firmware by checking for
the hypervisor bit in the CPU capabilities, and then querying the hypervisor
ID cpuid leaf.

This functionality will be used by the unisys drivers to determine if
they are being loaded on an s-Par platform and refuse to load if no
s-Par firmware is present.

This fixes a problem reported from upstream where a panic occurs if the
unisys drivers are loaded on a non s-Par system.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Ken Cox <jkc@redhat.com>
Tested by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-18 09:44:17 -07:00
Ken Cox 87995171ac Staging: unisys: virthba: add MODULE_DEVICE_TABLE
Add x86_cpu_id struct and call to MODULE_DEVICE_TABLE so this module
will be auto loaded on boot.

Signed-off-by: Ken Cox <jkc@redhat.com>
Tested-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25 15:32:17 -07:00
Benjamin Romer f6d0c1e62b staging: unisys: fix copyright notices
This patch changes all of the various representations of the copyright symbol
to (C).

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25 15:25:40 -07:00
Masanari Iida fb90c6095f staging: unisys: Fix typo in comment and printk
Fix spelling typo in comments and printk within unisys.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25 15:25:40 -07:00
Masanari Iida 5494f95bad staging: unisys: Fix format string mismatch in virthba.c
Fix format string mismatch in info_proc_read() within virthba.c.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-25 15:25:39 -07:00
Dan Carpenter e6b1ea773e Staging: unisys: use after free in list_for_each()
These should be using the _safe version of list_for_each() because we
free the current element and it leads to a use after free bug.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-16 11:41:45 -07:00
Dan Carpenter d21bb45081 staging: unisys: use after free in error messages
We dereference "bus" when we report the error so we have to move the
kfree() down a couple lines.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-16 11:41:44 -07:00
Greg Kroah-Hartman 806192c07d Staging: unisys: mark drivers as BROKEN
Turns out these drivers like to mess around with the system even if the
hardware they control isn't present.  That's not good, and people are
starting to report lots of issues with this in their build/boot testing.

So for now, let's just mark them as BROKEN, until the code gets
converted to use the proper driver model interaction (i.e. don't do
anything until the hardware is actually found in the system.)

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Cc: Benjamin Romer <benjamin.romer@unisys.com>
Cc: David Kershner <david.kershner@unisys.com>
Cc: someone <sparmaintainer@unisys.com>
Cc: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-07 12:49:36 -07:00
Sasha Levin b0e2796029 Staging: unisys: verify that a control channel exists
The code didn't verify that a control channel exists before trying to
use it. It caused NULL ptr derefs which were easy to trigger by an
unpriviliged user simply by reading the proc file, causing:

[   68.161404] BUG: unable to handle kernel NULL pointer dereference at           (null)
[   68.162442] IP: visorchannel_read (drivers/staging/unisys/visorchannel/visorchannel_funcs.c:225)
[   68.163165] PGD 5ca21067 PUD 5ca20067 PMD 0
[   68.163712] Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
[   68.164390] Dumping ftrace buffer:
[   68.164793]    (ftrace buffer empty)
[   68.165220] Modules linked in:
[   68.165601] CPU: 0 PID: 7915 Comm: cat Tainted: G        W     3.14.0-next-20140403-sasha-00012-gef5fa7d-dirty #373
[   68.166821] task: ffff88006e8c3000 ti: ffff88005ca30000 task.ti: ffff88005ca30000
[   68.167689] RIP: visorchannel_read (drivers/staging/unisys/visorchannel/visorchannel_funcs.c:225)
[   68.168683] RSP: 0018:ffff88005ca31e58  EFLAGS: 00010282
[   68.169302] RAX: ffff88005ca10000 RBX: ffff88005ca31e97 RCX: 0000000000000001
[   68.170019] RDX: ffff88005ca31e97 RSI: 0000000000000bd6 RDI: 0000000000000000
[   68.170019] RBP: ffff88005ca31e78 R08: 0000000000000000 R09: 0000000000000000
[   68.170019] R10: ffff880000000000 R11: 0000000000000001 R12: 0000000000000001
[   68.170019] R13: 0000000000000bd6 R14: 0000000000000000 R15: 0000000000008000
[   68.170019] FS:  00007f0e8c041700(0000) GS:ffff88007be00000(0000) knlGS:0000000000000000
[   68.170019] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   68.170019] CR2: 0000000000000000 CR3: 000000006efe9000 CR4: 00000000000006b0
[   68.170019] Stack:
[   68.170019]  ffff88005ca31f50 ffff88005ca10000 000000000060e000 ffff88005ca31f50
[   68.170019]  ffff88005ca31ec8 ffffffff83e6f983 ffff8800780db810 0000000000008000
[   68.170019]  ffff88005ca31ec8 ffff88006da5f908 ffff8800780db800 000000000060e000
[   68.170019] Call Trace:
[   68.170019] proc_read_toolaction (drivers/staging/unisys/visorchipset/visorchipset_main.c:2541)
[   68.170019] proc_reg_read (fs/proc/inode.c:211)
[   68.170019] vfs_read (fs/read_write.c:408)
[   68.170019] SyS_read (fs/read_write.c:519 fs/read_write.c:511)
[   68.170019] tracesys (arch/x86/kernel/entry_64.S:749)
[   68.170019] Code: 00 00 66 66 66 66 90 55 48 89 e5 48 83 ec 20 48 89 5d e0 48 89 d3 4c 89 65 e8 49 89 cc 4c 89 6d f0 49 89 f5 4c 89 75 f8 49 89 fe <48> 8b 3f e8 4f f9 ff ff 85 c0 0f 88 97 00 00 00 4d 85 ed 0f 85
[   68.170019] RIP visorchannel_read (drivers/staging/unisys/visorchannel/visorchannel_funcs.c:225)
[   68.170019]  RSP <ffff88005ca31e58>
[   68.170019] CR2: 0000000000000000

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-07 12:48:17 -07:00
Masanari Iida 9c01e83ce7 staging: unisys: Add missing close parentheses in filexfer.c
Add missing close parentheses in filexfer.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-07 12:48:17 -07:00
Daeseok Youn 6014046290 staging: unisys: replace kzalloc/kfree with UISMALLOC/UISFREE
It doesn't need to trace status of buffer when buffers are
allocated/deallocated. So stuff of tracing memory status
are removed. And also UISMALLOC/UISFREE macro are removed
completetly. just use kzalloc/kfree.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-20 01:53:35 +00:00
Ken Cox 22ad57ba5e Staging: unisys: Remove RETINT macro
The RETINT macro included a goto statement which is not allowed in the
kernel.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19 13:56:31 -07:00
Ken Cox 5e54c97dab Staging: unisys: Remove FAIL macro
The FAIL macro ultimately includes a goto statement which is not allowed
in the kernel.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19 13:56:31 -07:00
Ken Cox 097f4c19e8 Staging: unisys: Remove RETVOID macro
The RETVOID macro contained a goto statement which is not allowed in
the kernel.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19 13:56:31 -07:00
Ken Cox d9355f8934 Staging: unisys: Remove RETPTR macro
The RETPTR macro contained a goto statement which is not allowed in
the kernel.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19 13:56:31 -07:00
Ken Cox 61e03b433d Staging: unisys: Remove RETBOOL macro
The RETBOOL macro contained a goto statement which is not allowed in
the kernel.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19 13:56:31 -07:00
Ken Cox 4cb005a93c Staging: unisys: Remove FAIL_WPOSTCODE_1 macro
Part of a series to get rid of goto statements embedded in macros.  I'm
breaking this up into a series of smaller patches for easier review.  The
later patches in the series will actually remove the goto statements.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19 13:56:31 -07:00
Ken Cox 9f8d0e8bac Staging: unisys: Cleanup macros to get rid of goto statements
Remove the following macros:
	TRY
	CHKFD
	CHKDD
	CHKFDX
	CHKDDX
	ADDPROCLINE
	TRY_WPOSTCODE_1
	TRY_WPOSTCODE_2
	FAIL_WPOSTCODE_2
	FAIL_WPOSTCODE_3

Part of a series to get rid of goto statements embedded in macros.  I'm
breaking this up into a series of smaller patches for easier review.  The later
patches in the series will actually remove the goto statements.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19 13:55:40 -07:00
Ken Cox 316d363d68 Staging: unisys: include: Remove unused macros from timskmod.h
The following macros were never referenced and have been removed:
	DEVFROMID
	DEVFROMFILE
	DEVFROMINODE
	DEVFROMIDX
	TRY_WPOSTCODE_3

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-19 13:55:40 -07:00
Silvio F a3acc83a4a staging: unisys: kmalloc/memset to kzalloc conversation
This patch solves the Coccinelle warning: "kzalloc should be used
instead of kmalloc/memset"

This patch is a fixup for

	linux-next: 97a84f1203
	"Staging: unisys: Replace kmalloc/memset with kzalloc"

The ALLOC_CMDRSP #define is after transformation to kzalloc only a
rename for kzalloc and was completly removed.

Signed-off-by: Silvio F <silvio.fricke@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-18 16:22:27 -07:00
Ken Cox a771033659 Staging: unisys: visorutil: Clean up sparse warnings in visorutil code
Clean up code to get rid of sparse warnings.

Also fixed variable length arrays declared on the stack by removing
visor_hexDumpToBuffer() and using hex_dump_to_buffer() instead.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 14:46:36 -07:00
Ken Cox bd5b9b32d2 Staging: unisys: visorchipset: Clean up sparse warnings in visorchipset code.
Clean up code to get rid of sparse warnings due to accessing I/O space.  Also
declared functions and variables as static if they are only used locally.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 14:45:44 -07:00
Ken Cox 92a9e2d6bd Staging: unisys: visorchannel: Clean up sparse warnings in visorchannel code
Clean up code to get rid of sparse warnings, mostly due to accessing I/O space.

Remove visorchannel_get_safe_queue(), visorchannel_safesignalremove(),
and visorchannel_safesignalinsert() since they were not called from anywhere.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 14:45:44 -07:00
Ken Cox 8504ff6cab Staging: unisys: uislib: Cleanup sparse warnings in uislib
Clean up code to get rid of sparse warnings, mostly related to accessing I/O
space.

Remove uislibcmpxchg64() and use cmpxchg() instead.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 14:45:44 -07:00
Ken Cox a8d7f21d14 Staging: unisys: Clean multiple sparse warnings
Cleaned up multiple sparse warnings, mostly due to improper access of I/O
space.  Also declared functions and variables that were only used locally
as static.

Removed ULTRA_disp_channel_header(), ULTRA_disp_channel(),
ULTRA_disp_vnic_channel() because they were never called.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 14:45:44 -07:00
Ken Cox a1d842e84f Staging: unisys: channels: Cleanup sparse warnings
Clean up multiple sparse warnings mostly due to different address spaces
when accessing I/O memory.

Also, remove SignalRemoveAll(), SignalQueueHasOneElement(),
SignalQueueIsFull(), because they were never called.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 14:42:40 -07:00
Daeseok Youn 4b4b535e64 staging: unisys: remove incorrect error handling after queue_delayed_work
The queue_delayed_work() return false if the work is
already on the queue, true otherwise.
So return value cannot be less than zero.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17 14:42:40 -07:00
Andreea-Cristina Bernat 97a84f1203 Staging: unisys: Replace kmalloc/memset with kzalloc
This patch solves the Coccinelle warning: "kzalloc should be used instead of
kmalloc/memset".

Signed-off-by: Andreea-Cristina Bernat <bernat.ada@gmail.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-16 18:20:10 -07:00
Iulia Manda 56116b2b09 staging: unisys: visorutil: Use kzalloc instead of kmalloc with memset
Fix coccinelle warnings of better allocation by using kzalloc.
In these cases, kzalloc is preferred, as kmalloc may fail if it does not find
contiguous memory.

Signed-off-by: Iulia Manda <iulia.manda21@gmail.com>
Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-13 16:49:02 -07:00
Ken Cox 61a0bc0f1f Staging: unisys: Fix multiple variable length array declarations
There were multiple variable length arrays declared on the stack in proc
handlers:
	char buf[count];

I changed these to be fixed length arrays.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08 22:42:15 -08:00
Benjamin Romer 56df012266 staging: unisys: update MAINTAINERS and TODO
This patch adds the Unisys s-Par driver maintainers to the MAINTAINERS
file, changes the state to "Supported", modifies TODO to address patches
to the Unisys mailing list, and adds Greg Kroah-Hartman to the patch
recipients list.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08 22:42:14 -08:00
Ken Cox 27dd554839 Staging: unisys: uislib: Fix locking in info_proc_read_helper()
Make sure BusListLock is unlocked before returning.  If an error is encountered
early on in info_proc_read_helper() the function can return without unlocking.

Also changed the PROCLINE macro so that it doesn't include a goto statement.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08 22:42:14 -08:00
Ken Cox bed3b10d20 Staging: unisys: virthba: Fix variable length array
A character array was declared on the stack with variable length.  This has
been corrected to use a fixed length.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08 22:42:14 -08:00
Dan Carpenter a16a027651 staging: unisys/uislib: kthread_create() returns an ERR_PTR
kthread_create() returns an ERR_PTR on error, it never returns NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-08 22:42:14 -08:00
Ken Cox 7091be3703 Staging: unisys: virthba: Add dependency on SCSI
If CONFIG_SCSI is not enabled, compiling virthba.c goes horribly wrong with
undefined symbols.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 12:01:49 -08:00
Ken Cox 927c7927ee staging: unisys: Give exported symbols unique names
Many exported symbols had very generic names.  This commit changes the names
so that they will be unique.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 12:01:49 -08:00
Ken Cox 0d776fa465 staging: unisys: remove unreferenced utility functions.
A number of functions were used for debug at one time but that code has been
removed.

Signed-off-by: Ken Cox <jkc@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 12:01:49 -08:00
Ken Cox abed632efd staging: s-Par driver documentation
Documentation for the set of s-Par drivers

Signed-off-by: Ken Cox <jkc@redhat.com>
Cc: Ben Romer <sparmaintainer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-04 17:04:28 -08:00
Ken Cox dc95086172 staging: virthba driver to access shared SCSI hba
The virthba module provides access to a shared SCSI host bus adapter
and one or more disk devices, by proxying SCSI commands between the
guest and the service partition that owns the shared SCSI adapter,
using a channel between the guest and the service partition. The disks
that appear on the shared bus are defined by the s-Par configuration
and enforced by the service partition, while the guest driver handles
sending commands and handling responses. Each disk is shared as a
whole to a guest. Sharing the bus adapter in this way provides
resiliency; should the device encounter an error, only the service
partition is rebooted, and the device is reinitialized. This allows
guests to continue running and to recover from the error.

Signed-off-by: Ken Cox <jkc@redhat.com>
Cc: Ben Romer <sparmaintainer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-04 17:03:22 -08:00
Ken Cox af86526b22 staging: virtpci driver
The virtpci module handles the bus functions for virthba, and virtnic.

Signed-off-by: Ken Cox <jkc@redhat.com>
Cc: Ben Romer <sparmaintainer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-04 17:03:21 -08:00
Ken Cox bac8a4d5d2 staging: visoruislib driver used to handle requests from virtpci
The visoruislib module is a support library, used to handle requests
from virtpci.

Signed-off-by: Ken Cox <jkc@redhat.com>
Cc: Ben Romer <sparmaintainer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-04 16:59:31 -08:00
Ken Cox 7b2a2d8383 staging: visorchannelstub driver to provide channel support routines
The visorchannelstub module provides support routines for storing and
retrieving data from a channel.

Signed-off-by: Ken Cox <jkc@redhat.com>
Cc: Ben Romer <sparmaintainer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-04 16:59:30 -08:00
Ken Cox 12e364b9f0 staging: visorchipset driver to provide registration and other services
The visorchipset module receives device creation and destruction
events from the Command service partition of s-Par, as well as
controlling registration of shared device drivers with the s-Par
driver core. The events received are used to populate other s-Par
modules with their assigned shared devices. Visorchipset is required
for shared device drivers to function properly. Visorchipset also
stores information for handling dump disk device creation during
kdump.

In operation, the visorchipset module processes device creation and
destruction messages sent by s-Par's Command service partition through
a channel. These messages result in creation (or destruction) of each
virtual bus and virtual device. Each bus and device is also associated
with a communication channel, which is used to communicate with one or
more IO service partitions to perform device IO on behalf of the
guest.

Signed-off-by: Ken Cox <jkc@redhat.com>
Cc: Ben Romer <sparmaintainer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-04 16:58:21 -08:00
Ken Cox e423812a9e staging: visorchannel module
The visorchannel module is a support library that abstracts reading
and writing a channel in memory.

Signed-off-by: Ken Cox <jkc@redhat.com>
Cc: Ben Romer <sparmaintainer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-04 16:57:45 -08:00
Ken Cox 9d9baadd40 staging: visorutil driver to provide common functionality to other s-Par drivers
The visorutil module is a support library required by all other s-Par
driver modules. Among its features it abstracts reading, writing, and
manipulating a block of memory.

Signed-off-by: Ken Cox <jkc@redhat.com>
Cc: Ben Romer <sparmaintainer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-04 16:52:12 -08:00