From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, josef@oderland.se,
Juergen Gross <jgross@suse.com>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>,
Stefano Stabellini <sstabellini@kernel.org>,
Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>,
Alex Chiang <achiang@hp.com>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] acpi/processor: fix evaluating _PDC method when running as Xen dom0
Date: Thu, 16 Mar 2023 12:00:26 +0100 [thread overview]
Message-ID: <ZBL2yosC4LWGdjsn@Air-de-Roger> (raw)
In-Reply-To: <ba2d10ed-a1c0-2f35-3ffc-13637c83ed93@suse.com>
On Thu, Mar 16, 2023 at 11:45:47AM +0100, Jan Beulich wrote:
> 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?
It's in a x86 specific header, so that's enough I think? (note the
path of the header)
> 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.)
Hm, is it worth making the acpi_id field in struct pcpu or helper
conditional to CONFIG_ACPI? It's just data fetched from Xen so it
doesn't depend on any of the ACPI functionality in Linux.
IMO I don't think it's worth the extra ifdefs.
> > @@ -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?
I did wonder the same, but convinced myself that the parameter name
being `acpi_id` was enough of a hint that the function takes an ACPI
ID.
Thanks, Roger.
next prev parent reply other threads:[~2023-03-16 11:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-16 10:32 [PATCH v3] acpi/processor: fix evaluating _PDC method when running as Xen dom0 Roger Pau Monne
2023-03-16 10:45 ` Jan Beulich
2023-03-16 11:00 ` Roger Pau Monné [this message]
2023-03-16 11:15 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZBL2yosC4LWGdjsn@Air-de-Roger \
--to=roger.pau@citrix.com \
--cc=achiang@hp.com \
--cc=boris.ostrovsky@oracle.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=josef@oderland.se \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=oleksandr_tyshchenko@epam.com \
--cc=rafael@kernel.org \
--cc=sstabellini@kernel.org \
--cc=tglx@linutronix.de \
--cc=venkatesh.pallipadi@intel.com \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox