From patchwork Tue Nov 3 20:34:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 317154 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E82B9C2D0A3 for ; Tue, 3 Nov 2020 20:53:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A9477223BF for ; Tue, 3 Nov 2020 20:53:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604436799; bh=Rwx0OUtf9ciC9CjFxF8pK/9cDjSWHEq82aK1Iv1sdAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=AgvLudDyGeE1bt1jmwzCQ6c70SyelivZytzy0yWfJv7/YccCKjSJ2b2U6Iv8QEJJX QRbmydEmdQc7vMibCaQghr8C3KFGSZ6a7akCuomWSFeToSaq+AiHAmyrlbyXOIGg8b SbCb2kFVUQleGZgvsJjnY9wL4a7u22+lHomiEVo8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732214AbgKCUxF (ORCPT ); Tue, 3 Nov 2020 15:53:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:50578 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730684AbgKCUxE (ORCPT ); Tue, 3 Nov 2020 15:53:04 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AE6E2223BF; Tue, 3 Nov 2020 20:53:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604436784; bh=Rwx0OUtf9ciC9CjFxF8pK/9cDjSWHEq82aK1Iv1sdAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ixK6FgvAAm/ELq9iTzF+DgNKm5ujFOZlPmO8ZGSlgV9VKziOzkvsuhbWo3/pDPMcO OwAR1yHfm0PAmGK70R6Zb81/mWlMAxj4ZSVtDvi2puinWUJVSnvssBUofYToSSV2Hx ga78T3RfeQSF2XpjEXnO8FGHmN33NPKygomJ9xe8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julien Grall , Juergen Gross , Stefano Stabellini , Jan Beulich , Wei Liu Subject: [PATCH 5.4 010/214] xen/events: switch user event channels to lateeoi model Date: Tue, 3 Nov 2020 21:34:18 +0100 Message-Id: <20201103203250.652542668@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Juergen Gross commit c44b849cee8c3ac587da3b0980e01f77500d158c upstream. Instead of disabling the irq when an event is received and enabling it again when handled by the user process use the lateeoi model. This is part of XSA-332. Cc: stable@vger.kernel.org Reported-by: Julien Grall Signed-off-by: Juergen Gross Tested-by: Stefano Stabellini Reviewed-by: Stefano Stabellini Reviewed-by: Jan Beulich Reviewed-by: Wei Liu Signed-off-by: Greg Kroah-Hartman --- drivers/xen/evtchn.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/drivers/xen/evtchn.c +++ b/drivers/xen/evtchn.c @@ -166,7 +166,6 @@ static irqreturn_t evtchn_interrupt(int "Interrupt for port %d, but apparently not enabled; per-user %p\n", evtchn->port, u); - disable_irq_nosync(irq); evtchn->enabled = false; spin_lock(&u->ring_prod_lock); @@ -292,7 +291,7 @@ static ssize_t evtchn_write(struct file evtchn = find_evtchn(u, port); if (evtchn && !evtchn->enabled) { evtchn->enabled = true; - enable_irq(irq_from_evtchn(port)); + xen_irq_lateeoi(irq_from_evtchn(port), 0); } } @@ -392,8 +391,8 @@ static int evtchn_bind_to_user(struct pe if (rc < 0) goto err; - rc = bind_evtchn_to_irqhandler(port, evtchn_interrupt, 0, - u->name, evtchn); + rc = bind_evtchn_to_irqhandler_lateeoi(port, evtchn_interrupt, 0, + u->name, evtchn); if (rc < 0) goto err;