Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fcd0157e authored by Ken Cox's avatar Ken Cox Committed by Greg Kroah-Hartman
Browse files

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: default avatarFengguang Wu <fengguang.wu@intel.com>
Signed-off-by: default avatarKen Cox <jkc@redhat.com>
Tested by: Ken Cox <jkc@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7f03de97
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -25,11 +25,14 @@

#include "channel.h"
#include "chanstub.h"
#include "timskmodutils.h"
#include "version.h"

static __init int
channel_mod_init(void)
{
	if (!unisys_spar_platform)
		return -ENODEV;
	return 0;
}

+2 −0
Original line number Diff line number Diff line
@@ -72,4 +72,6 @@ char *cyclesToSomethingsPerSecond(u64 cycles, u64 cyclesPerSecond,
struct seq_file *visor_seq_file_new_buffer(void *buf, size_t buf_size);
void visor_seq_file_done_buffer(struct seq_file *m);

extern int unisys_spar_platform;

#endif
+3 −0
Original line number Diff line number Diff line
@@ -2277,6 +2277,9 @@ static int __init
uislib_mod_init(void)
{

	if (!unisys_spar_platform)
		return -ENODEV;

	LOGINF("MONITORAPIS");

	LOGINF("sizeof(struct uiscmdrsp):%lu bytes\n",
+3 −0
Original line number Diff line number Diff line
@@ -1699,6 +1699,9 @@ virthba_mod_init(void)
	int error;
	int i;

	if (!unisys_spar_platform)
		return -ENODEV;

	LOGINF("Entering virthba_mod_init...\n");

	POSTCODE_LINUX_2(VHBA_CREATE_ENTRY_PC, POSTCODE_SEVERITY_INFO);
+4 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@
#include <linux/version.h>
#include "version.h"
#include "guestlinuxdebug.h"
#include "timskmodutils.h"

struct driver_private {
	struct kobject kobj;
@@ -1687,6 +1688,9 @@ static int __init virtpci_mod_init(void)
	int ret;


	if (!unisys_spar_platform)
		return -ENODEV;

	LOGINF("Module build: Date:%s Time:%s...\n", __DATE__, __TIME__);

	POSTCODE_LINUX_2(VPCI_CREATE_ENTRY_PC, POSTCODE_SEVERITY_INFO);
Loading