[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN PATCH] x86/ACPI: Ignore entries marked as unusable when parsing MADT
- To: Simon Gaiser <simon@xxxxxxxxxxxxxxxxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Tue, 12 Sep 2023 14:43:14 +0200
- 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=dRBvMra1lmS64FReeDF5pza9jmMIBQ3Lan0L+hv2AGA=; b=Jy1ZbovHoBmkVYpfkcGwcd1xUGlYsfeDWqLmuNZgPcT+k2SF0hicbv8jfe6miof8QeimlJ9iOH7PyK2Cq4vzm3m6q6Fi20YVpMsHc8iB3C3bEEI6VHF1Mf/7dlFUia7Gh7OELL8hdJSCjaLXxTRK3kBm5uv8Qh8A0Dx56lRx0fCC5ZW/WX+TzLjuVgPIEu764A6Pg9wj2yCHcyRfTbyfp+OVPO+bmvF16GjC9BUTzUXdEwn9XEZfO+YElaAdeREihhXelBcISuGhCv7MOTd0az1khQnJP5OZCWvQTgnvggspxJJK6i4AxPDHrauMDeQt7MyFW9CiLc726Q0Q3iGPCQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H74tgK52N2ZXa+ApGsxhMhc38EsxmQDGlT8ZcqupePK/ocRCQeONNkxTf7bN5wRAJSvoYe+8YC1J1hXrcFmlxBKUbwsTZsNLR9BIvI5OgREa6J3R+5B9eTo7m/ZxFwqTC29vdfEKJsS7UDTdGKyIoJtHkVICxdTQ0UUeOLDWVb7KDHSQ57lKUtRlJFIFPRAyoNEaPZua6ld1Ih8EUO2eC0y3zvhUVHoFUnuy0Ekiw75+7CTogtVOdu5E3+0dy9SX1LOch+bMIjxnq6hg4BZJaESQMwmKmSq4/jyhXTYTdjQjBxv7Akve5rIJIQBDh7D715A49xC7QYCuT8B2hc0i/A==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Tue, 12 Sep 2023 12:43:47 +0000
- Ironport-data: A9a23:DGkIYKPyJo/onhDvrR1ClsFynXyQoLVcMsEvi/4bfWQNrUp30mYDz jEYUT2FaPjbYGLwLtBzbd619RwCsMDVmtJnTQto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v 63yTvGacajYm1eF/k/F3oDJ9CQ6jefQAOOkVIYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/ Nj/uKUzAnf8s9JPGjxSs/jrRC9H5qyo42tJ5wZmOZingXeF/5UrJMNHTU2OByOQrrl8RoaSW +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0usvKkp31 cAIFD0EZTy+h+2wmKiKceY506zPLOGzVG8ekldJ6GmDSM0AGNXESaiM4sJE1jAtgMwIBezZe 8cSdTtoalLHfgFLPVAUTpk5mY9EhFGmK2Ee9A3T+PVxvzW7IA9ZidABNPLPfdOHX4NNl1uwr WPa5WXpRBodMbRzzBLcqCj22rGfwXmTtIQ6Tpq4rfpsigeo13EoGiNVTxyQj8nplRvrMz5YA wlOksY0loAp9UmsSPH8WQO5u3+OuhMAW9tWHPY+4QvLwa3Riy6JC25BQjNfZdgOsM4tWSdsx lKPh8nuBzFkrPuSU3313rWeoC62OCMVBXQffiJCRgwAi/H8pKkjgxSJScxseIawh8fwECv9w BiLqjY/nLQZicMX16S98kvDijjqrZ/MJjPZ/S3SV2Ohqxh/PYisYtTy7UCBtaodaoGEUlOGo X4I3dCE6/wDBo2MkyrLR/gRGLau5LCONzi0bUNTIqTNPg+FoxaLFb28KhkndC+F7u5slefVX XLu
- Ironport-hdrordr: A9a23:cvqJ1KPQy3XUnsBcT6D255DYdb4zR+YMi2TDiHoddfUFSKalfp 6V98jztSWatN/eYgBEpTmlAtj5fZq8z+8N3WB1B9uftWbd2FdAQLsSjrcKhgeQYBEWldQtqZ uIEZIOb+EYZGIS5aia3OD7KadH/DDuytHUuQ609QYIcegFUdAD0+8vYTzraHGeCTM2c6bQU/ Gnl7p6jgvlXU5SQtWwB3EDUeSGj9rXlKj+aRpDKw875BKIhTaI7qe/NxSDxB8RXx5G3L9nqA H+4kbEz5Tml8v+5g7X1mfV4ZgTsNz9yuFbDMjJptkJJi7qggOIYp0kf7GZpjg6rMym9V5vut jRpBULOdh19hrqDyqIiCqo/zOl/Ccl6nfkx1PdqXz/ofbhTDZ/L8Zan4pWfjbQ9kJl5bhHoe p29lPck6ASIQLLnSz76dSNfxZ2lnCsqX5nteIIlXRQXaYXdbcUh40C+0F+FosGAUvBmckaOd grKPuZyOddcFucYXyclm5zwOa0VnB2JRuCSlhqgL3h7xFm2FRCi2cIzs0WmXkNsLgnTYNf2u jCOqN00JlTU84/d8tGdak8aPryLlaIbQPHMWqUL1iiProAIWjxp5n+56hwzP22eaYP0IA5lP 36IRxlXFYJCgLT4PC1rd52GkinehT+Yd2t8LAT23FBgMy8eFKxWhfzDWzHkKOb0oci64PgKr KO0altco7exFvVaPl0NjLFKudvwFklIbkoU4UAKiWzi/OODLHWncrmV9uWDIbRMF8fKxDC6z 04LXXOGPk=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Mon, Sep 11, 2023 at 12:12:38PM +0200, Simon Gaiser wrote:
> Up to version 6.2 Errata B [2] the ACPI spec only defines
> ACPI_MADT_ENABLE as:
>
> If zero, this processor is unusable, and the operating system
> support will not attempt to use it.
>
> The bit that later will be ACPI_MADT_ONLINE_CAPABLE is reserved with
> "Must be zero".
>
> Version 6.3 [3] then adds ACPI_MADT_ONLINE_CAPABLE and changes the
> meaning of ACPI_MADT_ENABLE:
>
> Enabled
> If this bit is set the processor is ready for use. If this bit
> is clear and the Online Capable bit is set, system hardware
> supports enabling this processor during OS runtime. If this bit
> is clear and the Online Capable bit is also clear, this
> processor is unusable, and OSPM shall ignore the contents of the
> Processor Local APIC Structure.
>
> Online Capbable
> The information conveyed by this bit depends on the value of the
> Enabled bit. If the Enabled bit is set, this bit is reserved and
> must be zero. Otherwise, if this this bit is set, system
> hardware supports enabling this processor during OS runtime.
>
> So with conforming firmwares it should be safe to simply ignore the
> entry if !ACPI_MADT_ENABLED && !ACPI_MADT_ONLINE_CAPABLE
>
> As a precaution against buggy firmwares this change, like Linux [4],
> ignores ACPI_MADT_ONLINE_CAPABLE completely if MADT revision < 5. Note
> that the MADT revision was already increased to 5 with spec version 6.2
> Errata A [1], so before introducing the online capable flag. But it
> wasn't changed for the new flag, so this is the best we can do here.
>
> For previous discussion see thread [5].
>
> Link:
> http://www.uefi.org/sites/default/files/resources/ACPI%206_2_A_Sept29.pdf #
> [1]
> Link:
> https://uefi.org/sites/default/files/resources/ACPI_6_2_B_final_Jan30.pdf #
> [2]
> Link: https://uefi.org/sites/default/files/resources/ACPI_6_3_May16.pdf # [3]
> Link:
> https://git.kernel.org/torvalds/c/e2869bd7af608c343988429ceb1c2fe99644a01f #
> [4]
> Link:
> https://lore.kernel.org/xen-devel/80bae614-052e-0f90-cf13-0e5e4ed1a5cd@xxxxxxxxxxxxxxxxxxxxxx/
> # [5]
> Signed-off-by: Simon Gaiser <simon@xxxxxxxxxxxxxxxxxxxxxx>
> ---
> xen/arch/x86/acpi/boot.c | 19 +++++++++++++------
> 1 file changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c
> index 4a62822fa9..2d0b8a9afc 100644
> --- a/xen/arch/x86/acpi/boot.c
> +++ b/xen/arch/x86/acpi/boot.c
> @@ -77,6 +77,17 @@ static int __init cf_check acpi_parse_madt(struct
> acpi_table_header *table)
> return 0;
> }
>
> +static bool __init acpi_is_processor_usable(uint32_t lapic_flags)
> +{
> + if (lapic_flags & ACPI_MADT_ENABLED)
> + return true;
> +
> + if (madt_revision >= 5 && (lapic_flags & ACPI_MADT_ONLINE_CAPABLE))
> + return true;
> +
> + return false;
So this means that Xen would only support ACPI CPU Hotplug with
versions of the MADT >= 5? Because with the proposed code non enabled
entries on MADT versions < 5 will be reported as unusable.
Will this work with QEMU? (ie: does QEMU expose a MADT table with
version >= 5) Otherwise we will loose all possible ways of testing
ACPI CPU Hotplug.
Regards, Roger.
|