Commit bb1fb8ac authored by Sameer Wadgaonkar's avatar Sameer Wadgaonkar Committed by Greg Kroah-Hartman

staging: unisys: visorbus: fix s-Par to boot with option CONFIG_VMAP_STACK set to y

The root issue is that we are not allowed to have items on the
stack being passed to "DMA" like operations. In this case we have
vmcall operation that was using parameters from the stack.

This patch fixes the issue by moving the variables on stack in
issue_vmcall_io_controlvm_addr() to vmcall_controlvm_addr struct.
Signed-off-by: default avatarSameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 372b9f22
...@@ -57,6 +57,12 @@ struct parser_context { ...@@ -57,6 +57,12 @@ struct parser_context {
char data[0]; char data[0];
}; };
struct vmcall_controlvm_addr {
struct vmcall_io_controlvm_addr_params params;
int err;
u64 physaddr;
};
struct visorchipset_device { struct visorchipset_device {
struct acpi_device *acpi_device; struct acpi_device *acpi_device;
unsigned long poll_jiffies; unsigned long poll_jiffies;
...@@ -74,6 +80,7 @@ struct visorchipset_device { ...@@ -74,6 +80,7 @@ struct visorchipset_device {
*/ */
struct controlvm_message controlvm_pending_msg; struct controlvm_message controlvm_pending_msg;
bool controlvm_pending_msg_valid; bool controlvm_pending_msg_valid;
struct vmcall_controlvm_addr controlvm_addr;
}; };
static struct visorchipset_device *chipset_dev; static struct visorchipset_device *chipset_dev;
...@@ -1338,17 +1345,15 @@ static int unisys_vmcall(unsigned long tuple, unsigned long param) ...@@ -1338,17 +1345,15 @@ static int unisys_vmcall(unsigned long tuple, unsigned long param)
static unsigned int static unsigned int
issue_vmcall_io_controlvm_addr(u64 *control_addr, u32 *control_bytes) issue_vmcall_io_controlvm_addr(u64 *control_addr, u32 *control_bytes)
{ {
struct vmcall_io_controlvm_addr_params params; chipset_dev->controlvm_addr.physaddr = virt_to_phys(
int err; &chipset_dev->controlvm_addr.params);
u64 physaddr; chipset_dev->controlvm_addr.err = unisys_vmcall(VMCALL_CONTROLVM_ADDR,
chipset_dev->controlvm_addr.physaddr);
if (chipset_dev->controlvm_addr.err)
return chipset_dev->controlvm_addr.err;
physaddr = virt_to_phys(&params); *control_addr = chipset_dev->controlvm_addr.params.address;
err = unisys_vmcall(VMCALL_CONTROLVM_ADDR, physaddr); *control_bytes = chipset_dev->controlvm_addr.params.channel_bytes;
if (err)
return err;
*control_addr = params.address;
*control_bytes = params.channel_bytes;
return 0; return 0;
} }
...@@ -1819,14 +1824,14 @@ visorchipset_init(struct acpi_device *acpi_device) ...@@ -1819,14 +1824,14 @@ visorchipset_init(struct acpi_device *acpi_device)
uuid_le uuid = SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID; uuid_le uuid = SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID;
struct visorchannel *controlvm_channel; struct visorchannel *controlvm_channel;
addr = controlvm_get_channel_address();
if (!addr)
goto error;
chipset_dev = kzalloc(sizeof(*chipset_dev), GFP_KERNEL); chipset_dev = kzalloc(sizeof(*chipset_dev), GFP_KERNEL);
if (!chipset_dev) if (!chipset_dev)
goto error; goto error;
addr = controlvm_get_channel_address();
if (!addr)
goto error;
acpi_device->driver_data = chipset_dev; acpi_device->driver_data = chipset_dev;
chipset_dev->acpi_device = acpi_device; chipset_dev->acpi_device = acpi_device;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment