diff options
author | David Kershner | 2017-03-28 15:35:00 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2017-03-29 09:17:04 +0200 |
commit | 88845f407cd6d65959e0fb0c224b69b1fbce9604 (patch) | |
tree | cb7256244f56931a9f2883c35dadf4463f67021e /drivers/staging/unisys/visorbus/visorchipset.c | |
parent | staging: unisys: visorbus: Update vmcallinterface comment (diff) | |
download | kernel-qcow2-linux-88845f407cd6d65959e0fb0c224b69b1fbce9604.tar.gz kernel-qcow2-linux-88845f407cd6d65959e0fb0c224b69b1fbce9604.tar.xz kernel-qcow2-linux-88845f407cd6d65959e0fb0c224b69b1fbce9604.zip |
staging: unisys: visorbus: move unisys_vmcall into visorchipset
The only one using unisys_vmcall was visorchipset.c, it can be moved into
the visorchipset file directly instead of being in a header file.
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/unisys/visorbus/visorchipset.c')
-rw-r--r-- | drivers/staging/unisys/visorbus/visorchipset.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index b6e2b8e8d44e..9c48cfab0d2a 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -1354,6 +1354,25 @@ chipset_notready_uevent(struct controlvm_message_header *msg_hdr) return res; } +static int unisys_vmcall(unsigned long tuple, unsigned long param) +{ + int result = 0; + unsigned int cpuid_eax, cpuid_ebx, cpuid_ecx, cpuid_edx; + unsigned long reg_ebx; + unsigned long reg_ecx; + + reg_ebx = param & 0xFFFFFFFF; + reg_ecx = param >> 32; + + cpuid(0x00000001, &cpuid_eax, &cpuid_ebx, &cpuid_ecx, &cpuid_edx); + if (!(cpuid_ecx & 0x80000000)) + return -EPERM; + + __asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) : + "a"(tuple), "b"(reg_ebx), "c"(reg_ecx)); + + return result; +} static unsigned int issue_vmcall_io_controlvm_addr(u64 *control_addr, u32 *control_bytes) { @@ -1362,7 +1381,7 @@ issue_vmcall_io_controlvm_addr(u64 *control_addr, u32 *control_bytes) u64 physaddr; physaddr = virt_to_phys(¶ms); - unisys_vmcall(VMCALL_CONTROLVM_ADDR, physaddr, result); + result = unisys_vmcall(VMCALL_CONTROLVM_ADDR, physaddr); if (VMCALL_SUCCESSFUL(result)) { *control_addr = params.address; *control_bytes = params.channel_bytes; |