From nobody Thu May 2 22:50:03 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=umn.edu ARC-Seal: i=1; a=rsa-sha256; t=1576616094; cv=none; d=zohomail.com; s=zohoarc; b=iA2oMhqzM0ApZnVZKPJ7giDKcXjzX0KlB+PnqXJV1/Vu3Hjmm7IK6WV666PeM2ze63LytMhvj26BBJ1apxoAt9tbgtajhhikp8GmLHh79CVs++cRGSCuvDPJ/+wHMPMhVv3sS+qzjurRsFY9kbsnI/ma6V1NglupuON3p0h9KuA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576616094; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=1imy04RxZCd4J/He1ZdRBeFIu3QSsJIoei4E1gtigsE=; b=PaYlDxruRH0wcXNZ5TpFwLHeAonFn/FMko7OpU9qvmCdFPydZ2g5AL27ONIOysOOb9Lbka7x/0+zx+W+3dbwiL5+53cj3pMlslhelAqH/5jo9q8D9BxTjwobO41zmtGQeTbjKvYnsIYMDS5BmbYzH2q9sg2geNA+SV2XMOQ2J0s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1576616094462874.4464919188746; Tue, 17 Dec 2019 12:54:54 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ihJr9-0000hI-2N; Tue, 17 Dec 2019 20:54:11 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ihJr7-0000hD-Mx for xen-devel@lists.xenproject.org; Tue, 17 Dec 2019 20:54:09 +0000 Received: from mta-p7.oit.umn.edu (unknown [134.84.196.207]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 59b3d9ca-210f-11ea-a1e1-bc764e2007e4; Tue, 17 Dec 2019 20:54:00 +0000 (UTC) Received: from localhost (unknown [127.0.0.1]) by mta-p7.oit.umn.edu (Postfix) with ESMTP id 47cr3D091Nz9vLGV for ; Tue, 17 Dec 2019 20:54:00 +0000 (UTC) Received: from mta-p7.oit.umn.edu ([127.0.0.1]) by localhost (mta-p7.oit.umn.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jBcfM2gpgR21 for ; Tue, 17 Dec 2019 14:53:59 -0600 (CST) Received: from mail-yb1-f198.google.com (mail-yb1-f198.google.com [209.85.219.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mta-p7.oit.umn.edu (Postfix) with ESMTPS id 47cr3C61SPz9vLGj for ; Tue, 17 Dec 2019 14:53:59 -0600 (CST) Received: by mail-yb1-f198.google.com with SMTP id y204so7986663yby.18 for ; Tue, 17 Dec 2019 12:53:59 -0800 (PST) Received: from cs-u-syssec1.dtc.umn.edu (cs-u-syssec1.cs.umn.edu. [128.101.106.66]) by smtp.gmail.com with ESMTPSA id d143sm8500294ywb.51.2019.12.17.12.53.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2019 12:53:58 -0800 (PST) X-Inumbo-ID: 59b3d9ca-210f-11ea-a1e1-bc764e2007e4 X-Virus-Scanned: amavisd-new at umn.edu DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umn.edu; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=knhSf+eyCdoX1uYdgnl9DAzGqM/zDzsAxGOMt75GOeY=; b=KW9uxdKVEE1cGboEmFPtl1bF+X0FhEtizkUnApethUm/LhLaZszjO3xBtQCAIuI1Ar 2SK9l6JiGdphs8PEFxbVTQKAQwDAMzijOfUw5x+JwRfDC0O2cl0a5F8oG6ejZ1SW6zSp wabutn9GBBX35Wf0/fzS8xQx0FrLU4eRhy+S6/sd4As/7jaNgpHp6v8+h0eXo0fjxpXK h3TNpQsiC5U2tXb6B6bNEe1uKsFyO+HSBQSNyaaHaU5ZfeItF9bnUV/KcT4LyRMoueDM TK41NghYcTzCTo3hT5T68vg3M/V55K02wE8nLdtdqfhBmNvgBcObaDY+P8lfgJ4ITY2D 3FIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=knhSf+eyCdoX1uYdgnl9DAzGqM/zDzsAxGOMt75GOeY=; b=OGGHVKk6Z3FoN3kZe+2QIEgCCeJKB9IWSYAz8WoRh12Z2OGoXgnmRRLys10sgxzn2L yLery2pY03+GHUkEiNmhZZB/LMVi+CDIewFMsjei0qAIvvdtQFtYMMSm5WpmaZXC3umU 7sLcv2ouU5xPSMnPnjhocw8MiYXoVQVghIdC/jNEJVsT4biZgjSKSUtSmn9qa8HnRgUy Ikj6j89ZLfWg5jdiZpipSaFt8nXhKYnjn0mozqld3tAx+E3tdvLA3aBs+Z+Y7mQKt04J sxiE54D+SE3+ln9V5tDwD2/fALHmM6xpDEttjeaWEZlMH3PGjy5ulaFKJq37MJbA7sFA 8Wuw== X-Gm-Message-State: APjAAAXHeXKkj1/9Eu1QujWa0wKfOHqOsMv1DdU1kt2baAk9jc2P4q0g J93ziYMWDU0rlf7y3EZrYC8r7bUArAKvGOGGpmi2a1ks+kOIxaK6u7aI+qN/iDojbRPks3+8LF2 0ggCixtJTXXK1fzJraQHuyrG78fj4wnc= X-Received: by 2002:a25:dd04:: with SMTP id u4mr21884ybg.419.1576616039238; Tue, 17 Dec 2019 12:53:59 -0800 (PST) X-Google-Smtp-Source: APXvYqzgA5SI4ho9qhM2qkA9c0wLxK4/wVAABvXhm0AgOJCd5pQ/kuKS89YzxeQKtfbjs+EEsNCSGQ== X-Received: by 2002:a25:dd04:: with SMTP id u4mr21862ybg.419.1576616039020; Tue, 17 Dec 2019 12:53:59 -0800 (PST) From: Aditya Pakki To: pakki001@umn.edu Date: Tue, 17 Dec 2019 14:53:56 -0600 Message-Id: <20191217205356.29172-1-pakki001@umn.edu> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2] xen/grant-table: remove multiple BUG_ON on gnttab_interface X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , kjlu@umn.edu, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, Boris Ostrovsky Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) gnttab_request_version() always sets the gnttab_interface variable and the assertions to check for empty gnttab_interface is unnecessary. The patch eliminates multiple such assertions. Signed-off-by: Aditya Pakki Reviewed-by: Juergen Gross --- v1: Eliminate more BUG_ON calls, as suggested by Juergen Gross. --- drivers/xen/grant-table.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c index 49b381e104ef..7b36b51cdb9f 100644 --- a/drivers/xen/grant-table.c +++ b/drivers/xen/grant-table.c @@ -664,7 +664,6 @@ static int grow_gnttab_list(unsigned int more_frames) unsigned int nr_glist_frames, new_nr_glist_frames; unsigned int grefs_per_frame; =20 - BUG_ON(gnttab_interface =3D=3D NULL); grefs_per_frame =3D gnttab_interface->grefs_per_grant_frame; =20 new_nr_grant_frames =3D nr_grant_frames + more_frames; @@ -1160,7 +1159,6 @@ EXPORT_SYMBOL_GPL(gnttab_unmap_refs_sync); =20 static unsigned int nr_status_frames(unsigned int nr_grant_frames) { - BUG_ON(gnttab_interface =3D=3D NULL); return gnttab_frames(nr_grant_frames, SPP); } =20 @@ -1388,7 +1386,6 @@ static int gnttab_expand(unsigned int req_entries) int rc; unsigned int cur, extra; =20 - BUG_ON(gnttab_interface =3D=3D NULL); cur =3D nr_grant_frames; extra =3D ((req_entries + gnttab_interface->grefs_per_grant_frame - 1) / gnttab_interface->grefs_per_grant_frame); @@ -1423,7 +1420,6 @@ int gnttab_init(void) /* Determine the maximum number of frames required for the * grant reference free list on the current hypervisor. */ - BUG_ON(gnttab_interface =3D=3D NULL); max_nr_glist_frames =3D (max_nr_grant_frames * gnttab_interface->grefs_per_grant_frame / RPP); =20 --=20 2.20.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel