lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 12 Mar 2018 18:54:16 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Daniel Kurtz <djkurtz@...omium.org>
Cc:     Aaron Durbin <adurbin@...omium.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Kate Stewart <kstewart@...uxfoundation.org>,
        Philippe Ombredanne <pombredanne@...b.com>,
        "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" 
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] x86/Kconfig: Add config for specifying BASE_BAUD

On Thu, Mar 8, 2018 at 1:24 AM, Daniel Kurtz <djkurtz@...omium.org> wrote:
> Not all x86 CPUs have UARTs that use a baud reference clock (BASE_BAUD) of
> 115200 = 1843200 / 16.  For example, the UARTs on AMD Carrizo and later
> use a fixed input clock of 48000000, and hence require BASE_BAUD=3000000.
>
> The BASE_BAUD value is used by the generic earlycon driver to compute the
> UART clock used early in boot before the real serial drivers have a
> chance to load and read their input clock configuration from ACPI.
>
> Add a Kconfig option to override this default hard coded value.

This makes a deviation that prevents to have less kernels to cover
most of x86 cases.

Now we have the following:
 - x86-32 (covers i686)
 - x86-64 (covers x86_64)
 - quark (covers 1 core i586 TSC type of platforms)

In almost all above cases the 1843200 is used as UART clock.
(Exceptions are some of Intel MID devices)

Besides that I told you already the alternatives to mitigate the issue
(in order from preferable to non-preferable):

- since it's ACPI based platform, provide an SPCR table (problem solved!)
- fix your crap firmware to be compatible (even DT drivers are using
the same clock rate!)
- add a specific ->setup() callback for your crap hardware (see
drivers/tty/serial/amba-pl011.c as an example)

NAK.

>
> Signed-off-by: Daniel Kurtz <djkurtz@...omium.org>
> ---
>  arch/x86/Kconfig              | 9 +++++++++
>  arch/x86/include/asm/serial.h | 4 ++++
>  2 files changed, 13 insertions(+)
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index eb7f43f23521..0a258bb30159 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -454,6 +454,15 @@ config INTEL_RDT
>
>           Say N if unsure.
>
> +config X86_SERIAL_BASE_BAUD
> +       int "UART input clock for platform 8250/16550 serial ports"
> +       default "115200"
> +       help
> +         This specifies the default frequency for the reference clock of the
> +         serial ports.  For many systems this is 1843200 / 16, which is the
> +         default, but may need to be changed to get earlycon to work on
> +         some hardware, such as those that use AMD Carrizo or later SoCs.
> +
>  if X86_32
>  config X86_BIGSMP
>         bool "Support for big SMP systems with more than 8 CPUs"
> diff --git a/arch/x86/include/asm/serial.h b/arch/x86/include/asm/serial.h
> index ece8299d2695..c28151090b51 100644
> --- a/arch/x86/include/asm/serial.h
> +++ b/arch/x86/include/asm/serial.h
> @@ -9,7 +9,11 @@
>   * clock, since the 16550A is capable of handling a top speed of 1.5
>   * megabits/second; but this requires a faster clock.
>   */
> +#ifdef CONFIG_X86_SERIAL_BASE_BAUD
> +#define BASE_BAUD CONFIG_X86_SERIAL_BASE_BAUD
> +#else
>  #define BASE_BAUD (1843200/16)
> +#endif
>
>  /* Standard COM flags (except for COM4, because of the 8514 problem) */
>  #ifdef CONFIG_SERIAL_8250_DETECT_IRQ
> --
> 2.16.2.395.g2e18187dfd-goog
>



-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ