[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 16 Mar 2023 12:00:26 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=+KwU61Fv+SUsRa3WilRxDBLF5gU0HjmIPKbQs9ZdDDo=; b=c4kr+hcvZFMggN0SbKsfquQ/rJDri24OUH7TMpNtLB1vyVDgJer1nTm2nBcrsedzmYXaUMN7nypvP8WY3moGs5riFZITcnHX/exZHWfZf7A50kyIDzD0NYTJbiiEw/7hBD4NmgeiOnJztuOIuAHg9lrmPGlX4Cas/jjnpydw9tqRBsWKG8/DaB0Dgr2RJqnwxgQsT9SmTstJhSSn03HLMj1lRiowoSpYRCgMQHpidPpvaA/34GXqdLnoWOHq87ZiAx2/9jhRyX1US4qip5Oi++zxKZq/eWr0H4sxB1L/oCOx1AQJWY7g/rn4JMirN5hmxAvnwVRG9O1TDfC0BEaW8Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N0PXmie7j6JFeM+zFhNlsoxNACoyIkS9AR0t79CtMYe9dcIzJFgCX181VEe9dQH9eDu/511Lbco1f+zNsNBB82qKGv8j8FDp6Ma3yBCK05PdR1Mbl9x+IlHokY0vx7HK7TtQ4MUBtnzvajQTDFsTeeXLccLYZ7emoT59aBeC43STnE6+iN0d+q5UTx7Ux/NFInSYqmtAtFIiuqXYWUWddB1S7y1FPIaSbpokztqHDwhFahT+5Z16W3k8tdIhy/w8vn3rGFJbeiuQZUaljWQdzqCjNaoVoeh7Xvwp+gOOLcGEcqubMl7khojBmJH0kGt11q7rPwdUc6fAU72CaQmXzQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.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 11:01:28 +0000
  • Ironport-data: A9a23:fjicyKiMAhuYineKChZYmCVeX1616RAKZh0ujC45NGQN5FlHY01je htvDWCGaPmJMTPyeoh1aYrjo08B78SDmN9lG1Fvqno0Qyob9cadCdqndUqhZCn6wu8v7q5Ex 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv cKai8DEMRqu1iUc3lg8sspvkzsy+qWi0N8klgZmP6sT5waAzyd94K83fsldEVOpGuG4IcbiL wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ OBl7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s1NKZMDUO11HJEGgP1/qA/9SkIVyEygc/79 YdT0EdMqyWMbESt6+TjmiF+pQbsb+6GciT9JrjJhxWPGVXgs9bnmVE4lHxKDwNeOAKP+tPKL Osou584xawc3Ueacq2QlEDQuj4vtXO0L72fBIcABYjyQ+WyRel8qTzHRS01goXF2on+8ZozU H11yjCoomzufCyzRHRk0fV8pRtgdPkjvdTGcCWjcARCzP0ziKlfp5oVbGutC085Muv9FEput /RpApIBbU611rhOkWO5Tf90Qjp1zgjr1fk1F+jmHPm5ej0XigzBcZtjZ9QNkKx0TtogPhMlI Zwm06JvZteCh3N2Az7+tjzThlv0m65u2Arn+I/h2FWFaEedLhSh4oC+149KuZ3IAvKrKQcVM V+BsDV4/hbNXuccnDip2FqhOehW3widy32MHQqi4iw6Xx7jXp5x0wXyIg0hXEb7q8wTJFC+q DtLrlovKsmdL5YUYtNQMM6BeenAG3ERhzBdEiIJ078Ka0BM3XR77bq/bQO4v2wcpBg9up/pH 34aiIYiYcOQTOvNSXXt6c7sSwlAV/NEAgF8/suqaSQ4dbHNfjW2S7qciFcryLvmYRbPiThYY fDBHtnOY6dEYLQI/c24+TfYegmFZBMarxghv8LH3Szn+nsFqrG8sTmTde7HsucLd9jYBK0Pk c+
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.



 


Rackspace

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