[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: Fri, 15 Sep 2023 15:54:55 +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=VqzIqAoJse/aZK/elI2KQubZSp38vs0zYutkw2BpGNM=; b=dyAq6p7NTWt6wkhYjNAVWubnYmK3Z/LycxP9Fr7yVxKxgJrZmkBHnQrfQBQa3oti+x7djfv9DKIlsap5fE33s7XNuvv9l3UfPU7Erg+G11nCEtXRSHoikVHYnK8eSCXPZhl77xDb12bAvAbnozJObS8lZiRiqywuaJsjJSPHF2ChzlJ27JPIlthXNuyxsqFqoAIv9qklZm01TTb5+EiLxBVgg1MhHqoNBZhgKTCjpZn2HmgCvo/uwk/BtlC+CyXLwUGUa+Hq8oBEVVrbSfmYGuURtFwqJVo4ZdINS85wOwGzXMY86Zy6hzDhjU1JCc+locL37xEljY2ptfbZALFCPA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d4PSeN3GBLJsNJlAhZXweQWU8az7aTFczqzvKYsB58sERkEl9+x65n+ShgzW4MtO/whZC37ocHxStGsd/cEm5Ln1ibZR8oGpxXb69S1j1schk3hOMYdMNv9LZRZPC7JOtzRmXhWqcvaPjS9OeVDDabDYU+8BncT5AThDe3ykBxyfRdbzdfchkgZtn9YI5JcSB9KQoz76rSCr5ujalcKPj5YqS5uedXbJTLMk9i+8ag2UGZDr0XG+keUUDTqyF4162J6au9TTtU6E/Z93P3Cjqqz4ul8rXDFWVDp0JGIuhNeCfDij3JyluTX8E2U4JAkWrPLRyep8l44JYxmj4XDBnQ==
  • 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: Fri, 15 Sep 2023 13:55:16 +0000
  • Ironport-data: A9a23:J7FcGK/Cg2SoBDnZR4R5DrUDW3+TJUtcMsCJ2f8bNWPcYEJGY0x3z jAfCDrQa/zcZGH2e4xwaYqy8kMP65fTmtNrHAJsry48E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjVAOK6UKidYnwZqTZMEE8JkQhkl/MynrlmiN24BxLlk d7pqojUNUTNNwRcawr40Ird7ks11BjOkGlA5AdmNKkW5AW2e0Q9V/rzG4ngdxMUfaEMdgKKb 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDklB9 9oWdwkIbCqixNyn++OgcNtnluoseZyD0IM34hmMzBn/JNN/GNXvZvuP4tVVmjAtmspJAPDSI dIDbiZiZwjBZBsJPUoLDJU5n6GjgXyXnz9w8QrJ4/ZopTWMilUujNABM/KMEjCObd9SkUuC4 HrP4kzyAw0ANczZwj2Amp6prraVx3yrCNlJT9VU8NZbsUTM7F0yDSEWbmC0h8GilxeOAN1mf hl8Fi0G6PJaGFaQZtvgWxy1plaUsxhaXMBfe8Uq5QfIxqfK7gKxAmkfUiUHeNEgrNUxRzEhy hmOhdyBLT5gqrSRTVqU876GqjX0Mi8QRUcAbyIZSQoO4/H4vZo+yBnIS75LC7Wph9f4HTXxx TGiryUkgbgXy8kR2M2T4lTvkz+q4J/TQWYICh7/W2uk6kZ1YdCjbonxsFzDt68fcMCeU0WLu 2UCl46G9ucSAJqRlSuLBuIQALWu4PXDOzrZ6bJyI6QcG/2W0ybLVehtDPtWfS+F7u5slefVX XLu
  • Ironport-hdrordr: A9a23:SS2blqoczK+oW1xevZG6vjcaV5oueYIsimQD101hICG9E/bo8f xG+c5x6faaskd0ZJhNo7C90cq7MBThHPxOjLX5VI3KNGPbUQ2TXeJfBODZsljd8kPFh4xgPJ BbH5SW2eeQMbAq5fyV3OHne+xO/OW6
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

> 
> 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?

> +> `=<boolean>`
> +
> +> Default: `true`

I think the default is wrong here?  AFAICT no_timer_check will default
to false.

> +
> +Disables the code which tests for broken timer IRQ sources.

Hm, yes, it does check for one specific source, which doesn't need to
be the currently selected timer.

"Disables the code which tests interrupt injection from the legacy
i8259 timer."

Even that is not fully true, as it would resort to testing the HPET
legacy mode if PIT doesn't work, but one could argue the HPET legacy
mode is just a replacement for the i8254.

> +
>  ### irq-max-guests (x86)
>  > `= <integer>`
>  
> diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
> index b3afef8933d7..4875bb97003f 100644
> --- a/xen/arch/x86/io_apic.c
> +++ b/xen/arch/x86/io_apic.c
> @@ -57,6 +57,14 @@ bool __initdata ioapic_ack_forced;
>  int __read_mostly nr_ioapic_entries[MAX_IO_APICS];
>  int __read_mostly nr_ioapics;
>  
> +/*
> + * The logic to check if the timer is working is expensive. So allow
> + * the admin to bypass it if they know their platform doesn't have
> + * a buggy timer.

I would mention i8254 here, as said this is quite likely not testing
the currently in use timer.

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.

Thanks, Roger.



 


Rackspace

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