Re: [RFC PATCH 08/20] x86/virt/seamldr: Implement FW_UPLOAD sysfs ABI for TD-Preserving Updates
From: Chao Gao
Date: Tue Jun 17 2025 - 03:55:55 EST
On Mon, Jun 16, 2025 at 05:55:50PM -0500, Sagi Shahar wrote:
>> diff --git a/arch/x86/virt/vmx/tdx/tdx.c b/arch/x86/virt/vmx/tdx/tdx.c
>> index aa6a23d46494..22ffc15b4299 100644
>> --- a/arch/x86/virt/vmx/tdx/tdx.c
>> +++ b/arch/x86/virt/vmx/tdx/tdx.c
>> @@ -1178,6 +1178,10 @@ static void tdx_subsys_init(void)
>> goto err_bus;
>> }
>>
>> + struct device *dev_root __free(put_device) = bus_get_dev_root(&tdx_subsys);
>
>dev_root definition here causes compilation error:
>
>arch/x86/virt/vmx/tdx/tdx.c:1181:3: error: cannot jump from this goto
>statement to its label
> goto err_bus;
> ^
>arch/x86/virt/vmx/tdx/tdx.c:1184:17: note: jump bypasses
>initialization of variable with __attribute__((cleanup))
> struct device *dev_root __free(put_device) =
>bus_get_dev_root(&tdx_subsys);
Thank you for reporting this. The goto label is unnecessary, and I'll remove it
from patch 4 (which adds this goto).
I'm curious about which compiler you are using because I don't encounter this
error with "gcc version 11.5.0 20240719 (Red Hat 11.5.0-5) (GCC)".
>
>> + if (dev_root)
>> + seamldr_init(dev_root);
>> +
>> return;
>>
>> err_bus:
>> --
>> 2.47.1
>>
>>
>