[PATCH v2 2/2] libacpi: Remove CPU hotplug and GPE handling from PVH DSDTs

Alejandro Vallejo posted 2 patches 2 days, 18 hours ago
There is a newer version of this series
[PATCH v2 2/2] libacpi: Remove CPU hotplug and GPE handling from PVH DSDTs
Posted by Alejandro Vallejo 2 days, 18 hours ago
PVH guests have no DM, so this causes the guest to fetch the online CPU
bitmap from an unbacked 0xaf00 PIO port when executing the GPE handler.

Seeing how ACPI CPU hotplug is the only event delivered via GPE, remove
the GPE handler in addition to anything ACPI CPU hotplug related.

This shrinks PVH's DSDT substantially and prevents spuriously executing
a large amount of AML with no purpose at all.

Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
---
v2:
  * Adjusted commit message
  * All other tags except S-by moved to patch 1.
---
 tools/libacpi/mk_dsdt.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tools/libacpi/mk_dsdt.c b/tools/libacpi/mk_dsdt.c
index 06a229e2e9..cc4ed3961c 100644
--- a/tools/libacpi/mk_dsdt.c
+++ b/tools/libacpi/mk_dsdt.c
@@ -218,6 +218,11 @@ int main(int argc, char **argv)
     pop_block();
     /**** Processor end ****/
 #else
+    if (dm_version == QEMU_NONE) {
+        pop_block();
+        pop_block();
+        return 0;
+    }
 
     /* Operation Region 'PRST': bitmask of online CPUs. */
     stmt("OperationRegion", "PRST, SystemIO, %#x, %d",
@@ -265,10 +270,6 @@ int main(int argc, char **argv)
     pop_block();
     pop_block();
 
-    if (dm_version == QEMU_NONE) {
-        pop_block();
-        return 0;
-    }
     /**** Processor end ****/
 
 
-- 
2.43.0
Re: [PATCH v2 2/2] libacpi: Remove CPU hotplug and GPE handling from PVH DSDTs
Posted by Jan Beulich 2 days, 15 hours ago
On 11.09.2025 13:53, Alejandro Vallejo wrote:
> PVH guests have no DM, so this causes the guest to fetch the online CPU
> bitmap from an unbacked 0xaf00 PIO port when executing the GPE handler.
> 
> Seeing how ACPI CPU hotplug is the only event delivered via GPE, remove
> the GPE handler in addition to anything ACPI CPU hotplug related.
> 
> This shrinks PVH's DSDT substantially and prevents spuriously executing
> a large amount of AML with no purpose at all.
> 
> Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

> ---
> v2:
>   * Adjusted commit message
>   * All other tags except S-by moved to patch 1.

This will want backporting; I expect finding a suitable commit for a Fixes:
tag is somewhat difficult.

Jan
Re: [PATCH v2 2/2] libacpi: Remove CPU hotplug and GPE handling from PVH DSDTs
Posted by Alejandro Vallejo 2 days, 14 hours ago
On Thu Sep 11, 2025 at 5:07 PM CEST, Jan Beulich wrote:
> On 11.09.2025 13:53, Alejandro Vallejo wrote:
>> PVH guests have no DM, so this causes the guest to fetch the online CPU
>> bitmap from an unbacked 0xaf00 PIO port when executing the GPE handler.
>> 
>> Seeing how ACPI CPU hotplug is the only event delivered via GPE, remove
>> the GPE handler in addition to anything ACPI CPU hotplug related.
>> 
>> This shrinks PVH's DSDT substantially and prevents spuriously executing
>> a large amount of AML with no purpose at all.
>> 
>> Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Thanks

>
>> ---
>> v2:
>>   * Adjusted commit message
>>   * All other tags except S-by moved to patch 1.
>
> This will want backporting; I expect finding a suitable commit for a Fixes:
> tag is somewhat difficult.
>
> Jan

I'd say it's the patch that needlessly enabled GPE handling on PVH.

Fixes: 062975dc9441("acpi: PVH guests need _E02 method")

Cheers,
Alejandro
Re: [PATCH v2 2/2] libacpi: Remove CPU hotplug and GPE handling from PVH DSDTs
Posted by Jan Beulich 2 days, 14 hours ago
On 11.09.2025 17:36, Alejandro Vallejo wrote:
> On Thu Sep 11, 2025 at 5:07 PM CEST, Jan Beulich wrote:
>> On 11.09.2025 13:53, Alejandro Vallejo wrote:
>>> ---
>>> v2:
>>>   * Adjusted commit message
>>>   * All other tags except S-by moved to patch 1.
>>
>> This will want backporting; I expect finding a suitable commit for a Fixes:
>> tag is somewhat difficult.
> 
> I'd say it's the patch that needlessly enabled GPE handling on PVH.
> 
> Fixes: 062975dc9441("acpi: PVH guests need _E02 method")

Oh, right.

Jan