[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] livepatch: apply_alternatives() is only used for livepatch
- To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Wed, 7 Jun 2023 12:15:07 +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=+aJz+t2PSCbEWj5gihmkCGP/+VySLxHHiBzb94h11JU=; b=fTD4RDgTpox+sw1XoBApbsIQ8VbQbEFsdUjOVFSS1kIabMF0RMrdMIZjvEUQf9aypqeefUcYAuW8/8pCUFXMox6kjJuVVv6Yk5eWvxKUF5zI2XDeWKFtUHR2SYNTVLo2vi8wLuZvWiOEZmPdAfIdLkXmCyHOtxOhkDvwQuLLZq6kRzgMkt04KQ6yGAm/01MSuX55MQsoZdOle//w5rJ+RsQkpvmIu79MVCmcJDhfpHuv37wCr1WGUG2DigbWnD1l1l8Z/mrPtFyBqq914Fy7mLgLmvXqA8xKB92Bf1VD7cuAz5LIYNtV22HLf94ZZvHRXipYa74pq45J3z37PTXJ7A==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EhoTfTnlGWWkmwhJo60WVUsT0H3ztTG7Z8sCvRbEqr47bEwoJJ2oSdFGTv/rk0rJvLf9xqMAxiiPonxod9scYXPg3mPt9rZEDA9S7mPt9fuLwAkrgCW+VmJspYnKbC9bBeDMuDvctOGDUFq4UVRswb8cCmnTzZb3RZnVnz4zgPxchMJ1RonHhfhigh+1Qn+nPMB9KJ4/EcbAvKMZe+QxpvEuPliWqdnrDs8Vsa87xQwo66cbsP22jnhZyn1SDmZVqF8Oyq1D97+Ic/+SRUZniXLUQGGG9dttFAkXmKPKNmw3M0Hdw2YKiUwrhpP802RtYL8e+c1Z+ah73aj7f9ThxA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Wed, 07 Jun 2023 10:15:29 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 07.06.2023 11:19, Andrew Cooper wrote:
> On 07/06/2023 10:17 am, Roger Pau Monné wrote:
>> On Wed, Jun 07, 2023 at 11:10:27AM +0200, Jan Beulich wrote:
>>> On 07.06.2023 11:01, Roger Pau Monne wrote:
>>>> Guard it with CONFIG_LIVEPATCH. Note alternatives are applied at boot
>>>> using _apply_alternatives().
>>>>
>>>> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
>>>> Reviewed-by: Julien Grall <jgrall@xxxxxxxxxx>
>>> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
>>> albeit the implicit ack therein is only on the assumption that (apart
>>> from me) it is generally deemed better ...
>>>
>>>> --- a/xen/arch/x86/alternative.c
>>>> +++ b/xen/arch/x86/alternative.c
>>>> @@ -358,11 +358,12 @@ static void init_or_livepatch
>>>> _apply_alternatives(struct alt_instr *start,
>>>> }
>>>> }
>>>>
>>>> -void init_or_livepatch apply_alternatives(struct alt_instr *start,
>>>> - struct alt_instr *end)
>>>> +#ifdef CONFIG_LIVEPATCH
>>> ... to have the #ifdef than the init_or_livepatch attribute.
>> But the init_or_livepatch attribute doesn't remove the function when
>> !CONFIG_LIVEPATCH, so it's not a replacement for the ifdef.
>>
>> IOW: it's my understanding that the purpose of init_or_livepatch is to
>> add the __init attribute if livepatch is not enabled, but
>> apply_alternatives() should never have the __init attribute because
>> it's solely used by livepatch, it's not used at boot.
>
> For context, Jan you missed the MISRA call yesterday where this was
> identified as an emitted-but-undeferenced function.
Ah, this helps.
Thanks, Jan
|