Re: [PATCH v2] acpi/processor: sanitize _PDC buffer bits when running as Xen dom0

From: Jason Andryuk
Date: Fri Sep 08 2023 - 13:12:08 EST


On Thu, Sep 7, 2023 at 9:20 AM Wilczynski, Michal
<michal.wilczynski@xxxxxxxxx> wrote:
>
>
> Hi,
>
> On 9/6/2023 8:21 PM, Jason Andryuk wrote:
> > From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
> >
> > The Processor _PDC buffer bits notify ACPI of the OS capabilities, and
> > so ACPI can adjust the return of other Processor methods taking the OS
> > capabilities into account.
>
> _PDC method is deprecated for this purpose, since 2018, and is dropped from
> spec since 6.5
>
> We made the switch in linux since 6.6:
> 95272641338a ("ACPI: processor: Use _OSC to convey OSPM processor support information")

Thanks for the heads up, Michal. The patch pre-dated 6.6 and I based
this one off of 6.5.

> >
> > When Linux is running as a Xen dom0, it's the hypervisor the entity
> > in charge of processor power management, and hence Xen needs to make
> > sure the capabilities reported in the _PDC buffer match the
> > capabilities of the driver in Xen.
>
> So I guess you would need to sanitize buffer passed to _OSC method instead ?

I think I'll modify the capabilities in arch_acpi_set_proc_cap_bits()
and that will handle both _OSC and the _PDC fallback.

Regards,
Jason