All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
	"Julien Grall" <julien@xen.org>,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
	"Bertrand Marquis" <bertrand.marquis@arm.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Wei Liu" <wl@xen.org>, "Roger Pau Monné" <roger.pau@citrix.com>,
	"Christopher Clark" <christopher.w.clark@gmail.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3 00/13] xen: drop hypercall function tables
Date: Tue, 8 Mar 2022 14:44:21 +0100	[thread overview]
Message-ID: <7764a747-bff5-7c76-ab4b-a93fdd9050df@suse.com> (raw)
In-Reply-To: <4455dab2-d52b-2e1a-388a-ffc3123438a4@suse.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 4469 bytes --]

On 08.03.22 14:42, Jan Beulich wrote:
> On 08.03.2022 13:56, Juergen Gross wrote:
>> On 08.03.22 13:50, Jan Beulich wrote:
>>> On 08.03.2022 09:39, Juergen Gross wrote:
>>>> On 08.03.22 09:34, Jan Beulich wrote:
>>>>> On 08.12.2021 16:55, Juergen Gross wrote:
>>>>>> In order to avoid indirect function calls on the hypercall path as
>>>>>> much as possible this series is removing the hypercall function tables
>>>>>> and is replacing the hypercall handler calls via the function array
>>>>>> by automatically generated call macros.
>>>>>>
>>>>>> Another by-product of generating the call macros is the automatic
>>>>>> generating of the hypercall handler prototypes from the same data base
>>>>>> which is used to generate the macros.
>>>>>>
>>>>>> This has the additional advantage of using type safe calls of the
>>>>>> handlers and to ensure related handler (e.g. PV and HVM ones) share
>>>>>> the same prototypes.
>>>>>>
>>>>>> A very brief performance test (parallel build of the Xen hypervisor
>>>>>> in a 6 vcpu guest) showed a very slim improvement (less than 1%) of
>>>>>> the performance with the patches applied. The test was performed using
>>>>>> a PV and a PVH guest.
>>>>>>
>>>>>> Changes in V2:
>>>>>> - new patches 6, 14, 15
>>>>>> - patch 7: support hypercall priorities for faster code
>>>>>> - comments addressed
>>>>>>
>>>>>> Changes in V3:
>>>>>> - patches 1 and 4 removed as already applied
>>>>>> - comments addressed
>>>>>>
>>>>>> Juergen Gross (13):
>>>>>>      xen: move do_vcpu_op() to arch specific code
>>>>>>      xen: harmonize return types of hypercall handlers
>>>>>>      xen: don't include asm/hypercall.h from C sources
>>>>>>      xen: include compat/platform.h from hypercall.h
>>>>>>      xen: generate hypercall interface related code
>>>>>>      xen: use generated prototypes for hypercall handlers
>>>>>>      x86/pv-shim: don't modify hypercall table
>>>>>>      xen/x86: don't use hypercall table for calling compat hypercalls
>>>>>>      xen/x86: call hypercall handlers via generated macro
>>>>>>      xen/arm: call hypercall handlers via generated macro
>>>>>>      xen/x86: add hypercall performance counters for hvm, correct pv
>>>>>>      xen: drop calls_to_multicall performance counter
>>>>>>      tools/xenperf: update hypercall names
>>>>>
>>>>> As it's pretty certain now that parts of this which didn't go in yet will
>>>>> need re-basing, I'm going to drop this from my waiting-to-be-acked folder,
>>>>> expecting a v4 instead.
>>>>
>>>> Yes, I was planning to spin that up soon.
>>>>
>>>> The main remaining question is whether we want to switch the return type
>>>> of all hypercalls (or at least the ones common to all archs) not
>>>> requiring to return 64-bit values to "int", as Julien requested.
>>>
>>> After walking through the earlier discussion (Jürgen - thanks for the link)
>>> I'm inclined to say that if Arm wants their return values limited to 32 bits
>>> (with exceptions where needed), so be it. But on x86 I'd rather not see us
>>> change this aspect. Of course I'd much prefer if architectures didn't
>>> diverge in this regard, yet then again Arm has already diverged in avoiding
>>> the compat layer (in this case I view the divergence as helpful, though, as
>>> it avoids unnecessary headache).
>>
>> How to handle this in common code then? Have a hypercall_ret_t type
>> (exact naming TBD) which is defined as long on x86 and int on Arm?
>> Or use long in the handlers and check the value on Arm side to be a
>> valid 32-bit signed int (this would be cumbersome for the exceptions,
>> though)?
> 
> I was thinking along the lines of hypercall_ret_t, yes, but the
> compiler wouldn't be helping with spotting truncation issues (we can't
> reasonably enable the respective warnings, as they would trigger all
> over the place). If we were to go that route, we'd rely on an initial
> audit and subsequent patch review to spot issues. Therefore,
> cumbersome or not, the checking approach may be the more viable one.
> 
> Then again Julien may have a better plan in mind; I'd anyway expect
> him to supply details on how he thinks such a transition could be done
> safely, as he was the one to request limiting to 32 bits.

In order to have some progress I could just leave the Arm side alone
in my series. It could be added later if a solution has been agreed
on.

What do you think?


Juergen


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3149 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

  reply	other threads:[~2022-03-08 13:44 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-08 15:55 [PATCH v3 00/13] xen: drop hypercall function tables Juergen Gross
2021-12-08 15:55 ` [PATCH v3 01/13] xen: move do_vcpu_op() to arch specific code Juergen Gross
2021-12-14 17:21   ` Julien Grall
2021-12-15  7:12     ` Juergen Gross
2021-12-15  9:40       ` Julien Grall
2021-12-08 15:55 ` [PATCH v3 02/13] xen: harmonize return types of hypercall handlers Juergen Gross
2021-12-14 17:36   ` Julien Grall
2021-12-15  7:03     ` Juergen Gross
2021-12-16  2:10       ` Stefano Stabellini
2021-12-16  5:13         ` Juergen Gross
2021-12-16 20:43           ` Stefano Stabellini
2021-12-16 21:15             ` Stefano Stabellini
2021-12-17  5:34               ` Juergen Gross
2021-12-17  7:45                 ` Jan Beulich
2021-12-17  8:50                   ` Juergen Gross
2021-12-17 10:41                     ` Julien Grall
2021-12-17 11:12                       ` Juergen Gross
2021-12-17 23:00                         ` Stefano Stabellini
2021-12-20 17:14                           ` Julien Grall
2021-12-21  0:08                             ` Stefano Stabellini
2021-12-21  7:45                             ` Juergen Gross
2021-12-21  9:16                               ` Julien Grall
2021-12-17  7:39               ` Jan Beulich
2021-12-17 10:38               ` Julien Grall
2021-12-17 23:05                 ` Stefano Stabellini
2021-12-17 10:04       ` Julien Grall
2021-12-08 15:55 ` [PATCH v3 03/13] xen: don't include asm/hypercall.h from C sources Juergen Gross
2021-12-08 15:55 ` [PATCH v3 04/13] xen: include compat/platform.h from hypercall.h Juergen Gross
2021-12-09  9:01   ` Jan Beulich
2021-12-08 15:55 ` [PATCH v3 05/13] xen: generate hypercall interface related code Juergen Gross
2021-12-14  8:56   ` Jan Beulich
2021-12-08 15:55 ` [PATCH v3 06/13] xen: use generated prototypes for hypercall handlers Juergen Gross
2021-12-08 15:56 ` [PATCH v3 07/13] x86/pv-shim: don't modify hypercall table Juergen Gross
2021-12-08 15:56 ` [PATCH v3 08/13] xen/x86: don't use hypercall table for calling compat hypercalls Juergen Gross
2021-12-08 15:56 ` [PATCH v3 09/13] xen/x86: call hypercall handlers via generated macro Juergen Gross
2021-12-08 15:56 ` [PATCH v3 10/13] xen/arm: " Juergen Gross
2021-12-08 15:56 ` [PATCH v3 11/13] xen/x86: add hypercall performance counters for hvm, correct pv Juergen Gross
2021-12-08 15:56 ` [PATCH v3 12/13] xen: drop calls_to_multicall performance counter Juergen Gross
2021-12-08 15:56 ` [PATCH v3 13/13] tools/xenperf: update hypercall names Juergen Gross
2021-12-09  9:05 ` [PATCH v3 00/13] xen: drop hypercall function tables Jan Beulich
2021-12-09  9:10   ` Juergen Gross
2021-12-13 10:35     ` Jan Beulich
2021-12-13 10:48       ` Juergen Gross
2022-03-08  8:34 ` Jan Beulich
2022-03-08  8:39   ` Juergen Gross
2022-03-08  8:50     ` Jan Beulich
2022-03-08  8:53       ` Juergen Gross
2022-03-08 12:50     ` Jan Beulich
2022-03-08 12:56       ` Juergen Gross
2022-03-08 13:42         ` Jan Beulich
2022-03-08 13:44           ` Juergen Gross [this message]
2022-03-08 13:52             ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7764a747-bff5-7c76-ab4b-a93fdd9050df@suse.com \
    --to=jgross@suse.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bertrand.marquis@arm.com \
    --cc=christopher.w.clark@gmail.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.