> From: Andrew Cooper <[email protected]> > Sent: Monday, February 20, 2023 11:04 AM > To: Xen-devel <[email protected]> > Cc: Andrew Cooper <[email protected]>; Jan Beulich > <[email protected]>; Roger Pau Monne <[email protected]>; Wei Liu > <[email protected]>; Konrad Rzeszutek Wilk <[email protected]>; Ross > Lagerwall <[email protected]> > 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 <[email protected]> > --- > CC: Jan Beulich <[email protected]> > CC: Roger Pau Monné <[email protected]> > CC: Wei Liu <[email protected]> > CC: Konrad Rzeszutek Wilk <[email protected]> > CC: Ross Lagerwall <[email protected]> > --- > 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
