[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:10:36 +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=uqGaJMZncYNRrX5y3Oe4JYlD/pqZ6PvqNDJzlD83cig=; b=GbD/q0CHH+ftQZuj16ES82UXhXRdH/q5YbjIB8Kn+60e3i21HdAcg1rz1oFFBOxawWcwttO1d2/EHYcY/BBSzSQIU+9NUKrFIJ5SqG6wXMlZIGA1ErFWCTg5a+wnVIGFzY9N3wndmAM0NOYA3SJNNTpww3F/w/uIMy9wm6k71aGdzVPG6oIsFmOL6XTXu080DiKYPNacVZnUWdrEptT+WG9947fCGnsXneDSRTvujj1TH97YASVAXNlVpOM4f914m5S9BP3ySl1lqIvi984trvdrVDF75P2/x75flnLrEuaW5z3Rg/P+B8fL53wUIRHv6BU70sISEBNvKqftiy2t6A==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PB64rKASW9TdovkFi0wr4fRwsBI2skZZzMhH8A2JQBSFF/qovhnXyYmeeJZ77YHRF6GhHSiaztMpoYsrg7TIe/SskbHjg9zShFpvVE2K2vX5yC3OW3B92lfIvYJiGhpQRb/1Fmwc39ICSXGoyy3VUm/CbBpGRT9wzz3dljzaf1Z9Y3YLD0/dN5rtlbQ5ureAVZqWIHpRaM8PdNoiV7GHx/aJDJjrN2WNIov+TgPZ3qKksRZzlLWFfEelZYiIL5lFLmS5GFMH9qOkWauHIyAOpvmxXW6dQDyILMxq/YR52PE/wPb/teliZ+Yo/XemAefK8vQDbcvh7E5vMYmQGi79uQ==
- 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:10:45 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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.
It was the very nature of requiring Xen-specific conditionals which I
understand was the reason why so far no attempt was made to get this
(incl the corresponding logic for patch 1) into any upstream kernel.
Jan
|