Message ID | 20231020161529.355083-2-dwmw2@infradead.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp1168681vqb; Fri, 20 Oct 2023 09:16:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZdjzF9eTPGnsR+bighVedLpgQAJx0ZbjJP/ya/3MivqnyPUFVWQr4QHL76s9sPBaczIEk X-Received: by 2002:a05:6a00:150a:b0:68e:3772:4e40 with SMTP id q10-20020a056a00150a00b0068e37724e40mr2407939pfu.3.1697818581010; Fri, 20 Oct 2023 09:16:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697818580; cv=none; d=google.com; s=arc-20160816; b=dEf4DYMKpc6AWeYEjaMrO3ZphPlgSUFQKnls0yXdNcI/JkO4f+mBLsGXwH/mR7Jd66 Qj7bR4YE6oeV72tBT1pEt/9PKP6Ksa5HO7mfNM8IHmiE63ZjW7htO2Cs5k2IWlKrn448 /XHvIpjl9ym1yVcaoxKIQm4hA5swGhwS0nH9a/9H6TJgGO3XeEIgnNu/e4xHEIzLqoo/ 6aT5NdsGSMqLrgSi3KG9Fyinte65ArvT4zeVOsl+kWJBAe0Ekg3L2dxYhy1K0J6w/vyx XiuUQGcCPG5rFkn6usuRSGMaAvZ1By4+2cVPSr0QVTIliGCdtj/squMeX1Z1olNlry6C irRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OW6M6axVm5EebrjONkYC4l2vPrYg1mjhksi3LsyyGRs=; fh=hRowg7FHjFkNvsaqzIhvo3cvY/I4Cr+L17V0ykyMVw0=; b=GhpeKgeXnA2Kn7Ma2e0HKB6yDC2jJKsYJffuRfxrB+311Ct8/ophASpuVwul18kJ5o fcjA7FCLqtjOLmDYUzUQX1yywLrO3uNGjUU38b4X2P3HTAREpmsA7MKgv62fLdfFFHjW QihuptZFL7WLwvATfEkAst3H5bTjBZfraiamRIlSwm0EOu73mtp+fL4tnYw/sZlmZahg xA6Guu7U1vJaCc8FV2QVReu95lkByISVvINXm96JExyuqmTl3U+tDCspO/zlFUwmSg15 6yF0bBRNyf2miaLOHs18GKujVATwwLpyuZMRZcXb57FCkr+eyWL92JRyid6gI9flJHMg TP+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=EMC1XQKN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id d20-20020a056a00199400b006bdfb718e04si2301789pfl.338.2023.10.20.09.16.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 09:16:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=EMC1XQKN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id F1A0D836B4F0; Fri, 20 Oct 2023 09:16:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377864AbjJTQQJ (ORCPT <rfc822;a1648639935@gmail.com> + 26 others); Fri, 20 Oct 2023 12:16:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229814AbjJTQQB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 20 Oct 2023 12:16:01 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB9F8D57; Fri, 20 Oct 2023 09:15:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description; bh=OW6M6axVm5EebrjONkYC4l2vPrYg1mjhksi3LsyyGRs=; b=EMC1XQKNq6loHyWtwUrjbzwmwV cAgfQRMd4tmkJ8vfgqiDsAHkfDsIEKFYNphoGgZltm07MeMmeMyO41dK4BLYlKHBUnL8cqRNJUffv zVUHHvzr6M4MMJHsTleqmotIfBWN5RE5+FHp2NiKmK8ql6L7KcoxAfQIzazUnV+8qIv//5YmJyAH9 OxkBx/FtKdKWlxLO5fHYVYMBiLVYGrhC5A2L6h+uGalAtARfBXqSpuBlQovufA2ZACvU44sInMHHX saBDt/gndB0Jsk/Udp6oA3ydy0qG4OQ/poadbKKrrsFCSauxFUH/o6H3FX9ha6MDCtAaqPZVCLSsN QtrjJRcw==; Received: from [2001:8b0:10b:1::ebe] (helo=i7.infradead.org) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qts9v-00BAsE-0Q; Fri, 20 Oct 2023 16:15:36 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1qts9s-001UOW-0m; Fri, 20 Oct 2023 17:15:32 +0100 From: David Woodhouse <dwmw2@infradead.org> To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jirislaby@kernel.org>, Roger Pau Monne <roger.pau@citrix.com>, Stefano Stabellini <sstabellini@kernel.org>, Dawei Li <set_pte_at@outlook.com>, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Paul Durrant <paul@xen.org> Subject: [PATCH v2 1/3] hvc/xen: fix event channel handling for secondary consoles Date: Fri, 20 Oct 2023 17:15:27 +0100 Message-Id: <20231020161529.355083-2-dwmw2@infradead.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231020161529.355083-1-dwmw2@infradead.org> References: <20231020161529.355083-1-dwmw2@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: David Woodhouse <dwmw2@infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from <dwmw2@infradead.org> by desiato.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 20 Oct 2023 09:16:19 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780291816378533952 X-GMAIL-MSGID: 1780291816378533952 |
Series |
hvc/xen: Xen console fixes.
|
|
Commit Message
David Woodhouse
Oct. 20, 2023, 4:15 p.m. UTC
From: David Woodhouse <dwmw@amazon.co.uk> The xencons_connect_backend() function allocates a local interdomain event channel with xenbus_alloc_evtchn(), then calls bind_interdomain_evtchn_to_irq_lateeoi() to bind to that port# on the *remote* domain. That doesn't work very well: (qemu) device_add xen-console,id=con1,chardev=pty0 [ 44.323872] xenconsole console-1: 2 xenbus_dev_probe on device/console/1 [ 44.323995] xenconsole: probe of console-1 failed with error -2 Fix it to use bind_evtchn_to_irq_lateeoi(), which does the right thing by just binding that *local* event channel to an irq. The backend will do the interdomain binding. This didn't affect the primary console because the setup for that is special — the toolstack allocates the guest event channel and the guest discovers it with HVMOP_get_param. Fixes: fe415186b4 ("xen/console: harden hvc_xen against event channel storms") Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Reviewed-by: Juergen Gross <jgross@suse.com> Cc: stable@vger.kernel.org --- drivers/tty/hvc/hvc_xen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Fri, Oct 20, 2023 at 05:15:27PM +0100, David Woodhouse wrote: > From: David Woodhouse <dwmw@amazon.co.uk> > > The xencons_connect_backend() function allocates a local interdomain > event channel with xenbus_alloc_evtchn(), then calls > bind_interdomain_evtchn_to_irq_lateeoi() to bind to that port# on the > *remote* domain. > > That doesn't work very well: > > (qemu) device_add xen-console,id=con1,chardev=pty0 > [ 44.323872] xenconsole console-1: 2 xenbus_dev_probe on device/console/1 > [ 44.323995] xenconsole: probe of console-1 failed with error -2 > > Fix it to use bind_evtchn_to_irq_lateeoi(), which does the right thing > by just binding that *local* event channel to an irq. The backend will > do the interdomain binding. > > This didn't affect the primary console because the setup for that is > special — the toolstack allocates the guest event channel and the guest > discovers it with HVMOP_get_param. > > Fixes: fe415186b4 ("xen/console: harden hvc_xen against event channel storms") Nit, our tools complain that the sha1 isn't big enough, "fe415186b43d" I'll go fix it up...
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c index 98764e740c07..f24e285b6441 100644 --- a/drivers/tty/hvc/hvc_xen.c +++ b/drivers/tty/hvc/hvc_xen.c @@ -433,7 +433,7 @@ static int xencons_connect_backend(struct xenbus_device *dev, if (ret) return ret; info->evtchn = evtchn; - irq = bind_interdomain_evtchn_to_irq_lateeoi(dev, evtchn); + irq = bind_evtchn_to_irq_lateeoi(evtchn); if (irq < 0) return irq; info->irq = irq;