Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp687331imw; Fri, 8 Jul 2022 09:53:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sIiJ2xFEFvCg5ixBQUwKlptENo2OXJRZABZXZDgYW3eNoDebKsXympaxiNm/OoYTi22MhB X-Received: by 2002:a05:6402:d54:b0:43a:7044:e32f with SMTP id ec20-20020a0564020d5400b0043a7044e32fmr6074065edb.140.1657299201936; Fri, 08 Jul 2022 09:53:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657299201; cv=none; d=google.com; s=arc-20160816; b=qpdlw0UswypaVi7reX0O7DZNsaVpO2h/yL9bJtUuUPBLPfpSwOIsF6kpJL7LWRON8e VXU4/dHpv6fbr/VEisd3cAqeO70ssJ61QO2IIHEGu2GoHL5IplNV1n02ot0JyXoSd1iQ MxNn3Jg9ABGCu6DcX6ql1Ih8vHPy8LTDGHUCFGz/cuMWkApB59nm9ZoOwUWg1W0wficj ovmIXTwZ4lMDVwrjFSqp8tBQ9RqpL830Yf3BOtaY1SyNo62iZiD1VRW9PirB8ll6XRPu 3lPtJLWuAAmPrqsBCk9aYweTUb9Xf0bMvb2SuwPwRcBafg/n3hVZxCvARQOHHSL45iBc +I4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=ig8GcuWSg8QXfRSyjrDA6qxRNwqouf+sjZK0qbI6A6M=; b=mEJQWhIgIw0IUKFmHGRZmNUAhQWFqTCkUdSoT9+X9WFie/beatdal/0zlJaSoP55h0 aj+vXQbVsgpgkVsyegVrDrN3XUgkUUPOTK6fhUwjzMZgxN+CDfapYOmPCr4J2OvqLDFv nxYr2XvYUm0fvB/5GifVhI8ExWRq0dMm2HW6SQfsDdXuEWr7+YiZqWr+F9yLNb/V/mbk fkZFH2ltZIvOfdBOCW/5Sq1bY5eQOqWplucjuHri5j+oETSMJA6Vn7D5vfwAUVXJlcBd 5GKfBPcR+dg5VPjySvb2U83i2Us2lyFoJgC8VizrPhLd14Dhycwhnpwch3ihb8B2KwIQ wtDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@invisiblethingslab.com header.s=fm2 header.b=UMimGG2U; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=KW6PkF5v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cq6-20020a056402220600b0043a9ba73187si6109577edb.289.2022.07.08.09.52.56; Fri, 08 Jul 2022 09:53:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@invisiblethingslab.com header.s=fm2 header.b=UMimGG2U; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=KW6PkF5v; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238487AbiGHQij (ORCPT + 99 others); Fri, 8 Jul 2022 12:38:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238182AbiGHQie (ORCPT ); Fri, 8 Jul 2022 12:38:34 -0400 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5529EE02B; Fri, 8 Jul 2022 09:38:33 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 15C16320098B; Fri, 8 Jul 2022 12:38:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 08 Jul 2022 12:38:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1657298311; x=1657384711; bh=ig8GcuWSg8QXfRSyjrDA6qxRNwqouf+sjZK 0qbI6A6M=; b=UMimGG2Uo4lY7atREe2OP8S17UwSlHLVe/8rwvtepafcUCIerM/ +faYLQMq+QWk2ePkEKdH0xisdPrkUY8RM9HfbybzshoqXScDXiWukeOrL8SBiC7q 2bYf7P7djsCJm4p3x9qG9ovXkVz/nuxRmuH/JUDYCnAdC0pxNACm1AAb33Z9rpEt uFcN0NbUHA2r7MLfrnH7a/qwob9ehzd/2Wh/ETUf0iH2lWlBpIMGjq7IiY046E80 OgNKBOHEZE63eLhNRPmXdYjbGVAnVYvjarOgO6Jg83zGr23/yK4kAfsCaiwfMnTm zBpmMftHJCm+TP4J8BoN0zlc3y0JpPN4JjQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1657298311; x=1657384711; bh=ig8GcuWSg8QXf RSyjrDA6qxRNwqouf+sjZK0qbI6A6M=; b=KW6PkF5vTTfz/RditvRVGIbRHVSo2 hJGbgtx3KXGhhsTRKqRnP+nWRgfxd79rqg4T3AXAnxqw7p1zunuMAGmkTZ6PKogF z2phKIH8YtcZMqizRwy9TqWcgctfhiWX5BVG6uGylSxM1xEjlVAsePMbGRviqOtY QMm6JSAdF9T3DPgMO8DKwAWm/1RIAf4qaFx3ql+dXq97Uaas+PJws0B+Rl56YoAo 4t9O60v4OzSZ6uH0x4zdd1gNwEI163U1noKNYLtsb7lK8BcNDDwThumvP2n3uGVm hh/TH9YT+otbypQrg35LjestKqW97vZdxb36ixcW3O+eKJK0OaYMD1gxg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudeijedguddtfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffvghm ihcuofgrrhhivgcuqfgsvghnohhurhcuoeguvghmihesihhnvhhishhisghlvghthhhinh hgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeejffejgffgueegudevvdejkefg hefghffhffejteekleeufeffteffhfdtudehteenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpeguvghmihesihhnvhhishhisghlvghthhhinhhg shhlrggsrdgtohhm X-ME-Proxy: Feedback-ID: iac594737:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 8 Jul 2022 12:38:30 -0400 (EDT) From: Demi Marie Obenour To: Juergen Gross , Greg KH , Stefano Stabellini , Oleksandr Tyshchenko , Demi Marie Obenour Cc: Linux kernel regressions , stable@vger.kernel.org, Linux kernel mailing list , Xen developer discussion Subject: [PATCH 4.14] Ignore failure to unmap -1 Date: Fri, 8 Jul 2022 12:37:46 -0400 Message-Id: <20220708163750.2005-3-demi@invisiblethingslab.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220708163750.2005-1-demi@invisiblethingslab.com> References: <20220708163750.2005-1-demi@invisiblethingslab.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The error paths of gntdev_mmap() can call unmap_grant_pages() even though not all of the pages have been successfully mapped. This will trigger the WARN_ON()s in __unmap_grant_pages_done(). The number of warnings can be very large; I have observed thousands of lines of warnings in the systemd journal. Avoid this problem by only warning on unmapping failure if the handle being unmapped is not -1. The handle field of any page that was not successfully mapped will be -1, so this catches all cases wherr unmapping can legitimately fail. Suggested-by: Juergen Gross Cc: stable@vger.kernel.org Signed-off-by: Demi Marie Obenour Fixes: 2fe26a9a7048 ("xen/gntdev: Avoid blocking in unmap_grant_pages()") --- drivers/xen/gntdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index 2827015604fbaa45f0ca60c342bbf71ce4132dec..799173755b785e2f3e2483855f75af1eba8e9373 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c @@ -393,7 +393,8 @@ static void __unmap_grant_pages_done(int result, unsigned int offset = data->unmap_ops - map->unmap_ops; for (i = 0; i < data->count; i++) { - WARN_ON(map->unmap_ops[offset+i].status); + WARN_ON(map->unmap_ops[offset+i].status && + map->unmap_ops[offset+i].handle != -1); pr_debug("unmap handle=%d st=%d\n", map->unmap_ops[offset+i].handle, map->unmap_ops[offset+i].status); -- Sincerely, Demi Marie Obenour (she/her/hers) Invisible Things Lab