Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3674203lfo; Mon, 23 May 2022 11:03:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyN71UKQsNYVoo33SWUPTrxR7Kb1G1Op/WBN1qrTBfgbrGm6zEDukUegzQsNFIDqhdlAg5U X-Received: by 2002:a17:90b:4c84:b0:1e0:663b:f6c with SMTP id my4-20020a17090b4c8400b001e0663b0f6cmr188927pjb.231.1653328995041; Mon, 23 May 2022 11:03:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653328995; cv=none; d=google.com; s=arc-20160816; b=AFpTh7zMxQd6XYcSM0sfrcEXX0ihpShYu/47eqmerz7FYI/68pURnjujrQiRTaxUd3 Pu0otwVAjChQuACd9GeDy2ee4ecjEOsIsu4fSMrk45d1PMWIeRQTtLKcxufvbArWHyev 70uwj3uW6R7klFyfoNiI6pPkGcnsc8hI6zG4fhpPxCOq5e30S0kpFcAJnCNT94UQSBE/ nxEFRr29tqIyR2MVtaQNZmwbpg1bIKgeBGh2890JVW+OW+CCPC2YhUTD/Hd9Kb3nvcBy 64e11RMbV8AKFf5rdlxtlwJG2bY+fD/L7QZSRz2jJZlXciz1StVetP7Nv5oGbm89So66 yMsA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lBFcPtoQJI5SMGRIx2Di89ZYRJ8IzDTUy2w0z6O0IrM=; b=uvToCWWW327ll9LZNPXOq/SZRHfwpRg+mWc9+mBI0h8tKETTOVDzTWVkvnkxSMiysZ DFt8XdbUWn+Aq6TYlNsqufMiYrjyoJoHP/hZUeEiMzxqDenjc3QlVZ/swU/eldAZaULo FUmG22AM4aP3sU/P/jOLAtS7fw235GJh0DmveI9kmBEllKERS3gjutmKuHU+UO7OaxOK HCoj0serb17gnInZ7Kv30KWZz8N7nuv56Z7bR7JeDHNCvzTt73Nft8TBIOUyIG45HOyI 2mEVDbI47vbCi2m15cGMmSp9yQFYk9RbULX3g1erfedVXVifKS+9aJPFghyj+OqMKlgG WrKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oMcQ5f4w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e17-20020a170902ef5100b00158d6dbbfc2si10637470plx.145.2022.05.23.11.03.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 11:03:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oMcQ5f4w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 918FD93990; Mon, 23 May 2022 11:00:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241556AbiEWR7D (ORCPT + 99 others); Mon, 23 May 2022 13:59:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242072AbiEWRbx (ORCPT ); Mon, 23 May 2022 13:31:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FE827093B; Mon, 23 May 2022 10:27:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AF6DE611C2; Mon, 23 May 2022 17:26:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3343C385A9; Mon, 23 May 2022 17:26:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653326793; bh=/oU6JTFjoCPlkwzZtxF5z5nHNFqJRDCxPamXkPOwE5o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oMcQ5f4w66iMC/61vipMKt5ZcoWaG/Xvjk5kuYxKKio1n1fis/aEdjIZFgezxx3is +ORVCbXH/7P7DTZ0ZV9U+cFkE2z//r+U+fjsmHvPu4jR065nuoIr6w4LJ6g6FQOO7u x+VG0FG+wloDdFxnxEKNbJoHLs3sNrINz12XBwJo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhu Lingshan , "Michael S. Tsirkin" , Sasha Levin Subject: [PATCH 5.17 033/158] vhost_vdpa: dont setup irq offloading when irq_num < 0 Date: Mon, 23 May 2022 19:03:10 +0200 Message-Id: <20220523165835.986407483@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165830.581652127@linuxfoundation.org> References: <20220523165830.581652127@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Zhu Lingshan [ Upstream commit cce0ab2b2a39072d81f98017f7b076f3410ef740 ] When irq number is negative(e.g., -EINVAL), the virtqueue may be disabled or the virtqueues are sharing a device irq. In such case, we should not setup irq offloading for a virtqueue. Signed-off-by: Zhu Lingshan Link: https://lore.kernel.org/r/20220222115428.998334-3-lingshan.zhu@intel.com Signed-off-by: Michael S. Tsirkin Signed-off-by: Sasha Levin --- drivers/vhost/vdpa.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index ec5249e8c32d..05f5fd2af58f 100644 --- a/drivers/vhost/vdpa.c +++ b/drivers/vhost/vdpa.c @@ -97,8 +97,11 @@ static void vhost_vdpa_setup_vq_irq(struct vhost_vdpa *v, u16 qid) return; irq = ops->get_vq_irq(vdpa, qid); + if (irq < 0) + return; + irq_bypass_unregister_producer(&vq->call_ctx.producer); - if (!vq->call_ctx.ctx || irq < 0) + if (!vq->call_ctx.ctx) return; vq->call_ctx.producer.token = vq->call_ctx.ctx; -- 2.35.1