UUID_LE(0x2b3c2d10, 0x7ef5, 0x4ad8, \
0xb9, 0x66, 0x34, 0x48, 0xb7, 0x38, 0x6b, 0x3d)
-static const uuid_le spar_controlvm_channel_protocol_uuid =
- SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID;
-
#define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE \
ULTRA_CHANNEL_PROTOCOL_SIGNATURE
#define CONTROLVM_MESSAGE_MAX 64
#define SPAR_CONTROLVM_CHANNEL_OK_CLIENT(ch) \
spar_check_channel_client(ch, \
- spar_controlvm_channel_protocol_uuid, \
+ SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID, \
"controlvm", \
sizeof(struct spar_controlvm_channel_protocol), \
ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID, \
* In this case, the values can simply be read from the channel header.
*/
struct visorchannel *visorchannel_create(u64 physaddr,
- ulong channel_bytes, uuid_le guid);
+ unsigned long channel_bytes,
+ gfp_t gfp, uuid_le guid);
struct visorchannel *visorchannel_create_with_lock(u64 physaddr,
- ulong channel_bytes,
- uuid_le guid);
+ unsigned long channel_bytes,
+ gfp_t gfp, uuid_le guid);
void visorchannel_destroy(struct visorchannel *channel);
int visorchannel_read(struct visorchannel *channel, ulong offset,
void *local, ulong nbytes);
POSTCODE_SEVERITY_INFO);
/* prepare chan_hdr (abstraction to read/write channel memory) */
visorchannel = visorchannel_create(chan_info.channel_addr,
- (unsigned long)
chan_info.n_channel_bytes,
+ GFP_KERNEL,
chan_info.channel_type_uuid);
if (!visorchannel) {
POSTCODE_LINUX_3(DEVICE_CREATE_FAILURE_PC, chipset_dev_no,
devdata->chan = visorchannel_create(channel_addr,
n_channel_bytes,
+ GFP_KERNEL,
channel_type_guid);
if (!devdata->chan) {
POSTCODE_LINUX_3(DEVICE_CREATE_FAILURE_PC, channel_addr,
* but does NOT modify this data area.
*/
static struct visorchannel *
-visorchannel_create_guts(u64 physaddr, ulong channel_bytes,
- ulong off, uuid_le guid, bool needs_lock)
+visorchannel_create_guts(u64 physaddr, unsigned long channel_bytes,
+ gfp_t gfp, unsigned long off,
+ uuid_le guid, bool needs_lock)
{
struct visorchannel *channel;
int err;
size_t size = sizeof(struct channel_header);
- channel = kzalloc(sizeof(*channel), GFP_KERNEL|__GFP_NORETRY);
+ channel = kzalloc(sizeof(*channel), gfp);
if (!channel)
goto cleanup;
}
struct visorchannel *
-visorchannel_create(u64 physaddr, ulong channel_bytes, uuid_le guid)
+visorchannel_create(u64 physaddr, unsigned long channel_bytes,
+ gfp_t gfp, uuid_le guid)
{
- return visorchannel_create_guts(physaddr, channel_bytes, 0, guid,
+ return visorchannel_create_guts(physaddr, channel_bytes, gfp, 0, guid,
false);
}
EXPORT_SYMBOL_GPL(visorchannel_create);
struct visorchannel *
-visorchannel_create_with_lock(u64 physaddr, ulong channel_bytes,
- uuid_le guid)
+visorchannel_create_with_lock(u64 physaddr, unsigned long channel_bytes,
+ gfp_t gfp, uuid_le guid)
{
- return visorchannel_create_guts(physaddr, channel_bytes, 0, guid,
+ return visorchannel_create_guts(physaddr, channel_bytes, gfp, 0, guid,
true);
}
EXPORT_SYMBOL_GPL(visorchannel_create_with_lock);
addr = controlvm_get_channel_address();
if (addr) {
+ int tmp_sz = sizeof(struct spar_controlvm_channel_protocol);
+ uuid_le uuid = SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID;
controlvm_channel =
- visorchannel_create_with_lock
- (addr,
- sizeof(struct spar_controlvm_channel_protocol),
- spar_controlvm_channel_protocol_uuid);
+ visorchannel_create_with_lock(addr, tmp_sz,
+ GFP_KERNEL, uuid);
if (SPAR_CONTROLVM_CHANNEL_OK_CLIENT(
visorchannel_get_header(controlvm_channel))) {
initialize_controlvm_payload();