dm_device
unsigned int num_pages = dm_device.balloon_wrk.num_pages;
num_ballooned = alloc_balloon_pages(&dm_device, num_pages,
num_pages, dm_device.balloon_wrk.num_pages);
dm_device.state = DM_INITIALIZED;
ret = vmbus_sendpacket(dm_device.dev->channel,
post_status(&dm_device);
free_balloon_pages(&dm_device,
complete(&dm_device.config_event);
vmbus_sendpacket(dm_device.dev->channel, &resp,
wait_for_completion_interruptible_timeout(&dm_device.config_event,
reinit_completion(&dm_device.config_event);
dm_device.balloon_wrk.num_pages = bal_msg->num_pages;
schedule_work(&dm_device.balloon_wrk.wrk);
schedule_work(&dm_device.ha_wrk.wrk);
dm_device.pr_dev_info.report = hv_free_page_report;
dm_device.pr_dev_info.order = PAGE_REPORTING_ORDER_UNSPECIFIED;
ret = page_reporting_register(&dm_device.pr_dev_info);
dm_device.pr_dev_info.report = NULL;
if (dm_device.pr_dev_info.report) {
page_reporting_unregister(&dm_device.pr_dev_info);
dm_device.pr_dev_info.report = NULL;
dm_device.version = version_req.version.version;
t = wait_for_completion_timeout(&dm_device.host_event, secs_to_jiffies(5));
if (dm_device.state == DM_INIT_ERROR) {
DYNMEM_MAJOR_VERSION(dm_device.version),
DYNMEM_MINOR_VERSION(dm_device.version));
t = wait_for_completion_timeout(&dm_device.host_event, secs_to_jiffies(5));
if (dm_device.state == DM_INIT_ERROR) {
dm_device.dev = dev;
dm_device.state = DM_INITIALIZING;
dm_device.next_version = DYNMEM_PROTOCOL_VERSION_WIN8;
init_completion(&dm_device.host_event);
init_completion(&dm_device.config_event);
INIT_LIST_HEAD(&dm_device.ha_region_list);
spin_lock_init(&dm_device.ha_lock);
INIT_WORK(&dm_device.balloon_wrk.wrk, balloon_up);
INIT_WORK(&dm_device.ha_wrk.wrk, hot_add_req);
dm_device.host_specified_ha_region = false;
init_completion(&dm_device.ol_waitevent);
hv_set_drvdata(dev, &dm_device);
dm_device.state = DM_INITIALIZED;
dm_device.thread =
kthread_run(dm_thread_func, &dm_device, "hv_balloon");
if (IS_ERR(dm_device.thread)) {
ret = PTR_ERR(dm_device.thread);
hv_balloon_debugfs_init(&dm_device);
dm_device.state = DM_INIT_ERROR;
dm_device.thread = NULL;
if (dm_device.state != DM_INIT_ERROR) {
guard(spinlock_irqsave)(&dm_device.ha_lock);
dm_device.state = DM_INITIALIZING;
dm_device.thread =
kthread_run(dm_thread_func, &dm_device, "hv_balloon");
if (IS_ERR(dm_device.thread)) {
ret = PTR_ERR(dm_device.thread);
dm_device.thread = NULL;
dm_device.state = DM_INITIALIZED;
dm_device.state = DM_INIT_ERROR;
static struct hv_dynmem_device dm_device;
list_for_each_entry(has, &dm_device.ha_region_list, list) {
complete(&dm_device.ol_waitevent);
scoped_guard(spinlock_irqsave, &dm_device.ha_lock) {
if (pfn_count <= dm_device.num_pages_onlined) {
dm_device.num_pages_onlined -= pfn_count;
dm_device.num_pages_onlined = 0;
lockdep_assert_held(&dm_device.ha_lock);
dm_device.num_pages_onlined++;
scoped_guard(spinlock_irqsave, &dm_device.ha_lock) {
reinit_completion(&dm_device.ol_waitevent);
scoped_guard(spinlock_irqsave, &dm_device.ha_lock) {
wait_for_completion_timeout(&dm_device.ol_waitevent, secs_to_jiffies(5));
post_status(&dm_device);
scoped_guard(spinlock_irqsave, &dm_device.ha_lock) {
list_for_each_entry(has, &dm_device.ha_region_list, list) {
guard(spinlock_irqsave)(&dm_device.ha_lock);
list_for_each_entry(has, &dm_device.ha_region_list, list) {
spin_lock_irqsave(&dm_device.ha_lock, flags);
list_for_each_entry(has, &dm_device.ha_region_list, list) {
spin_unlock_irqrestore(&dm_device.ha_lock, flags);
spin_lock_irqsave(&dm_device.ha_lock, flags);
spin_unlock_irqrestore(&dm_device.ha_lock, flags);
if (!dm_device.host_specified_ha_region) {
scoped_guard(spinlock_irqsave, &dm_device.ha_lock) {
list_add_tail(&ha_region->list, &dm_device.ha_region_list);
struct hv_dynmem_device *dm = &dm_device;
static char __init *dm_parse_table_entry(struct dm_device *dev, char *str)
static int __init dm_parse_table(struct dm_device *dev, char *str)
static char __init *dm_parse_device_entry(struct dm_device *dev, char *str)
struct dm_device *dev;
struct dm_device *dev;
struct dm_device *dev, *tmp;