[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ba2d10ed-a1c0-2f35-3ffc-13637c83ed93@suse.com>
Date: Thu, 16 Mar 2023 11:45:47 +0100
From: Jan Beulich <jbeulich@...e.com>
To: Roger Pau Monne <roger.pau@...rix.com>
Cc: xen-devel@...ts.xenproject.org, josef@...rland.se,
Juergen Gross <jgross@...e.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Len Brown <lenb@...nel.org>,
Stefano Stabellini <sstabellini@...nel.org>,
Oleksandr Tyshchenko <oleksandr_tyshchenko@...m.com>,
Venkatesh Pallipadi <venkatesh.pallipadi@...el.com>,
Alex Chiang <achiang@...com>, linux-acpi@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] acpi/processor: fix evaluating _PDC method when
running as Xen dom0
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
Powered by blists - more mailing lists