struct jailhouse_cell_create cell_params;
struct jailhouse_cell_desc *config;
struct jailhouse_cell_id cell_id;
+ void __user *user_config;
struct cell *cell;
unsigned int cpu;
int id, err = 0;
if (!config)
return -ENOMEM;
- if (copy_from_user(config,
- (void *)(unsigned long)cell_params.config_address,
- cell_params.config_size)) {
+ user_config = (void __user *)(unsigned long)cell_params.config_address;
+ if (copy_from_user(config, user_config, cell_params.config_size)) {
err = -EFAULT;
goto kfree_config_out;
}
}
if (copy_from_user(image_mem,
- (void *)(unsigned long)image.source_address,
+ (void __user *)(unsigned long)image.source_address,
image.size))
err = -EFAULT;
const struct jailhouse_system __user *system_config)
{
u8 __user *cpu_set =
- (u8 __user *)jailhouse_cell_cpu_set(&system_config->root_cell);
+ (u8 __user *)jailhouse_cell_cpu_set(
+ (const struct jailhouse_cell_desc * __force)
+ &system_config->root_cell);
unsigned int pos = cpu_set_size;
long max_cpu_id;
u8 bitmap;
(unsigned long)config->debug_uart.phys_start);
goto error_unmap;
}
- header->debug_uart_base = (void *)uart;
+ /* The hypervisor has no notion of address spaces, so we need
+ * to enforce conversion. */
+ header->debug_uart_base = (void * __force)uart;
}
err = jailhouse_cell_prepare_root(&config->root_cell);
* not support taking any faults while switching worlds. */
for (page = hypervisor_mem, size = hv_core_and_percpu_size; size > 0;
size -= PAGE_SIZE, page += PAGE_SIZE)
- readl(page);
+ readl((void __iomem *)page);
/* either returns 0 or the same error code across all CPUs */
err = jailhouse_call(JAILHOUSE_HC_DISABLE);