Lines Matching refs:dm_device

573 static struct hv_dynmem_device dm_device;  variable
613 list_for_each_entry(has, &dm_device.ha_region_list, list) { in hv_page_offline_check()
645 complete(&dm_device.ol_waitevent); in hv_memory_notifier()
649 scoped_guard(spinlock_irqsave, &dm_device.ha_lock) { in hv_memory_notifier()
652 if (pfn_count <= dm_device.num_pages_onlined) { in hv_memory_notifier()
653 dm_device.num_pages_onlined -= pfn_count; in hv_memory_notifier()
662 dm_device.num_pages_onlined = 0; in hv_memory_notifier()
692 lockdep_assert_held(&dm_device.ha_lock); in hv_page_online_one()
693 dm_device.num_pages_onlined++; in hv_page_online_one()
719 scoped_guard(spinlock_irqsave, &dm_device.ha_lock) { in hv_mem_hot_add()
726 reinit_completion(&dm_device.ol_waitevent); in hv_mem_hot_add()
744 scoped_guard(spinlock_irqsave, &dm_device.ha_lock) { in hv_mem_hot_add()
759 wait_for_completion_timeout(&dm_device.ol_waitevent, secs_to_jiffies(5)); in hv_mem_hot_add()
760 post_status(&dm_device); in hv_mem_hot_add()
769 scoped_guard(spinlock_irqsave, &dm_device.ha_lock) { in hv_online_page()
770 list_for_each_entry(has, &dm_device.ha_region_list, list) { in hv_online_page()
790 guard(spinlock_irqsave)(&dm_device.ha_lock); in pfn_covered()
791 list_for_each_entry(has, &dm_device.ha_region_list, list) { in pfn_covered()
849 spin_lock_irqsave(&dm_device.ha_lock, flags); in handle_pg_range()
850 list_for_each_entry(has, &dm_device.ha_region_list, list) { in handle_pg_range()
899 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in handle_pg_range()
901 spin_lock_irqsave(&dm_device.ha_lock, flags); in handle_pg_range()
910 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in handle_pg_range()
926 if (!dm_device.host_specified_ha_region) { in process_hot_add()
953 scoped_guard(spinlock_irqsave, &dm_device.ha_lock) { in process_hot_add()
954 list_add_tail(&ha_region->list, &dm_device.ha_region_list); in process_hot_add()
975 struct hv_dynmem_device *dm = &dm_device; in hot_add_req()
1253 unsigned int num_pages = dm_device.balloon_wrk.num_pages; in balloon_up()
1289 num_ballooned = alloc_balloon_pages(&dm_device, num_pages, in balloon_up()
1299 num_pages, dm_device.balloon_wrk.num_pages); in balloon_up()
1303 dm_device.state = DM_INITIALIZED; in balloon_up()
1314 ret = vmbus_sendpacket(dm_device.dev->channel, in balloon_up()
1322 post_status(&dm_device); in balloon_up()
1332 free_balloon_pages(&dm_device, in balloon_up()
1351 complete(&dm_device.config_event); in balloon_down()
1365 vmbus_sendpacket(dm_device.dev->channel, &resp, in balloon_down()
1380 wait_for_completion_interruptible_timeout(&dm_device.config_event, in dm_thread_func()
1386 reinit_completion(&dm_device.config_event); in dm_thread_func()
1518 dm_device.balloon_wrk.num_pages = bal_msg->num_pages; in balloon_onchannelcallback()
1519 schedule_work(&dm_device.balloon_wrk.wrk); in balloon_onchannelcallback()
1559 schedule_work(&dm_device.ha_wrk.wrk); in balloon_onchannelcallback()
1661 dm_device.pr_dev_info.report = hv_free_page_report; in enable_page_reporting()
1666 dm_device.pr_dev_info.order = 0; in enable_page_reporting()
1667 ret = page_reporting_register(&dm_device.pr_dev_info); in enable_page_reporting()
1669 dm_device.pr_dev_info.report = NULL; in enable_page_reporting()
1679 if (dm_device.pr_dev_info.report) { in disable_page_reporting()
1680 page_reporting_unregister(&dm_device.pr_dev_info); in disable_page_reporting()
1681 dm_device.pr_dev_info.report = NULL; in disable_page_reporting()
1748 dm_device.version = version_req.version.version; in balloon_connect_vsp()
1756 t = wait_for_completion_timeout(&dm_device.host_event, secs_to_jiffies(5)); in balloon_connect_vsp()
1766 if (dm_device.state == DM_INIT_ERROR) { in balloon_connect_vsp()
1772 DYNMEM_MAJOR_VERSION(dm_device.version), in balloon_connect_vsp()
1773 DYNMEM_MINOR_VERSION(dm_device.version)); in balloon_connect_vsp()
1814 t = wait_for_completion_timeout(&dm_device.host_event, secs_to_jiffies(5)); in balloon_connect_vsp()
1824 if (dm_device.state == DM_INIT_ERROR) { in balloon_connect_vsp()
1967 dm_device.dev = dev; in balloon_probe()
1968 dm_device.state = DM_INITIALIZING; in balloon_probe()
1969 dm_device.next_version = DYNMEM_PROTOCOL_VERSION_WIN8; in balloon_probe()
1970 init_completion(&dm_device.host_event); in balloon_probe()
1971 init_completion(&dm_device.config_event); in balloon_probe()
1972 INIT_LIST_HEAD(&dm_device.ha_region_list); in balloon_probe()
1973 spin_lock_init(&dm_device.ha_lock); in balloon_probe()
1974 INIT_WORK(&dm_device.balloon_wrk.wrk, balloon_up); in balloon_probe()
1975 INIT_WORK(&dm_device.ha_wrk.wrk, hot_add_req); in balloon_probe()
1976 dm_device.host_specified_ha_region = false; in balloon_probe()
1980 init_completion(&dm_device.ol_waitevent); in balloon_probe()
1984 hv_set_drvdata(dev, &dm_device); in balloon_probe()
1991 dm_device.state = DM_INITIALIZED; in balloon_probe()
1993 dm_device.thread = in balloon_probe()
1994 kthread_run(dm_thread_func, &dm_device, "hv_balloon"); in balloon_probe()
1995 if (IS_ERR(dm_device.thread)) { in balloon_probe()
1996 ret = PTR_ERR(dm_device.thread); in balloon_probe()
2000 hv_balloon_debugfs_init(&dm_device); in balloon_probe()
2005 dm_device.state = DM_INIT_ERROR; in balloon_probe()
2006 dm_device.thread = NULL; in balloon_probe()
2038 if (dm_device.state != DM_INIT_ERROR) { in balloon_remove()
2047 guard(spinlock_irqsave)(&dm_device.ha_lock); in balloon_remove()
2082 dm_device.state = DM_INITIALIZING; in balloon_resume()
2089 dm_device.thread = in balloon_resume()
2090 kthread_run(dm_thread_func, &dm_device, "hv_balloon"); in balloon_resume()
2091 if (IS_ERR(dm_device.thread)) { in balloon_resume()
2092 ret = PTR_ERR(dm_device.thread); in balloon_resume()
2093 dm_device.thread = NULL; in balloon_resume()
2097 dm_device.state = DM_INITIALIZED; in balloon_resume()
2102 dm_device.state = DM_INIT_ERROR; in balloon_resume()