Lines Matching refs:mr
507 memory_region_add_subregion(vmem->mr, memslot_offset, &vmem->memslots[idx]); in virtio_mem_activate_memslot()
517 memory_region_del_subregion(vmem->mr, &vmem->memslots[idx]); in virtio_mem_deactivate_memslot()
542 const uint64_t region_size = memory_region_size(&vmem->memdev->mr); in virtio_mem_deactivate_unplugged_memslots()
583 RAMBlock *rb = vmem->memdev->mr.ram_block; in virtio_mem_set_block_state()
604 void *area = memory_region_get_ram_ptr(&vmem->memdev->mr) + offset; in virtio_mem_set_block_state()
605 int fd = memory_region_get_fd(&vmem->memdev->mr); in virtio_mem_set_block_state()
645 ram_block_discard_range(vmem->memdev->mr.ram_block, offset, size); in virtio_mem_set_block_state()
714 uint64_t newsize = MIN(memory_region_size(&vmem->memdev->mr), in virtio_mem_resize_usable_region()
734 const uint64_t region_size = memory_region_size(&vmem->memdev->mr); in virtio_mem_unplug_all()
735 RAMBlock *rb = vmem->memdev->mr.ram_block; in virtio_mem_unplug_all()
867 config->region_size = cpu_to_le64(memory_region_size(&vmem->memdev->mr)); in virtio_mem_get_config()
912 const uint64_t region_size = memory_region_size(&vmem->memdev->mr); in virtio_mem_prepare_mr()
914 assert(!vmem->mr && vmem->dynamic_memslots); in virtio_mem_prepare_mr()
915 vmem->mr = g_new0(MemoryRegion, 1); in virtio_mem_prepare_mr()
916 memory_region_init(vmem->mr, OBJECT(vmem), "virtio-mem", in virtio_mem_prepare_mr()
918 vmem->mr->align = memory_region_get_alignment(&vmem->memdev->mr); in virtio_mem_prepare_mr()
923 const uint64_t region_size = memory_region_size(&vmem->memdev->mr); in virtio_mem_prepare_memslots()
942 &vmem->memdev->mr, memslot_offset, in virtio_mem_prepare_memslots()
971 } else if (!memory_region_is_ram(&vmem->memdev->mr) || in virtio_mem_device_realize()
972 memory_region_is_rom(&vmem->memdev->mr) || in virtio_mem_device_realize()
973 !vmem->memdev->mr.ram_block) { in virtio_mem_device_realize()
998 rb = vmem->memdev->mr.ram_block; in virtio_mem_device_realize()
1060 } else if (!QEMU_IS_ALIGNED(memory_region_size(&vmem->memdev->mr), in virtio_mem_device_realize()
1094 vmem->bitmap_size = memory_region_size(&vmem->memdev->mr) / in virtio_mem_device_realize()
1106 if (!vmem->mr) { in virtio_mem_device_realize()
1111 vmem->memslot_size = memory_region_size(&vmem->memdev->mr); in virtio_mem_device_realize()
1117 assert(!vmem->mr && !vmem->nb_memslots && !vmem->memslots); in virtio_mem_device_realize()
1121 vmstate_register_ram(&vmem->memdev->mr, DEVICE(vmem)); in virtio_mem_device_realize()
1132 memory_region_set_ram_discard_manager(&vmem->memdev->mr, in virtio_mem_device_realize()
1145 memory_region_set_ram_discard_manager(&vmem->memdev->mr, NULL); in virtio_mem_device_unrealize()
1151 vmstate_unregister_ram(&vmem->memdev->mr, DEVICE(vmem)); in virtio_mem_device_unrealize()
1162 RAMBlock *rb = vmem->memdev->mr.ram_block; in virtio_mem_discard_range_cb()
1229 if (migrate_ram_is_ignored(vmem->memdev->mr.ram_block)) { in virtio_mem_post_load()
1247 void *area = memory_region_get_ram_ptr(&vmem->memdev->mr) + offset; in virtio_mem_prealloc_range_cb()
1248 int fd = memory_region_get_fd(&vmem->memdev->mr); in virtio_mem_prealloc_range_cb()
1261 RAMBlock *rb = vmem->memdev->mr.ram_block; in virtio_mem_post_load_early()
1326 tmp->region_size = memory_region_size(&vmem->memdev->mr); in virtio_mem_mig_sanity_checks_pre_save()
1336 const uint64_t new_region_size = memory_region_size(&vmem->memdev->mr); in virtio_mem_mig_sanity_checks_post_load()
1450 vi->max_size = memory_region_size(&vmem->memdev->mr); in virtio_mem_fill_device_info()
1461 if (!vmem->mr) { in virtio_mem_get_memory_region()
1464 return vmem->mr; in virtio_mem_get_memory_region()
1467 return &vmem->memdev->mr; in virtio_mem_get_memory_region()
1484 if (limit <= 1 || !vmem->memdev || !vmem->memdev->mr.ram_block) { in virtio_mem_decide_memslots()
1489 rb = vmem->memdev->mr.ram_block; in virtio_mem_decide_memslots()
1490 region_size = memory_region_size(&vmem->memdev->mr); in virtio_mem_decide_memslots()
1585 } else if (value > memory_region_size(&vmem->memdev->mr)) { in virtio_mem_set_requested_size()
1588 memory_region_size(&vmem->memdev->mr)); in virtio_mem_set_requested_size()
1617 if (vmem->memdev && memory_region_is_ram(&vmem->memdev->mr)) { in virtio_mem_get_block_size()
1618 value = virtio_mem_default_block_size(vmem->memdev->mr.ram_block); in virtio_mem_get_block_size()
1681 g_free(vmem->mr); in virtio_mem_instance_finalize()
1682 vmem->mr = NULL; in virtio_mem_instance_finalize()
1703 const MemoryRegion *mr) in virtio_mem_rdm_get_min_granularity() argument
1707 g_assert(mr == &vmem->memdev->mr); in virtio_mem_rdm_get_min_granularity()
1718 g_assert(s->mr == &vmem->memdev->mr); in virtio_mem_rdm_is_populated()
1753 g_assert(s->mr == &vmem->memdev->mr); in virtio_mem_rdm_replay_populated()
1778 g_assert(s->mr == &vmem->memdev->mr); in virtio_mem_rdm_replay_discarded()
1790 g_assert(s->mr == &vmem->memdev->mr); in virtio_mem_rdm_register_listener()
1807 g_assert(rdl->section->mr == &vmem->memdev->mr); in virtio_mem_rdm_unregister_listener()