lkml.org 
[lkml]   [2022]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v5 02/22] cc_platform: Add new attribute to prevent ACPI CPU hotplug
From

On 2022/6/22 19:15, Kai Huang wrote:
>
> @@ -357,6 +358,17 @@ static int acpi_processor_add(struct acpi_device *device,
> struct device *dev;
> int result = 0;
>
> + /*
> + * If the confidential computing platform doesn't support ACPI
> + * memory hotplug, the BIOS should never deliver such event to
memory or cpu hotplug?


> + * the kernel. Report ACPI CPU hot-add as a BIOS bug and ignore
> + * the new CPU.
> + */
> + if (cc_platform_has(CC_ATTR_ACPI_CPU_HOTPLUG_DISABLED)) {
> + dev_err(&device->dev, "[BIOS bug]: Platform doesn't support ACPI CPU hotplug. New CPU ignored.\n");
> + return -EINVAL;
> + }
> +
> pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL);
> if (!pr)
> return -ENOMEM;
> @@ -434,6 +446,17 @@ static void acpi_processor_remove(struct acpi_device *device)
> if (!device || !acpi_driver_data(device))
> return;
>
> + /*
> + * The confidential computing platform is broken if ACPI memory
ditto


> + * hot-removal isn't supported but it happened anyway. Assume
> + * it's not guaranteed that the kernel can continue to work
> + * normally. Just BUG().
> + */
> + if (cc_platform_has(CC_ATTR_ACPI_CPU_HOTPLUG_DISABLED)) {
> + dev_err(&device->dev, "Platform doesn't support ACPI CPU hotplug. BUG().\n");
> + BUG();
> + }
>

\
 
 \ /
  Last update: 2022-08-03 05:57    [W:0.299 / U:2.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site