[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aEZCfKW5EDumt9jL@intel.com>
Date: Mon, 9 Jun 2025 10:10:04 +0800
From: Chao Gao <chao.gao@...el.com>
To: Nikolay Borisov <nik.borisov@...e.com>
CC: <linux-coco@...ts.linux.dev>, <x86@...nel.org>, <kvm@...r.kernel.org>,
<seanjc@...gle.com>, <pbonzini@...hat.com>, <eddie.dong@...el.com>,
<kirill.shutemov@...el.com>, <dave.hansen@...el.com>,
<dan.j.williams@...el.com>, <kai.huang@...el.com>,
<isaku.yamahata@...el.com>, <elena.reshetova@...el.com>,
<rick.p.edgecombe@...el.com>, Farrah Chen <farrah.chen@...el.com>, "Thomas
Gleixner" <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, "Borislav
Petkov" <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>, "H. Peter
Anvin" <hpa@...or.com>, "Kirill A. Shutemov"
<kirill.shutemov@...ux.intel.com>, <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH 12/20] x86/virt/seamldr: Shut down the current TDX
module
>> @@ -281,8 +282,12 @@ static void ack_state(void)
>> static int do_seamldr_install_module(void *params)
>> {
>> enum tdp_state newstate, curstate = TDP_START;
>> + int cpu = smp_processor_id();
>> + bool primary;
>> int ret = 0;
>> + primary = !!(cpumask_first(cpu_online_mask) == cpu);
>
>nit: the !! is not needed here, as the check is clearly boolean.
Thanks. I will remove it.
<snip>
>> +static int get_tdx_sys_info_handoff(struct tdx_sys_info_handoff *sysinfo_handoff)
>> +{
>> + int ret = 0;
>> + u64 val;
>> +
>> + if (!ret && tdx_has_td_preserving() &&
>
>nit: That first !ret is redundant since it's always true.
>
Yes, this code is generated by a script [*] and other existing functions in
this file have the same issue. I will try to improve the script to remove the
redundant "!ret".
Powered by blists - more mailing lists