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

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


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 21 Nov 2022 15:13:21 +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=BiQfIr9QNmNdqzrWkESllByDiNlkhrvXBEeYIIgQsQM=; b=Ha0uzuo/sGC4a6ne9alxrilMi69Ct8A8F2VCHj75AL1JR2SMnKsjeoTNeXiOqsFuAj1KXfuXoii2sINCJhdcWh6EksOjP4M6NmX8rCf/NGnJNcofOvWVWFTVtPMrxLrOdckLqHQZYVaY/PEd4h+qNmY3poC7Ixo78E0ZBQLDp1Qpr7mn5gFj+07/lDZfTvEVU6ZUQbk4R8RDwaI9OT2/LhZjtEtRam9ycp3YEjbexprKu65LZifqa/3blymUwbsLKQNGcnvqmCGTBi7KzEpU4pJ0adjvloIgNLhvGVjqgO2n2NmUJby1nMW04WioYt6gU96W6QBlABahwF7H7W2Plw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aFKXemftMMeyHLiYhM4WyZo1uT0HtazJL+HY9Fff97ZGIZ32ufsfpyYyU2Jz4/QaNXhGKFhPCehB7z4JSNI0NQQ1oqVm1TBiGoDbndGCzYNCPUr3N/zwWerpyfiZ64hRFroM1XCvfP03SDyOdf8GjU5KhGAocEF5y8Gg69yynyiGXpP0Io4CSqjsNhi+vC+DL5Kzfqy5SxjkG2NRoW3wrsUGAzWf6z7LmwiindVmVkEGjNOU9XfcmOpjO0LU0Q/ihbdPFbHufkqVqomije4j45llw5ENCPqlalOOpYK/UdAq1CJGZ3jfO4KJREUBAi5sZAF/X36Lz7/NTqKu0wWKbA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, jgross@xxxxxxxx, stable@xxxxxxxxxxxxxxx, 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>, linux-acpi@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
  • Delivery-date: Mon, 21 Nov 2022 14:13:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 21.11.2022 15:10, Jan Beulich wrote:
> On 21.11.2022 11:21, Roger Pau Monne wrote:
>> --- a/drivers/acpi/processor_pdc.c
>> +++ b/drivers/acpi/processor_pdc.c
>> @@ -137,6 +137,14 @@ acpi_processor_eval_pdc(acpi_handle handle, struct 
>> acpi_object_list *pdc_in)
>>              buffer[2] &= ~(ACPI_PDC_C_C2C3_FFH | ACPI_PDC_C_C1_FFH);
>>  
>>      }
>> +    if (xen_initial_domain())
>> +            /*
>> +             * When Linux is running as Xen dom0 it's the hypervisor the
>> +             * entity in charge of the processor power management, and so
>> +             * Xen needs to check the OS capabilities reported in the _PDC
>> +             * buffer matches what the hypervisor driver supports.
>> +             */
>> +            xen_sanitize_pdc((uint32_t *)pdc_in->pointer->buffer.pointer);
>>      status = acpi_evaluate_object(handle, "_PDC", pdc_in, NULL);
> 
> Again looking at our old XenoLinux forward port we had this inside the
> earlier if(), as an _alternative_ to the &= (I don't think it's valid
> to apply both the kernel's and Xen's adjustments). That would also let
> you use "buffer" rather than re-calculating it via yet another (risky
> from an abstract pov) cast.

Oh, I notice this can end up being misleading: Besides having it in the
earlier if() we had also #ifdef-ed out that if() itself (keeping just
the body). The equivalent of this here might then be

        if (boot_option_idle_override == IDLE_NOMWAIT || xen_initial_domain()) {

Jan



 


Rackspace

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