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

Re: [PATCH v3] acpi/processor: fix evaluating _PDC method when running as Xen dom0


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 16 Mar 2023 11:45:47 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=VWyQHfB+TJ0P8zlOXRcmeCpSd9fkh2aCQWaY9+tDynM=; b=Uynt+tvxhZvvFq4DTamxzsTHotXQW92Y5AO7V5Cz0Y/vhdNduPqJJwA+RXAjmQmxV15eP5vP/zJlxtqcks7xgwtDiHYW/P+aGgFcMqpTSSi1vO9Se/WcWdXIdB+tvLITJw/9iS60JDXE9b42r52ucUsqXsfk4sp5aynPDdphz8KT4aFo1xy6nWchSslw9JNVEL8b0iZyZjp/2WwQcEF0QqF0ytXabTwcSgturslgynzMfx3ChCzfqUuX5iZcHpifMi6Ni601Mr7ZHh8UMyM3LL7VW6VhLxxGmsoq3ILM66bRHmeWkMJCCAB9bzZZE9P7GrDfu1slw/4StolALjSIuA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FrXTYHIW54hz+1mts7Y1yUZcNtHsJS0lO6O3nhA4sUg/LY01l6WLq0QtwNlyCoPoqwAYqmGMLhwWRw2Z/b4jAdueTOlpJyVAKWuZgfYzCETzxjTEylNtCTSor2s5UGY2NWXSuDdo2TGdGGGfrftSHhjrZhg7RQ//jo9Dxkkee/GPnZJETFiRzQgcaMABAhFre0lvedwHB+QXPyWZLpDHBXJ8GaftFT1m0Z+cg56e4iWwnDLq+FaudIomlUnsW/L+XWDfoCe1YCA0lOjuzkaPKWb/PSoF8xCiKlNiIqNoWonqmb6d72UPZf85yoRAJgPpiSfpp6wWrkOFHC+OGaBxYQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, josef@xxxxxxxxxxx, Juergen Gross <jgross@xxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, x86@xxxxxxxxxx, "H. Peter Anvin" <hpa@xxxxxxxxx>, "Rafael J. Wysocki" <rafael@xxxxxxxxxx>, Len Brown <lenb@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Venkatesh Pallipadi <venkatesh.pallipadi@xxxxxxxxx>, Alex Chiang <achiang@xxxxxx>, linux-acpi@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
  • Delivery-date: Thu, 16 Mar 2023 10:46:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16.03.2023 11:32, Roger Pau Monne wrote:
> --- a/arch/x86/include/asm/xen/hypervisor.h
> +++ b/arch/x86/include/asm/xen/hypervisor.h
> @@ -63,4 +63,14 @@ void __init xen_pvh_init(struct boot_params *boot_params);
>  void __init mem_map_via_hcall(struct boot_params *boot_params_p);
>  #endif
>  
> +#ifdef CONFIG_XEN_DOM0

Shouldn't you also check CONFIG_X86 here, seeing the condition for when
pcpu.c would be built? Additionally CONFIG_ACPI may want checking, which
- taken together - would amount to checking CONFIG_XEN_ACPI. (For which
in turn I find odd that it will also be engaged when !DOM0.)

> @@ -381,3 +383,20 @@ static int __init xen_pcpu_init(void)
>       return ret;
>  }
>  arch_initcall(xen_pcpu_init);
> +
> +bool __init xen_processor_present(uint32_t acpi_id)
> +{
> +     struct pcpu *pcpu;
> +     bool online = false;
> +
> +     mutex_lock(&xen_pcpu_lock);
> +     list_for_each_entry(pcpu, &xen_pcpus, list)
> +             if (pcpu->acpi_id == acpi_id) {
> +                     online = pcpu->flags & XEN_PCPU_FLAGS_ONLINE;
> +                     break;
> +             }
> +
> +     mutex_unlock(&xen_pcpu_lock);
> +
> +     return online;
> +}

Since it is neither natural nor obvious that this function takes an
ACPI ID as input (could in particular also be an APIC ID), would that
perhaps better be expressed in its name?

Jan



 


Rackspace

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