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

Re: [RFC 0/5] Introduce dynamic tracer using Livepatch


  • To: andrew.cooper3@xxxxxxxxxx
  • From: Ryo Takakura <takakura@xxxxxxxxxxxxx>
  • Date: Tue, 27 Oct 2026 13:37:30 +0900
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=valinux.co.jp; dmarc=pass action=none header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Q7AyfO7OGwR4iO2s1aRgusgKklpML9RkuNBYW53UCV8=; b=djFZSOto3doTS7JHo4mDRcCdrf0WS8gBRaWTw5dYkruFjTGVCgcida0eWfRC3InayqRNZAaooXoLSibNhTMS0uzQg3qX2iPBPULwjqQNx0ECQlLrNCLCt6GQ4OZ+3rSD8avXQNoyiNqqoyQ7po9/iZycBUo+xXarE7UbT+txGiBI2iH2oMtRG7i8PJb8OZuWcjVFJPhVoKeao1uPr23UqnGVd7+OwqRbrnAbh95xJdhnu/npm/GXPf9zybWQFwEUW9rrSZABUhptPZnPj+BBdyTMKb/gTHNeaGPLVeAVxK5eEYBe8g2xrPDLQiyn0zSTEmYcxrYEsvP3DPe/vOHt7g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jl+FF+vLk/5xlOBcO+70QzMiLFCkwqL3n/uJ0HuJV8vnAraWeljKN8dwtmwxnxSUpbSeF1HaHBu9S5ruNLv4Nms8Msq99SdRXwzNP1+EfXQbcfXyPAM+DspDc83lcvc2y8FBedYvsQYuUqmOz8nKpbOsFz90ZNIkXsSpnAK+Ow2pryTdY4W21Da83sGq5mYBgTf8wwTdwPnM08AdLrttTUUYBKYOpy+cmFGFxDLDMXDnrPI28X4emLYTvhN7+A5myZNYpArvSEZBNgtRLOYJ0M/5jigo+FjoLZk2QI4CxpYeFgseZPzBIZi5UH+3yi2zgFofv1RWD6YbtoiuIfKg/w==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-Id:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=valinux.co.jp;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 27 Oct 2026 04:38:06 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Andrew!

On Mon, 26 Oct 2026 09:29:04 +0000, Andrew Cooper wrote:
>On 23/10/2026 5:48 am, Ryo Takakura wrote:
>> # Configuration
>> In addition to Livepatch and HypFS:
>>
>> CONFIG_LIVEPATCH=y
>> CONFIG_HYPFS=y
>>
>> Enable the following configs:
>>
>> CONFIG_ARM64_PATCHABLE_FUNCTION_ENTRY=y
>> or
>> CONFIG_X86_PATCHABLE_FUNCTION_ENTRY=y
>>
>> CONFIG_LIVEPATCH_TRACER=y
>
>
>This ends up having two almost-identical symbols, depending on
>architecture, where really this is a common piece of functionality.  It
>also conflates several different tasks.

Thank you for the feedback in detail. It was very helpful.
The suggested config layout makes much more sense.

>I think what you want is something like this:
>
>In xen/Kconfig, create CC_HAS_PATCHABLE_FUNCTION_ENTRY which performs
>the $(cc-option,-fpatchable-function-entry=0,0) check.

Understood.

>You are also going to need a GCC_PATCHABLE_FUNCTION_ENTRY_BROKEN symbol,
>because of https://godbolt.org/z/sde4faxaz.  See the ASM_GOTO_OUTPUT for
>another example of this pattern.  Just use a plain version check rather
>than tying it to XEN_IBT; this is a new feature and people wanting to
>use it can use a new enough compiler, and it avoids variability
>depending on other options.

I didn't know about the compiler behaviour. Thank you for the detail.
I'll make sure to check the acceptable compiler version and add a version
check as you suggest.

>You also want a HAS_PATCHABLE_FUNCTION_ENTRY in xen/common/Kconfig,
>which you select from the main config x86/ARM/etc in each patch where
>you add the architecture support.

Understood.

>You want the single visible entry LIVEPATCH_TRACER which depends on
>HAS_PATCHABLE_FUNCTION_ENTRY and CC_HAS_PATCHABLE_FUNCTION_ENTRY.  You
>want to make the text architecture-neutral.  Instead of the exact number
>of NOPs, just say "reserves space" which will be entirely fine; the
>target audience for Kconfig text is sysadmins/distro integrators, not
>developers.

Understood.
And I'll revise the feature description as well.

>Finally, you want PATCHABLE_FUNCTION_ENTRY which is selected by
>LIVEPATCH_TRACER, which triggers the Makefile changes.

Understood.

>As a general note, you don't need "default n" lines in Kconfig.  That is
>the default.

I see. I'll make sure to remove them.

>All together, this separates "can the compiler do it?" from "does the
>user want it?" from "what to do when the user wants it".

Understood!
I'll make those changes in the next version.

>Separately, you have a number of MISRA violations which you're
>introducing in your series.  I see you've got cf_check, which suggests
>you have built in GitlabCI.  Have you also run Eclair?

Thank you for pointing this out.
My apologies for the violations. I wasn't aware of the tests
and haven't run either of them. I added the cf_check following
the existing code that I referred to when preparing this series.
I'll make sure to run those tests before sending next version.

Sincerely,
Ryo Takakura



 


Rackspace

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