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]
Date:   Thu, 13 Jul 2023 17:28:35 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Bibo Mao <maobibo@...ngson.cn>
Cc:     "Rafael J . Wysocki" <rafael@...nel.org>,
        Len Brown <lenb@...nel.org>, linux-acpi@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ACPI: processor_core: LoongArch: Get physical id from
 MADT table

On Mon, Jul 10, 2023 at 8:33 AM Bibo Mao <maobibo@...ngson.cn> wrote:
>
> With ACPI Spec 6.5 physical id can be parsed from MADT table for
> LoongArch system, also it can be used in MAT table for cpu hotplug
> stage. This patch adds physical id parsing for LoongArch system.
>
> Signed-off-by: Bibo Mao <maobibo@...ngson.cn>
> ---
>  drivers/acpi/processor_core.c | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
>
> diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
> index d6606a9f2da6..51239cd2a485 100644
> --- a/drivers/acpi/processor_core.c
> +++ b/drivers/acpi/processor_core.c
> @@ -132,6 +132,26 @@ static int map_rintc_hartid(struct acpi_subtable_header *entry,
>         return -EINVAL;
>  }
>
> +/*
> + * Retrieve LoongArch CPU physical id
> + */
> +static int map_core_pic_id(struct acpi_subtable_header *entry,
> +               int device_declaration, u32 acpi_id, phys_cpuid_t *apic_id)
> +{
> +       struct acpi_madt_core_pic *core_pic =
> +               container_of(entry, struct acpi_madt_core_pic, header);
> +
> +       if (!(core_pic->flags & ACPI_MADT_ENABLED))
> +               return -ENODEV;
> +
> +       if (device_declaration && (core_pic->processor_id == acpi_id)) {
> +               *apic_id = core_pic->core_id;
> +               return 0;
> +       }
> +
> +       return -EINVAL;
> +}
> +
>  static phys_cpuid_t map_madt_entry(struct acpi_table_madt *madt,
>                                    int type, u32 acpi_id)
>  {
> @@ -165,6 +185,9 @@ static phys_cpuid_t map_madt_entry(struct acpi_table_madt *madt,
>                 } else if (header->type == ACPI_MADT_TYPE_RINTC) {
>                         if (!map_rintc_hartid(header, type, acpi_id, &phys_id))
>                                 break;
> +               } else if (header->type == ACPI_MADT_TYPE_CORE_PIC) {
> +                       if (!map_core_pic_id(header, type, acpi_id, &phys_id))

Is ACPI_MADT_TYPE_CORE_PIC specific to LoongArch?  The changelog
should mention it if that's the case.

> +                               break;
>                 }
>                 entry += header->length;
>         }
> @@ -216,6 +239,8 @@ static phys_cpuid_t map_mat_entry(acpi_handle handle, int type, u32 acpi_id)
>                 map_x2apic_id(header, type, acpi_id, &phys_id);
>         else if (header->type == ACPI_MADT_TYPE_GENERIC_INTERRUPT)
>                 map_gicc_mpidr(header, type, acpi_id, &phys_id);
> +       else if (header->type == ACPI_MADT_TYPE_CORE_PIC)
> +               map_core_pic_id(header, type, acpi_id, &phys_id);
>
>  exit:
>         kfree(buffer.pointer);
> --
> 2.27.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ