Lines Matching refs:dm_device
583 static struct hv_dynmem_device dm_device; variable
623 list_for_each_entry(has, &dm_device.ha_region_list, list) { in hv_page_offline_check()
655 complete(&dm_device.ol_waitevent); in hv_memory_notifier()
659 scoped_guard(spinlock_irqsave, &dm_device.ha_lock) { in hv_memory_notifier()
662 if (pfn_count <= dm_device.num_pages_onlined) { in hv_memory_notifier()
663 dm_device.num_pages_onlined -= pfn_count; in hv_memory_notifier()
672 dm_device.num_pages_onlined = 0; in hv_memory_notifier()
703 lockdep_assert_held(&dm_device.ha_lock); in hv_page_online_one()
704 dm_device.num_pages_onlined++; in hv_page_online_one()
730 scoped_guard(spinlock_irqsave, &dm_device.ha_lock) { in hv_mem_hot_add()
744 reinit_completion(&dm_device.ol_waitevent); in hv_mem_hot_add()
762 scoped_guard(spinlock_irqsave, &dm_device.ha_lock) { in hv_mem_hot_add()
777 wait_for_completion_timeout(&dm_device.ol_waitevent, 5 * HZ); in hv_mem_hot_add()
778 post_status(&dm_device); in hv_mem_hot_add()
787 guard(spinlock_irqsave)(&dm_device.ha_lock); in hv_online_page()
788 list_for_each_entry(has, &dm_device.ha_region_list, list) { in hv_online_page()
806 guard(spinlock_irqsave)(&dm_device.ha_lock); in pfn_covered()
807 list_for_each_entry(has, &dm_device.ha_region_list, list) { in pfn_covered()
871 spin_lock_irqsave(&dm_device.ha_lock, flags); in handle_pg_range()
872 list_for_each_entry(has, &dm_device.ha_region_list, list) { in handle_pg_range()
924 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in handle_pg_range()
926 spin_lock_irqsave(&dm_device.ha_lock, flags); in handle_pg_range()
935 spin_unlock_irqrestore(&dm_device.ha_lock, flags); in handle_pg_range()
951 if (!dm_device.host_specified_ha_region) { in process_hot_add()
978 scoped_guard(spinlock_irqsave, &dm_device.ha_lock) { in process_hot_add()
979 list_add_tail(&ha_region->list, &dm_device.ha_region_list); in process_hot_add()
1000 struct hv_dynmem_device *dm = &dm_device; in hot_add_req()
1289 unsigned int num_pages = dm_device.balloon_wrk.num_pages; in balloon_up()
1325 num_ballooned = alloc_balloon_pages(&dm_device, num_pages, in balloon_up()
1335 num_pages, dm_device.balloon_wrk.num_pages); in balloon_up()
1339 dm_device.state = DM_INITIALIZED; in balloon_up()
1350 ret = vmbus_sendpacket(dm_device.dev->channel, in balloon_up()
1358 post_status(&dm_device); in balloon_up()
1368 free_balloon_pages(&dm_device, in balloon_up()
1388 complete(&dm_device.config_event); in balloon_down()
1402 vmbus_sendpacket(dm_device.dev->channel, &resp, in balloon_down()
1418 &dm_device.config_event, 1*HZ); in dm_thread_func()
1423 reinit_completion(&dm_device.config_event); in dm_thread_func()
1556 dm_device.balloon_wrk.num_pages = bal_msg->num_pages; in balloon_onchannelcallback()
1557 schedule_work(&dm_device.balloon_wrk.wrk); in balloon_onchannelcallback()
1597 schedule_work(&dm_device.ha_wrk.wrk); in balloon_onchannelcallback()
1703 dm_device.pr_dev_info.report = hv_free_page_report; in enable_page_reporting()
1708 dm_device.pr_dev_info.order = 0; in enable_page_reporting()
1709 ret = page_reporting_register(&dm_device.pr_dev_info); in enable_page_reporting()
1711 dm_device.pr_dev_info.report = NULL; in enable_page_reporting()
1721 if (dm_device.pr_dev_info.report) { in disable_page_reporting()
1722 page_reporting_unregister(&dm_device.pr_dev_info); in disable_page_reporting()
1723 dm_device.pr_dev_info.report = NULL; in disable_page_reporting()
1790 dm_device.version = version_req.version.version; in balloon_connect_vsp()
1798 t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ); in balloon_connect_vsp()
1808 if (dm_device.state == DM_INIT_ERROR) { in balloon_connect_vsp()
1814 DYNMEM_MAJOR_VERSION(dm_device.version), in balloon_connect_vsp()
1815 DYNMEM_MINOR_VERSION(dm_device.version)); in balloon_connect_vsp()
1853 t = wait_for_completion_timeout(&dm_device.host_event, 5*HZ); in balloon_connect_vsp()
1863 if (dm_device.state == DM_INIT_ERROR) { in balloon_connect_vsp()
1991 dm_device.dev = dev; in balloon_probe()
1992 dm_device.state = DM_INITIALIZING; in balloon_probe()
1993 dm_device.next_version = DYNMEM_PROTOCOL_VERSION_WIN8; in balloon_probe()
1994 init_completion(&dm_device.host_event); in balloon_probe()
1995 init_completion(&dm_device.config_event); in balloon_probe()
1996 INIT_LIST_HEAD(&dm_device.ha_region_list); in balloon_probe()
1997 spin_lock_init(&dm_device.ha_lock); in balloon_probe()
1998 INIT_WORK(&dm_device.balloon_wrk.wrk, balloon_up); in balloon_probe()
1999 INIT_WORK(&dm_device.ha_wrk.wrk, hot_add_req); in balloon_probe()
2000 dm_device.host_specified_ha_region = false; in balloon_probe()
2004 init_completion(&dm_device.ol_waitevent); in balloon_probe()
2008 hv_set_drvdata(dev, &dm_device); in balloon_probe()
2015 dm_device.state = DM_INITIALIZED; in balloon_probe()
2017 dm_device.thread = in balloon_probe()
2018 kthread_run(dm_thread_func, &dm_device, "hv_balloon"); in balloon_probe()
2019 if (IS_ERR(dm_device.thread)) { in balloon_probe()
2020 ret = PTR_ERR(dm_device.thread); in balloon_probe()
2024 hv_balloon_debugfs_init(&dm_device); in balloon_probe()
2029 dm_device.state = DM_INIT_ERROR; in balloon_probe()
2030 dm_device.thread = NULL; in balloon_probe()
2062 if (dm_device.state != DM_INIT_ERROR) { in balloon_remove()
2071 guard(spinlock_irqsave)(&dm_device.ha_lock); in balloon_remove()
2107 dm_device.state = DM_INITIALIZING; in balloon_resume()
2114 dm_device.thread = in balloon_resume()
2115 kthread_run(dm_thread_func, &dm_device, "hv_balloon"); in balloon_resume()
2116 if (IS_ERR(dm_device.thread)) { in balloon_resume()
2117 ret = PTR_ERR(dm_device.thread); in balloon_resume()
2118 dm_device.thread = NULL; in balloon_resume()
2122 dm_device.state = DM_INITIALIZED; in balloon_resume()
2127 dm_device.state = DM_INIT_ERROR; in balloon_resume()