[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1] memory: remove assert to avoid unnecessary coredump
From: |
Yan Zhao |
Subject: |
Re: [PATCH v1] memory: remove assert to avoid unnecessary coredump |
Date: |
Mon, 2 Mar 2020 22:36:39 -0500 |
User-agent: |
Mutt/1.9.4 (2018-02-28) |
On Tue, Mar 03, 2020 at 11:11:14AM +0800, Yi Sun wrote:
> It is too strict to use assert to make qemu coredump if
> the notification does not overlap with registered range.
> Skip it is fine enough.
>
> During test, we found such a case for vhost net device:
> memory_region_notify_one: entry->iova=0xfee00000, entry_end=0xfeffffff,
> notifier->start=0xfef00000, notifier->end=0xffffffffffffffff
>
so for range from 0xfef00000 to 0xfefffff, would notification for this
range get lost?
Thanks
Yan
> Skip this notification but not coredump makes everything
> work well.
>
> Signed-off-by: Yi Sun <address@hidden>
> ---
> memory.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/memory.c b/memory.c
> index 06484c2bff..62ad0f3377 100644
> --- a/memory.c
> +++ b/memory.c
> @@ -1921,12 +1921,11 @@ void memory_region_notify_one(IOMMUNotifier *notifier,
> * Skip the notification if the notification does not overlap
> * with registered range.
> */
> - if (notifier->start > entry_end || notifier->end < entry->iova) {
> + if (notifier->start > entry_end || notifier->end < entry->iova ||
> + entry->iova < notifier->start || entry_end > notifier->end) {
> return;
> }
>
> - assert(entry->iova >= notifier->start && entry_end <= notifier->end);
> -
> if (entry->perm & IOMMU_RW) {
> request_flags = IOMMU_NOTIFIER_MAP;
> } else {
> --
> 2.15.1
>