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

Re: [PATCH 1/2] x86/svm: Remove regs param from asm-called functions


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 12 Aug 2022 09:06:57 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=B08G4Yg9hc7MRAjDGVmnpCHFyKhKOK5Z9snEtO40L1w=; b=Rokw7rO7xOqGB2FhEdOjHVp/ERKxF1502BYODvv9/f+5Hqf6bjPpe9m0ze2RyqJ0hU+GO9g+NgAXIFnIcf6l5KZpix7slodyPsKIAmkNVP+UaeA6ee8DyJgqeTDouazLly2s0/K4rvqNHzNTs8ZXOM/Jxs5vfXrnngA3qL1RcwiKiU5leud+XimWOrDnZg9mwL1zkWRyO0U1sB6QhTCaRRhxAMauMRHUBsOdCxOLPA/h6QZY2cabAFFkR4APld8b/W+saNYVb8apjEphq4ZUsN0f8rmKAPL1E2NlWZgMYcrOAVzWt9Dn+XxesLNAfN3f5TNrP44QqhNEliCG6qq+gQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Aish+dLzElgL3f+loKI8ASBXNAtc02138ojha+NhUg/yG1MUrceHqD1YCd2oOph2/72WQqTzT4CVsEJPfEPN6gopx9U69JTN1NbNDdlqdM3bXSQC0sf3wrf3BdBGYMDSKsixc3KBSo7ErGzz3qP+BxIPFogwRF5eXshMhza+nvaUpySygNsGnvpdqspn84Y7HQQQC9wrlW2ST2jIV0WG1DYPQlqCN5c/WKmr9EpBPx/nEKLnRdQ/Dnn+WZ9z/puTqhOWedCuktNDHZqOiYinIxPI19bIc1bv6QCMcd4yr1TUhjst60dI2O5pto1ht1ehQrgK+JnTKv7uVnWVtpugvQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 12 Aug 2022 07:07:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11.08.2022 21:59, Andrew Cooper wrote:
> A optimisation is going to want to conditionally have extra data on the stack
> around VMExit.
> 
> We could alternative between `mov %rsp, %rdi` and `lea 8(%rsp), %rdi`, but it
> is easier just to make the functions void and let the compiler do the (not
> very) hard work.
> 
> Passing regs is a bit weird for HVM guests anyway, because the resulting
> pointer is invariant (this isn't native exception handling where the regs
> pointers *are* important), and all functions calculate `current` themselves
> which is another invariant.
> 
> Finally, the compiler can merge the get_cpu_info() calculation which is common
> to both `current` and guest_cpu_user_regs(), meaning the delta in C really is
> just one `lea`, and not any more expensive than `mov`'s in ASM anyway.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>




 


Rackspace

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