[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] livepatch: apply_alternatives() is only used for livepatch


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Wed, 7 Jun 2023 10:19:45 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=/siiXUBYf9Zsjtfi2bfaZ6N+sIbNb6Nnq5u30yeg/7k=; b=bWAzJHGiNlojx3YYCoJPwywFwWAB3ukqk7Y/+C6d1Db08OxwWjogCSRQqzbIUsZKQBmmA4easK+ZjGE/D4xgCqknezhqayEZoZ6/dsTRDKmd/drmKELU9C4SBdm5ogPi4BoSI74pmMz1i/7l3T0s7WPTy6bTuaZZB6FM97naozsFbNx9iIg9YP/M0DxbN/hBACrC0s3+X732CM7iNbS14VmJQ/Wl7l5XNfLjtApn6202mctw1Rt8dLHESDhhpTBMuFxcYyT/S65sQR5+uJ6CvweS5BN1NyOdA6WGgMCvDetCdXnzNFw5mGmWyRgNQb6lv0eo2m1kV1/ouh8a6fFX8A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dop8eDig57IE7alr5CDOMHwR7G40z5bB2Mvq4kfT4ZROJ1x39HnJIGs1sGr8lW+DMURE8+XGe3A4PZBtNaVtejvd4O91auPMcw0LiyARnrIVNSRzG6aXft2Afy3kZJWx6gCoeGqLiMYGXbVFNn0kcBQcUxallx035NF+cBSNOraMqRUVjvzeAJApbPYYKxXiFyQzWad9FKJnZhhOZg/uIoBIB1S2c5S6T9zD7hHRHw9Xb6Ts6PTlhUFKtpjCeE/7YZzmbD6HRBpVbsXl9QU2DheLa2oMJMiBi/CR4xKZ5WQuzX53T0swmoTM6XzLVr1pfGNCkpKJwGfbibr4mrsz6Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.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
  • Delivery-date: Wed, 07 Jun 2023 09:20:21 +0000
  • Ironport-data: A9a23:vyj0xqDboExQ0xVW/7Xiw5YqxClBgxIJ4kV8jS/XYbTApDkrhDQBm GscWTrVOPeNNmr0f9p3OYq//EICsJeAmtBnQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs t7pyyHlEAbNNwVcbCRMs8pvlDs15K6p4G1A4QRnDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIw6u0rAWYXz tkicx8CNymuqduq2JW4Rbw57igjBJGD0II3nFhFlW2cJ9B2BJfJTuPN+MNS2yo2ioZWB/HCa sEFaD1pKhPdfxlIPVRRA5U79AuqriCnL3sE9xTK+exrsgA/zyQouFTpGPPTdsaHWoN+mUGAq 3id12/4HgsbJJqUzj/tHneE37aWwnyiBdlDfFG+3vs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4sqD7X/7CKyeCSDkV4rOdisRaPffgH9 qtNJVKR8L5LWXhFZ0h5XyEZ7BibUYlaok4pdo9RhaystvGQ7ea0dDzQbLtHoCoKzwjQ2+XOA pmYBHDYPp71ASQRnTjigPQQm7sfEu63b8YKtm9w9Qu
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.