Lines Matching refs:bb_id
351 unsigned long bb_id) in virtio_mem_bb_id_to_phys() argument
353 return bb_id * vm->bbm.bb_size; in virtio_mem_bb_id_to_phys()
372 unsigned long bb_id, in virtio_mem_bbm_set_bb_state() argument
375 const unsigned long idx = bb_id - vm->bbm.first_bb_id; in virtio_mem_bbm_set_bb_state()
390 unsigned long bb_id) in virtio_mem_bbm_get_bb_state() argument
392 return vm->bbm.bb_states[bb_id - vm->bbm.first_bb_id]; in virtio_mem_bbm_get_bb_state()
681 static int virtio_mem_bbm_add_bb(struct virtio_mem *vm, unsigned long bb_id) in virtio_mem_bbm_add_bb() argument
683 const uint64_t addr = virtio_mem_bb_id_to_phys(vm, bb_id); in virtio_mem_bbm_add_bb()
813 unsigned long bb_id) in virtio_mem_bbm_offline_and_remove_bb() argument
815 const uint64_t addr = virtio_mem_bb_id_to_phys(vm, bb_id); in virtio_mem_bbm_offline_and_remove_bb()
958 unsigned long bb_id, in virtio_mem_bbm_notify_going_offline() argument
966 if (virtio_mem_bbm_get_bb_state(vm, bb_id) != in virtio_mem_bbm_notify_going_offline()
973 unsigned long bb_id, in virtio_mem_bbm_notify_cancel_offline() argument
977 if (virtio_mem_bbm_get_bb_state(vm, bb_id) != in virtio_mem_bbm_notify_cancel_offline()
1558 static int virtio_mem_bbm_unplug_bb(struct virtio_mem *vm, unsigned long bb_id) in virtio_mem_bbm_unplug_bb() argument
1560 const uint64_t addr = virtio_mem_bb_id_to_phys(vm, bb_id); in virtio_mem_bbm_unplug_bb()
1571 static int virtio_mem_bbm_plug_bb(struct virtio_mem *vm, unsigned long bb_id) in virtio_mem_bbm_plug_bb() argument
1573 const uint64_t addr = virtio_mem_bb_id_to_phys(vm, bb_id); in virtio_mem_bbm_plug_bb()
1827 unsigned long bb_id) in virtio_mem_bbm_plug_and_add_bb() argument
1831 if (WARN_ON_ONCE(virtio_mem_bbm_get_bb_state(vm, bb_id) != in virtio_mem_bbm_plug_and_add_bb()
1835 rc = virtio_mem_bbm_plug_bb(vm, bb_id); in virtio_mem_bbm_plug_and_add_bb()
1838 virtio_mem_bbm_set_bb_state(vm, bb_id, VIRTIO_MEM_BBM_BB_ADDED); in virtio_mem_bbm_plug_and_add_bb()
1840 rc = virtio_mem_bbm_add_bb(vm, bb_id); in virtio_mem_bbm_plug_and_add_bb()
1842 if (!virtio_mem_bbm_unplug_bb(vm, bb_id)) in virtio_mem_bbm_plug_and_add_bb()
1843 virtio_mem_bbm_set_bb_state(vm, bb_id, in virtio_mem_bbm_plug_and_add_bb()
1847 virtio_mem_bbm_set_bb_state(vm, bb_id, in virtio_mem_bbm_plug_and_add_bb()
1858 unsigned long *bb_id) in virtio_mem_bbm_prepare_next_bb() argument
1871 *bb_id = vm->bbm.next_bb_id; in virtio_mem_bbm_prepare_next_bb()
1879 unsigned long bb_id; in virtio_mem_bbm_plug_request() local
1886 virtio_mem_bbm_for_each_bb(vm, bb_id, VIRTIO_MEM_BBM_BB_UNUSED) { in virtio_mem_bbm_plug_request()
1890 rc = virtio_mem_bbm_plug_and_add_bb(vm, bb_id); in virtio_mem_bbm_plug_request()
1903 rc = virtio_mem_bbm_prepare_next_bb(vm, &bb_id); in virtio_mem_bbm_plug_request()
1906 rc = virtio_mem_bbm_plug_and_add_bb(vm, bb_id); in virtio_mem_bbm_plug_request()
2157 unsigned long bb_id) in virtio_mem_bbm_offline_remove_and_unplug_bb() argument
2159 const unsigned long start_pfn = PFN_DOWN(virtio_mem_bb_id_to_phys(vm, bb_id)); in virtio_mem_bbm_offline_remove_and_unplug_bb()
2166 if (WARN_ON_ONCE(virtio_mem_bbm_get_bb_state(vm, bb_id) != in virtio_mem_bbm_offline_remove_and_unplug_bb()
2177 virtio_mem_bbm_set_bb_state(vm, bb_id, VIRTIO_MEM_BBM_BB_FAKE_OFFLINE); in virtio_mem_bbm_offline_remove_and_unplug_bb()
2192 rc = virtio_mem_bbm_offline_and_remove_bb(vm, bb_id); in virtio_mem_bbm_offline_remove_and_unplug_bb()
2198 rc = virtio_mem_bbm_unplug_bb(vm, bb_id); in virtio_mem_bbm_offline_remove_and_unplug_bb()
2200 virtio_mem_bbm_set_bb_state(vm, bb_id, in virtio_mem_bbm_offline_remove_and_unplug_bb()
2203 virtio_mem_bbm_set_bb_state(vm, bb_id, in virtio_mem_bbm_offline_remove_and_unplug_bb()
2214 virtio_mem_bbm_set_bb_state(vm, bb_id, VIRTIO_MEM_BBM_BB_ADDED); in virtio_mem_bbm_offline_remove_and_unplug_bb()
2223 unsigned long bb_id) in virtio_mem_bbm_bb_is_offline() argument
2225 const unsigned long start_pfn = PFN_DOWN(virtio_mem_bb_id_to_phys(vm, bb_id)); in virtio_mem_bbm_bb_is_offline()
2242 unsigned long bb_id) in virtio_mem_bbm_bb_is_movable() argument
2244 const unsigned long start_pfn = PFN_DOWN(virtio_mem_bb_id_to_phys(vm, bb_id)); in virtio_mem_bbm_bb_is_movable()
2264 uint64_t bb_id; in virtio_mem_bbm_unplug_request() local
2275 virtio_mem_bbm_for_each_bb_rev(vm, bb_id, VIRTIO_MEM_BBM_BB_ADDED) { in virtio_mem_bbm_unplug_request()
2282 if (i == 0 && !virtio_mem_bbm_bb_is_offline(vm, bb_id)) in virtio_mem_bbm_unplug_request()
2284 if (i == 1 && !virtio_mem_bbm_bb_is_movable(vm, bb_id)) in virtio_mem_bbm_unplug_request()
2286 rc = virtio_mem_bbm_offline_remove_and_unplug_bb(vm, bb_id); in virtio_mem_bbm_unplug_request()