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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0ivJk-cVv0kHUeF1M7aWBZ9ziuUF-9=M_eF+WQ1vQJfgQ@mail.gmail.com>
Date:   Tue, 19 Oct 2021 18:52:37 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Huang Rui <ray.huang@....com>
Cc:     "Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
        Viresh Kumar <viresh.kumar@...aro.org>,
        Shuah Khan <skhan@...uxfoundation.org>,
        Borislav Petkov <bp@...e.de>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>,
        Linux PM <linux-pm@...r.kernel.org>,
        Deepak Sharma <deepak.sharma@....com>,
        Alex Deucher <alexander.deucher@....com>,
        Mario Limonciello <mario.limonciello@....com>,
        Nathan Fontenot <nathan.fontenot@....com>,
        Jinzhou Su <Jinzhou.Su@....com>,
        Xiaojian Du <Xiaojian.Du@....com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "the arch/x86 maintainers" <x86@...nel.org>
Subject: Re: [PATCH v2 03/21] ACPI: CPPC: Check online CPUs for determining
 _CPC is valid

On Sun, Sep 26, 2021 at 11:06 AM Huang Rui <ray.huang@....com> wrote:
>
> From: Mario Limonciello <mario.limonciello@....com>
>
> As this is a static check, it should be based upon what is currently
> present on the system. This makes probeing more deterministic.
>
> While local APIC flags field (lapic_flags) of cpu core in MADT table is
> 0, then the cpu core won't be enabled. In this case, _CPC won't be found
> in this core, and return back to _CPC invalid with walking through
> possible cpus (include disable cpus). This is not expected, so switch to
> check online CPUs instead.
>
> Reported-by: Jinzhou Su <Jinzhou.Su@....com>
> Signed-off-by: Mario Limonciello <mario.limonciello@....com>
> Signed-off-by: Huang Rui <ray.huang@....com>
> ---
>  drivers/acpi/cppc_acpi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
> index a4d4eebba1da..2efe2ba97d96 100644
> --- a/drivers/acpi/cppc_acpi.c
> +++ b/drivers/acpi/cppc_acpi.c
> @@ -411,7 +411,7 @@ bool acpi_cpc_valid(void)
>         struct cpc_desc *cpc_ptr;
>         int cpu;
>
> -       for_each_possible_cpu(cpu) {
> +       for_each_online_cpu(cpu) {

Shouldn't this be for_each_present_cpu()?  In case a CPU is present,
but not online when cppc_cpufreq is loaded?

>                 cpc_ptr = per_cpu(cpc_desc_ptr, cpu);
>                 if (!cpc_ptr)
>                         return false;
> --

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ