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

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


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 7 Jun 2023 11:17:45 +0200
  • 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=s3bIl+1C7USBtnM/LMd4oorYK5XHyI9s1ohMk+Xd9Kg=; b=fhOlRQX2kfN9sitGmWHcQl4BOhmTHt7B5GwEx75824y3Fas9YU62rV1JVDiMoNYqyOHS4nU3yu20Wtno5FtNBX/iHRCCXaWC4BD46LCXILOoU8jWWzi8Erizpv0f8f/fbKor9XMKAcF6SVu81xpKJj1PNc72lX7m8HgSfHVNJRMJBS/SeEtX1M7545/2AZYu7EWX+GVKBi6hTHSrYREHnAD9oYO0g9EsLGVbYKaaBYHRGWgtf9/pK7+9fVTCJUPrQDZXBh7URSuFLn0pbuFArRcuVpY1D8U/1Mh0CXqLbk+3HWTRhkUW3Ok5460tdbu8VrqIEfMHunUi/r17kOkg7Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oYy6lyXuPomyNkpZBT2LVpdICuKlizF/xHkrJFo+GXEbBMeXPKME81P4znNnkmDrSwJ8bITvLaOw2j9gBfJ8LKxh/Y3pXgGsouAT4P4h+6znvW6NaxKGWotpqKAL5AE4sWW0PpTRI8aEj9uibED4WQqFPDUwazpcHyDIbaM2t7mQiMX634kz2rBmB+faMdGk1jSmh3yed6iIWmcv4Iz1vhzP23CCv6XrXVRP1l6ovrHXvCk9eSx6uVDdHLMrjGahiqnm+MEtDnXxfBQKzLuc4rPQKrM4LTMRSjxDNOYUVXgv69iTdp3jqsMMtzhGXapP57wk+reynovmd8oqYOyfqg==
  • 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>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 07 Jun 2023 09:18:09 +0000
  • Ironport-data: A9a23:ui5Ye6tYye7SNxIc+PnONPInsOfnVMBfMUV32f8akzHdYApBsoF/q tZmKTqHOv7YYjChe9B2atjjo0IG7MfWnNIxTwU/+X0yRX5H+JbJXdiXEBz9bniYRiHhoOCLz O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg3HVQ+IMsYoUoLs/YjhYJ1isSODQqIu Nfjy+XSI1bg0DNvWo4uw/vrRChH4rKq4Fv0gnRkPaoQ5AGGyCFMZH4iDfrZw0XQE9E88tGSH 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG fMwCxEGbReMiPKK6+iHFNVCxeVyFMLNI9ZK0p1g5Wmx4fcOZ7nmG/+Pz/kBmTA6i4ZJAOrUY NcfZXx3dhPcbhZTO1ARTpUjgOOvgXq5eDpdwL6XjfNvvy6Pk0osif6xbrI5efTTLSlRtlyfq W/cuXzwHzkRNcCFyCrD+XWp7gPKtXqiAthDRePirpaGhnW92mgzGgdRX2G6sOK8oVWGBeoYd BMtr39GQa8asRbDosPGdx+yrWOAvxUcc8FNCOB84waIooLP+BqQDGUASj9HafQludUwSDhs0 UWG9/vrGDhuvbu9WX+bsLCOoluaMyUPMXULYyNCSAIf+sTiu6k6lBeJRdFmeIaLidnyFSD10 iq9hiE0jLUOjuYGz6y+u1vAhlqEuZzhXgMzoALNUQqN7AxjbYqhT4Wt4Erc67BLK4PxZkmMu j0IltaT6MgKDIqRj2qdTeMVBrar6v2ZdjrGjjZS84IJ8j2s/zupe9lW6TQmfkNxaJ5YJ3nuf VPZvh5X6NlLJny2YKRrYoW3TcM30aznEtejXffRBjZTXqVMmMa81HkGTSatM6rFySDATYlX1 U+nTPuR
  • Ironport-hdrordr: A9a23:Rcs5zqis90IA4g9+3ux2ZwRT0XBQX4113DAbv31ZSRFFG/FwWf re+sjzsiWE9Ar5PUtNpTnuAtj5fZrjz+843WB8B8bHYOEJ0FHYZL2Lw+PZsnfd8gfFh5hgPZ 4JSdk0NDUbZWIKwPoSmTPIWurIo+P3jZxA+92utEuFFjsaHJ2Ihj0RYm3wfywGITWqHaBJa6 Z0yfA36AZIEk5nF/hTaEN1ONQqZrXw5efbiFk9ZyLP7jPg40LKmdzH+mCjr20ju7wm+8ZXzU H11zbh7qGUu/unyhnavlWjnah+qZ/a09NGMseFkaEuW0XRozftXp1oX4uYsCkyu/zH0idYrP D85y04N8BE8XnWZW3dm2qd5yDQlAw243vV01WfmnfUocvlLQhKdfZ8uQ==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

Thanks, Roger.



 


Rackspace

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