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

Re: [PATCH WIP] xen/public: move incomplete type definitions to xen.h


  • To: Elliott Mitchell <ehem+xen@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 25 Sep 2023 08:27:31 +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=IvuiRjexU03dbnKbKOVxRvKyg68cezPlfdqLGdKR/AQ=; b=eaac23IxC+9hZmcM6/dcgl2tCPF3R9VlCDGCj/HXitA7opyYnH+N2h2o/otWeu1DqdVXbBjtfczokxPMer6UYfDV2N/LpDUzAipgNgQAErwyuZ4PBKg30xN7Gd4yU36/lfqnEB3TdjlTaEBIVoNszgWSyYLL1AHoArlhNoLiCEApavS+wd8GR4RCxpBglwTNLSYpLPs5c+ty4hlWV68rLcD8tPiG6KitTAHROLTReeIfbLAV+fqSmltMfsHkgHSXJKGpnaRUQEJFv8z0MeY81YbIQY59+6JVoyaA+/W1CS30iF2/jgxiZHy2LOqJXknJTArd9KjAhVdephwGFLc3Kw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VR+BfpqrA+uxwcDHtTbKzou6eMvPgcR95Hk4/GN2pwWNe3HRy90/PJoaKXO38sM4/JBAJcVw3H9GSt0vBghZrXmBD0vqkpzqgFUMOHExLHsAvI3LfjbVGl1LOFiogASv/n+e1nZuABRZ8JZQ3AV4tYi9ETYUlvOZFKXuLN6sI8nMQpLYLZYc3Bpu2SZPX6koWb0h1Jz06FH7nJqSd1R5vLPb3RGkPd0Sy3xjTCfsGqs0GV9kTkmFG00WayHTxc17Q/IhTI34LPbcCcPBw+SsWokbYwUHOiaPrmCQpVJt2F41EYv7mOSM8lMa7PHnGSHUgqPrzezFGCfcF9BibeC8Hw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 25 Sep 2023 06:27:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 22.09.2023 17:42, Elliott Mitchell wrote:
> On Fri, Sep 22, 2023 at 10:21:21AM +0200, Jan Beulich wrote:
>> On 21.09.2023 18:18, Elliott Mitchell wrote:
>>>  As such these incomplete definitions should be
>>> in xen.h next to their hypercalls, rather than spread all over.
>>
>> Perhaps s/incomplete definitions/forward declarations/.
>>
>> There's a downside to the movement, though: You now introduce items
>> into the namespace which may be entirely unused. The two contradicting
>> goals need weighing as to their usefulness.
> 
> For the case which this is part of, they're not 100% unused.
> 
>>> trap_info_t is particularly notable since even though the hypercall is
>>> x86-only, the wrapper is likely to be visible to generic source code.
>>
>> Why would it be?
> 
> Related to converting ARM to using inline assembly-language wrappers
> instead of the current declarations+small assembly wrapper function.
> 
> The first step is you split the Linux header
> arch/x86/include/asm/xen/hypercall.h.  The upper portion (the x86
> inline assembly language) remains in arch/x86/include, all the
> HYPERVISOR_*() wrappers go into include/xen/$somewhere.  Several months
> ago I sent a candidate header to implement _hypercall#() for ARM.
> 
> Problem is:
> static inline int
> HYPERVISOR_set_trap_table(struct trap_info *table)
> {
>         return _hypercall1(int, set_trap_table, table);
> }
> Without without `struct trap_info;` somewhere, this fails.
> 
> Now, this isn't used on ARM, but this is tricky to guess.  Someone
> setting this up won't know whether any given function is absent due to
> being legacy and unlikely to ever be on non-x86.  Versus simply not /yet/
> being available on non-x86 (vPCI).
> 
> Perhaps xen/include/public/xen.h should only conditionally #define some
> of the __HYPERVISOR_* constants.  Likely there should be a way to force
> all the hypercall numbers to be available (for linting).  Yet as the
> current Linux header hints, perhaps there should be a way to disable the
> PV constants even on x86.

Downstream consumers of the public headers are free to adjust them to their
needs. The upstream form wants to remain sufficiently generic, which to me
includes not exposing types which aren't relevant for a particular arch.

Jan



 


Rackspace

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