From nobody Thu Nov 13 21:53:33 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.intel.com ARC-Seal: i=1; a=rsa-sha256; t=1583205521; cv=none; d=zohomail.com; s=zohoarc; b=VEiE/MbX9zUZ+ayHTI1m+9o3Guqgo/OmPBEa1wcHPiPOE8vzf8+fVkD5rlzZDVMWGxR2RIVk4Ma/88jCKqrdGsCwvUuVlc9N1Mo5hcQpkdS9DAMmNytQnY9c/oZRRLpV46/+54LdrpjEwLD6MHhd5TntBToUfXSzJ08RRv1Gu2Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583205521; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=yR7Wsi82yVDUfwghA+17ixvSd3c+Ig9Rj4cWbJfKMYo=; b=J85m63XaYD3yRGujvT75yOeFej5ObctsnjFB7ICmaX59WBEtouYjPgV+lDaGqPEkYpoU2RLYWO7DPL+ZeHiZk1umAieXZKNOZJImq72WtBgKIgJuitNOb9uxy+q/hB7D4UWiI6gWqOCZIFB0uf+iFJPtMTclf2Y8wgJYR1hXgcg= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1583205521807885.7979235896903; Mon, 2 Mar 2020 19:18:41 -0800 (PST) Received: from localhost ([::1]:41356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j8y4u-0006Dz-13 for importer@patchew.org; Mon, 02 Mar 2020 22:18:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59171) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j8y49-0005mS-ML for qemu-devel@nongnu.org; Mon, 02 Mar 2020 22:17:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j8y44-00013M-NE for qemu-devel@nongnu.org; Mon, 02 Mar 2020 22:17:53 -0500 Received: from mga14.intel.com ([192.55.52.115]:57394) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j8y44-0000k2-FC for qemu-devel@nongnu.org; Mon, 02 Mar 2020 22:17:48 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Mar 2020 19:16:42 -0800 Received: from yisun1-ubuntu.bj.intel.com ([10.238.156.100]) by fmsmga001.fm.intel.com with ESMTP; 02 Mar 2020 19:16:40 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,509,1574150400"; d="scan'208";a="351722170" From: Yi Sun To: qemu-devel@nongnu.org Subject: [PATCH v1] memory: remove assert to avoid unnecessary coredump Date: Tue, 3 Mar 2020 11:11:14 +0800 Message-Id: <20200303031114.21111-1-yi.y.sun@linux.intel.com> X-Mailer: git-send-email 2.15.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.115 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, yan.y.zhao@intel.com, Yi Sun Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=3D0xfee00000, entry_end=3D0xfefff= fff, notifier->start=3D0xfef00000, notifier->end=3D0xffffffffffffffff Skip this notification but not coredump makes everything work well. Signed-off-by: Yi Sun --- 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 *notifi= er, * 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; } =20 - assert(entry->iova >=3D notifier->start && entry_end <=3D notifier->en= d); - if (entry->perm & IOMMU_RW) { request_flags =3D IOMMU_NOTIFIER_MAP; } else { --=20 2.15.1