mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
vdpa: add shadow_data to vhost_vdpa
The memory listener that thells the device how to convert GPA to qemu's va is registered against CVQ vhost_vdpa. memory listener translations are always ASID 0, CVQ ones are ASID 1 if supported. Let's tell the listener if it needs to register them on iova tree or not. Signed-off-by: Eugenio Pérez <eperezma@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Message-Id: <20221215113144.322011-12-eperezma@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
7f211a28fd
commit
6188d78a19
3 changed files with 6 additions and 3 deletions
|
@ -224,7 +224,7 @@ static void vhost_vdpa_listener_region_add(MemoryListener *listener,
|
|||
vaddr, section->readonly);
|
||||
|
||||
llsize = int128_sub(llend, int128_make64(iova));
|
||||
if (v->shadow_vqs_enabled) {
|
||||
if (v->shadow_data) {
|
||||
int r;
|
||||
|
||||
mem_region.translated_addr = (hwaddr)(uintptr_t)vaddr,
|
||||
|
@ -251,7 +251,7 @@ static void vhost_vdpa_listener_region_add(MemoryListener *listener,
|
|||
return;
|
||||
|
||||
fail_map:
|
||||
if (v->shadow_vqs_enabled) {
|
||||
if (v->shadow_data) {
|
||||
vhost_iova_tree_remove(v->iova_tree, mem_region);
|
||||
}
|
||||
|
||||
|
@ -296,7 +296,7 @@ static void vhost_vdpa_listener_region_del(MemoryListener *listener,
|
|||
|
||||
llsize = int128_sub(llend, int128_make64(iova));
|
||||
|
||||
if (v->shadow_vqs_enabled) {
|
||||
if (v->shadow_data) {
|
||||
const DMAMap *result;
|
||||
const void *vaddr = memory_region_get_ram_ptr(section->mr) +
|
||||
section->offset_within_region +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue