qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [PATCH] memory: Optimize replay of guest mapping


From: Duan, Zhenzhong
Subject: RE: [PATCH] memory: Optimize replay of guest mapping
Date: Wed, 15 Feb 2023 02:59:42 +0000


>-----Original Message-----
>From: Peter Xu <peterx@redhat.com>
>Sent: Wednesday, February 15, 2023 1:29 AM
>To: Duan, Zhenzhong <zhenzhong.duan@intel.com>
>Cc: Jason Wang <jasowang@redhat.com>; qemu-devel@nongnu.org;
>mst@redhat.com; pbonzini@redhat.com; richard.henderson@linaro.org;
>eduardo@habkost.net; marcel.apfelbaum@gmail.com; david@redhat.com;
>philmd@linaro.org
>Subject: Re: [PATCH] memory: Optimize replay of guest mapping
>
>On Tue, Feb 14, 2023 at 07:04:56AM +0000, Duan, Zhenzhong wrote:
>> >> @@ -1936,7 +1935,7 @@ void
>> >> memory_region_iommu_replay(IOMMUMemoryRegion *iommu_mr,
>> >IOMMUNotifier
>> >> *n)
>> >>
>> >>      granularity = memory_region_iommu_get_min_page_size(iommu_mr);
>> >>
>> >> -    for (addr = 0; addr < memory_region_size(mr); addr += granularity) {
>> >> +    for (addr = n->start; addr < n->end; addr += granularity) {
>> >
>> >Is [n->start, n->end] guaranteed to be the subset of
>memory_region_size(mr)?
>>
>> In current implementation it is.
>> [n->start, n->end] of notifier is derived from iommu memory region's
>> section which is a subset of iommu memory region itself.
>
>Yes, currently it seems to be guaranteed by the callers assuming they're
>always doing the right thing.
>
>Maybe it'll worth it to have memory_region_register_iommu_notifier() assert
>properly to make sure it always hold true?

Yea, good suggestion, will do in v2.

Thanks
Zhenzhong

reply via email to

[Prev in Thread] Current Thread [Next in Thread]