> From: Andrew Cooper <andrew.coop...@citrix.com>
> Sent: Monday, February 20, 2023 11:04 AM
> To: Xen-devel <xen-devel@lists.xenproject.org>
> Cc: Andrew Cooper <andrew.coop...@citrix.com>; Jan Beulich 
> <jbeul...@suse.com>; Roger Pau Monne <roger....@citrix.com>; Wei Liu 
> <w...@xen.org>; Konrad Rzeszutek Wilk <konrad.w...@oracle.com>; Ross 
> Lagerwall <ross.lagerw...@citrix.com>
> Subject: [PATCH] x86/asm: ELF metadata for simple cases 
>  
> This is generally good practice, and necessary for livepatch binary diffing to
> work.
> 
> With this, livepatching of the SVM entry path works.  The only complication is
> with svm_stgi_label which is only used by oprofile to guestimate (not
> completely correctly) when an NMI hit guest context.
> 
> Livepatching of VMX is still an open question, because the logic doesn't form
> anything remotely resembling functions.  Both code fragments jump into each
> other so need to be updated in tandem.  Also, both code fragment entries need
> trampolines in the case that patching actually occurs.  For now, just treat it
> as a single function.

If it is treated as two functions and both functions are always included in
the live patch, would that work?

> 
> Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>
> ---
> CC: Jan Beulich <jbeul...@suse.com>
> CC: Roger Pau Monné <roger....@citrix.com>
> CC: Wei Liu <w...@xen.org>
> CC: Konrad Rzeszutek Wilk <konrad.w...@oracle.com>
> CC: Ross Lagerwall <ross.lagerw...@citrix.com>
> ---
>  xen/arch/x86/clear_page.S    | 3 +++
>  xen/arch/x86/copy_page.S     | 3 +++
>  xen/arch/x86/hvm/svm/entry.S | 3 +++
>  xen/arch/x86/hvm/vmx/entry.S | 3 +++
>  4 files changed, 12 insertions(+)
> 
> diff --git a/xen/arch/x86/clear_page.S b/xen/arch/x86/clear_page.S
> index d9d524c79ecd..5b5622cc526f 100644
> --- a/xen/arch/x86/clear_page.S
> +++ b/xen/arch/x86/clear_page.S
> @@ -16,3 +16,6 @@ ENTRY(clear_page_sse2)
>  
>          sfence
>          ret
> +
> +        .type clear_page_sse2, @function
> +        .size clear_page_sse2, . - clear_page_sse2

Would it be worth wrapping this pattern in a macro?

Ross

Reply via email to