[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] xen/x86: io_apic: Introduce a command line option to skip timer check


  • To: Julien Grall <julien@xxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 18 Sep 2023 09:54:48 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ko0JUAe08HddhzexIKzcPDRIpATwf0Fys2twc6WtFbA=; b=B+8EYOCKa9On7D3lNeUhj5hRtfff5guzJZ9F/JVk16XBHnwSqcRcFoAqL3vYkDI8R+k7Gsdcu7MFZ1IZeOnrzZ8iXHQK5UnpJ8gzBO5eYLRCLZZHH3+gBp3pU21CbtpbiKFUzNF3SHqMHOalyJeVy3jjROPTmAQ5LhEhDFNn0O366fvqGVaJRgFJlkJI5ozZ22AGnlgoc0lINDH1TxaYDYD3DYUVr8zg6DuAwDUAb6PfKQn44m45nrSXF/zIDOI2pXKD8Xy80g25MB6GC2xu9v3AByi3Pgfog8V51YakhBxHH9mPGioMi1XDxaQxLurT6HCNKhFoELbiWJO8X9VJGA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XAE2yU4qhr9R1M7WCTBC2Q+bR1/GM4MbSj6YKDKArMGXycQaO1vkHeSmsVqQXcwGDhEtQsWbxCy+Afan8pRhQqVKfk83iEGkFWXDa5w8XLNN9NcpzjLapB7G1oRd2uA9WugRFJZeCSMT/7yLBJMk3L1hC8yLG3W7zpZvTz3SmZ5TaGXyl0VYpMxCUnvunvpuePyjqhgaWYrAogbwQrxna0Rvdv6SXAajloo8upI60PbkgO4/8TwK4XHdBeciQiPv1371wgV4ByAX0bfC2VRnHwYpfZvGHWtYjbBDjKtPxKU5ORY1zn6IFiBJW/opAySb0qoW/wsqLTduTf94VZKYew==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Julien Grall <jgrall@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 18 Sep 2023 07:55:15 +0000
  • Ironport-data: A9a23:XGYM/63eH7KyppPbn/bD5Qhwkn2cJEfYwER7XKvMYLTBsI5bp2AOn 2QXDWiDO62MamOheoglaoW+o04DusfRxtFkQAY/pC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliOfQAOK6UbaYUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8teTb8nuDgNyo4GlD5g1nNagS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfBXxcy O41aw43fFOPrsGEw4KRGvlmr5F2RCXrFNt3VnBI6xj8VK5ja7acBqLA6JlfwSs6gd1IEbDGf c0FZDFzbRPGJRpSJlMQD5F4l+Ct7pX9W2QA9BTJ+uxouy6KlFUZPLvFabI5fvSQQspYhACAr 3/u9GXlGBAKcteYzFJp91r13LWewH+gBNx6+LuQ8NhIj3CemXUoLBQ7Emq+/vS8pR75YocKQ 6AT0m90xUQoz2SpU938UhuQsHOC+BkGVLJ4A+A8rQ2A1KfQywKYHXQfCC5MbsQ8s807TiBs0 UWG9/vrCiZmtLm9QHeU5LCS6zi1PEA9L2UPeCsFRgst+MT4rcc4iRenZs14DKe/g9nxGDfx6 zOHti4zg/MUl8Fj/7q/1UDKhXSrvJehc+IuzgDeX2bg5AUmYoegPtSs8QKCta8GK5uFRF6cu nRCg9KZ8O0FEZCKkmqKXfkJG7aqof2CNVUwnGJSInXozBz1k1bLQGyayGgWyJtBWircRQLUX Q==
  • Ironport-hdrordr: A9a23:a9SrYq5QNI68QV0XfAPXwMzXdLJyesId70hD6qkXc20zTiX4rb HLoB1/73TJYVkqNE3I9eruBEDjex3hHO9OgbX5VI3KNGOKhILCFuBfBOXZsl/dMhy72ulB1b pxN4hSYeeAaGSSVPyKgzWFLw==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Sep 15, 2023 at 03:27:40PM +0100, Julien Grall wrote:
> Hi Roger,
> 
> On 15/09/2023 14:54, Roger Pau Monné wrote:
> > On Fri, Aug 18, 2023 at 02:44:40PM +0100, Julien Grall wrote:
> > > From: Julien Grall <jgrall@xxxxxxxxxx>
> > > 
> > > Currently, Xen will spend ~100ms to check if the timer works. If the
> > > Admin knows their platform have a working timer, then it would be
> > > handy to be able to bypass the check.
> > 
> > I'm of the opinion that the current code is at least dubious.
> > 
> > Specifically attempts to test the PIT timer, even when the hypervisor
> > might be using a different timer.  At which point it mostly attempts
> > to test that the interrupt routing from the PIT (or it's replacement)
> > is correct, and that Xen can receive such interrupts.
> > 
> > We go to great lengths in order to attempt to please this piece of
> > code, even when no PIT is available, at which point we switch the HPET
> > to legacy replacement mode in order to satisfy the checks.
> > 
> > I think the current code is not useful, and I would be fine if it was
> > just removed.
> 
> I am afraid I don't know enough the code to be able to say if it can be
> removed.
> 
> I also have no idea how common are such platforms nowadays (I suspect it is
> rather small). Which I why I went with a command line option.

It was more of a grumble rather than a request for you to remove the
code.  I've been meaning to look into this myself for some time, as we
just keep accumulating bodges in order to keep the test happy.

We don't seem to perform such tests for any other interrupt sources
that Xen uses (or timer), so I find it kind of odd.  I guess at one
point the PIT was always used, and hence it was relevant to test for
it unconditionally, but that's not the case anymore.

> 
> > 
> > > 
> > > Introduce a command line option 'no_timer_check' (the name is
> > > matching the Linux parameter) for this purpose.
> > > 
> > > Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>
> > > ---
> > >   docs/misc/xen-command-line.pandoc |  7 +++++++
> > >   xen/arch/x86/io_apic.c            | 11 +++++++++++
> > >   2 files changed, 18 insertions(+)
> > > 
> > > diff --git a/docs/misc/xen-command-line.pandoc 
> > > b/docs/misc/xen-command-line.pandoc
> > > index 4872b9098e83..1f9d3106383f 100644
> > > --- a/docs/misc/xen-command-line.pandoc
> > > +++ b/docs/misc/xen-command-line.pandoc
> > > @@ -1896,6 +1896,13 @@ This option is ignored in **pv-shim** mode.
> > >   ### nr_irqs (x86)
> > >   > `= <integer>`
> > > +### no_timer_works (x86)
> > 
> > I find the naming confusing, and I would rather avoid negative named
> > booleans.
> > 
> > Maybe it should be `check_pit_intr` and default to enabled for the
> > time being?
> Jan suggested to use timer-irq-works. Would you be happy with the name?

Hm, pit_irq_works might be better IMO, but I could live with
timer_irq_works (with either _ or -).

> > Note that if you don't want to run the test in timer_irq_works() you
> > can possibly avoid the code in preinit_pit(), as there no need to
> > setup channel 0 in periodic mode then.
> 
> The channel also seems to be used as a fallback method for calibrating the
> APIC (see calibrate_APIC_clock()). AFAICT, the fallback method should only
> be used when the PIT is enabled.

Yes, I see.  I think most systems from the last decade will have TSC
deadline timer support, and hence don't engage in the calibration.  We
should see about switching the calibration to use the selected timer,
instead of forcing the usage of the PIT.

> I think it would still be feasible to avoid running the IRQ tests even when
> PIT is used. So it means, we cannot skip preinit_pit().

Yeah, so we seem to have a couple of usages of the Channel 0 counter
that don't rely on the interrupt at all.

> As a side note, I noticed that preinit_pit() is called during resume. But I
> can't find any use of channel 0 after boot. So maybe the call could be
> removed?

See _disable_pit_irq(), there's a relation between the PIT and
cpuidle.

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.