[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 2/3] x86/platform: introduce XENPF_get_ucode_revision
- To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Thu, 6 Apr 2023 08:52:35 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=Mp8t5y9kQGZBW8iIjdSHnxCFO8OaixoI+/AozAavHPo=; b=E7AqMNIop6TvoYF9NZlXhQSrGw3xLZKkZuuTpEA8UJodrKMG+d0IZrDYzG7r56rzMLwGNp83Z2Img13yEvOKEDCfWiHIv4ayjTFCN1mq8+iko7U02LAB4drz3jVvHyM0DRhEAaI7zt9EjGU5/adi1l7r8pJ8dBXgoVhz5mDmgTLswoYwVM7F/pixeFpq8Sc7cAZ/PFa/MljelFV3fZppbDz8b1nT9u3kCZZAQLzH5IllBhoZzR+/lCh0nJn67j/lI4RT1QMOJnGFjxvHuv1CDQEa8tp2DjH01sE6jpia4wog55cdg+9y9z2nFuqba9qnjxcoltUB8GG/RByuUJylew==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CQRus2hIwPyTwzZUg4hBt3SpxMA4KjJ/hphX9qfOsStxXMzYrywRJcWNCVIjSUSFGPAkD/Kep6eDAjcZR3vB8RsPX96jfRo13YnXXvEJnM//XD8t8f90naUIxcKPdPYxF4lL0afRQZqPN120+la6tJU2b/uf8PNMFs2hH43pwpp+/HGetk4lbmSXrn5Fa83WrYv0uSA5asW47LZrUsUSsJqXBW7bDLBAcNpgqNlHnhZpYLka4AzEbnxb2RulErtFtz17h/kp0i67raqHdaPriWUTpWTskJwJE1iLvs0wIIwDxItnF9tNZsdTKRN4CDiH1Z9IZfElDu+vaaxcYONgeg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Sergey Dyasli <sergey.dyasli@xxxxxxxxxx>
- Delivery-date: Thu, 06 Apr 2023 06:53:01 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 06.04.2023 01:02, Andrew Cooper wrote:
> On 05/04/2023 9:56 am, Jan Beulich wrote:
>> On 04.04.2023 18:06, Sergey Dyasli wrote:
>>> --- a/tools/libs/ctrl/xc_misc.c
>>> +++ b/tools/libs/ctrl/xc_misc.c
>>> @@ -243,6 +243,24 @@ int xc_get_cpu_version(xc_interface *xch, struct
>>> xenpf_pcpu_version *cpu_ver)
>>> return 0;
>>> }
>>>
>>> +int xc_get_ucode_revision(xc_interface *xch,
>>> + struct xenpf_ucode_revision *ucode_rev)
>>> +{
>>> + int ret;
>>> + struct xen_platform_op op = {
>>> + .cmd = XENPF_get_ucode_revision,
>>> + .u.ucode_revision.cpu = ucode_rev->cpu,
>>> + };
>>> +
>>> + ret = do_platform_op(xch, &op);
>>> + if ( ret != 0 )
>>> + return ret;
>> Is there anything wrong with omitting this if() and ...
>>
>>> + *ucode_rev = op.u.ucode_revision;
>>> +
>>> + return 0;
>> ... using "return ret" here?
>
> Conceptually, yes. *ucode_rev oughtn't to be written to on failure.
>
> More importantly though, what Sergey wrote is consistent with the vast
> majority of libxc, and consistency is far more important than a marginal
> perf improvement which you won't be able to measure.
My remark was entirely unrelated to performance, and instead solely to
(source) code size.
Jan
|