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

Re: [PATCH] x86/asm: ELF metadata for simple cases


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
  • Date: Mon, 20 Feb 2023 11:51:01 +0000
  • Accept-language: en-US
  • 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=Ob9odbpqZHG9JA0edO2cGNMgzUBhXePDeMGOpIHsSj8=; b=fuaQVzsyGnN9gTMYSNwHwc6VssutjtwG7XFPmG+mRvFSSoxiPkFxauLqTii3MehTgFyR+q2UznvMDKTS4n/MG+zeAALLOSW/GW/dzusBqkE42fmKNrK9WO1WMNjuUy9iBybU0T1OaKiYsfN+BqIhvhjzzPu6VQNg/vPtJjnTFTUeTaKPxW4Wnf90CVqkzy7mm5vnv2IQW74gXaz7Moc49A2bCpRGn8Z7zERImBhEOR4TQ7gmyENEqqad1d7gPOpOacEKhBFcYXVOU9IL1BUVxAkXSLvB0wlFVSJcHwY8bJunzDOImBt5X9K6PQPYLUld2AMLXvbLa51wkaud6qgEfg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WifHBWIoJ3Ky1qHBoDEvJgV/sHXM14oj2++F6Mrk2zx79PDywC0qHS6KhhIcm4cKamVjpiJ0UDwXt5nGpYBxPJRrzia8jvuNbcI4FLLYUKEO0pNwXv+UosUXm60C0yicq18Z2dcbkq7lUsQQemBc7LBp4+mcWQmG4lFZL6No62nbIBqPivFnOkztdRTfGmW34kGiy89HE+Gme7b0gv8hTswgcvVjNPnUPd2lQczgmGcHtsY28rCKngWfByK2C5vCMH3sy/sakPOxOe6OWPZWBu3tehgzR+kJcVYOOTgdxXhGVtujwyOcWvllYucgkveE34KecwEATRq0NDTZ3miFug==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
  • Delivery-date: Mon, 20 Feb 2023 11:51:21 +0000
  • Ironport-data: A9a23:52cwTqrzL22Gg5+0yX22YnGNgq1eBmIiZBIvgKrLsJaIsI4StFCzt garIBnSbvneMzD0KogjaIu18koA7Zbdz4NlSVNupS0xEn8QpZuZCYyVIHmrMnLJJKUvbq7FA +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev NL2sqX3NUSsnjV5KQr40YrawP9UlKm06WxwUmAWP6gR5weEzSFNVfrzGInqR5fGatgMdgKFb 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay RAXAB4KURrEqMCQ+ZCqG/Ux29UEKPb6LpxK7xmMzRmBZRonabbqZvyQoPN9gnI3jM0IGuvCb c0EbzYpdA7HfxBEJlYQDtQ5gfusgX78NTZfrTp5p4JuuzSVkFM3jemraYWPEjCJbZw9ckKwv GXd5CL9Cx4XLsOWzT6t+XOwnO7f2yj8Xer+EZXpqaEx0QfLlgT/DjUXbXKh+fiHknWDfIl1F GY3ww8HjZktoRnDot7VGkfQTGS/lg4RXZ9cHvM37CmJy7HI+ECJC24cVDlDZdc68sgsSlQC9 HWEgtfoDjxHq6CORDSW8bL8hSy2ETgYKykFfyBsZQgC5cPqrMcsjxbMZtF5GaWxg5v+HjSY/ tyRhC03hrFWgctV0ay+pArDm2j1+cKPSRMp7ALKWG7j9hl+eIOue42v7x7c8OpEK4GaCFKGu RDohvSj0QzHNrnV/ATlfQnHNOjBCyqtWNEEvWNSIg==
  • Ironport-hdrordr: A9a23:R6eFnKssOzXLDNBxkySQjF0h7skDTNV00zEX/kB9WHVpm5qj5q eTdZMgpHzJYVcqOE3I9urqBEDtexnhHP1OgLX5X43MYOC8ghrNEGgK1+KL/9SHIUDDH4Vmu5 uIHZITNDVeZ2IK6/oTTGODYrQdKHjsytHMudvj
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels:
  • Thread-index: AQHZRRswUrrjJOPJkEyhnDj36yzKjK7Xt08b
  • Thread-topic: [PATCH] x86/asm: ELF metadata for simple cases

> From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Sent: Monday, February 20, 2023 11:04 AM
> To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
> Cc: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>; Jan Beulich 
> <JBeulich@xxxxxxxx>; Roger Pau Monne <roger.pau@xxxxxxxxxx>; Wei Liu 
> <wl@xxxxxxx>; Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>; Ross Lagerwall 
> <ross.lagerwall@xxxxxxxxxx>
> 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.cooper3@xxxxxxxxxx>
> ---
> CC: Jan Beulich <JBeulich@xxxxxxxx>
> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> CC: Wei Liu <wl@xxxxxxx>
> CC: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> CC: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
> ---
>  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


 


Rackspace

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