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

Re: OS Headers hypercall.h/hypervisor.h


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 29 Mar 2022 08:27:24 +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=YK4sQpKDPL1Sp//4fffv09vTWoI6q01E0+8prpZ5QEY=; b=afvEyhVEvyvlmRzj9kYYSTGTBhTjkFXN1V3aaZq/gQpYhEyDPGN+oZH5QinjZ2c1UA86Ocm8iNuDohcz+4kN4r+qyMNwH1uCZmuI+C5SFL4NG46oW8jR6TttbLF0lrjVmNH1eHiVCS04jyUbuLttOeFg51DZhCGAO7mNKS0gSLnCJRWzz03ZNeYJNnTnx5DzBWKCNetoLQEebonb24sbnfpFVWYF26GjP2Pe7s+kCNjZEXgFkuR+AkajZwCyhqj1z4GCQqXjMyynBUFDbEci6smy2cAOIeh6MliL2bCJWrq9rVoiktmToRwEDrNKVKyMyR4TzUhI0QF3OnucQgWX7Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gaPftp2JF8JP952dfj78e8Lnc+R0atTFfTVavJdJrCM9tQu3Ogek+KtnZ8pOzM3lypn6AbVOirva39Wk22D3MzpbeJ36snJGEQKKuT/qZ4uO/joSkH8oj0O1sRilyG35TjCZYFY9OiVIgFB7Wep0l+hhRm0h286ZoGFiOPvlxqOkbTdUpBwi6gEXqi47afrRG8kPV0731tGI+f9SPTHzGMMucIIvEj0oGSllnrDpED95Kpcwmli92Jya+1GAwh49gr22Fb8roXhclLlQssklhVo26zvFAgCNaeorAinjVKS32O5I3rUIi4Q6du27Sll1a4rqYBxb4/UfE+elZso/UQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Elliott Mitchell <ehem+xen@xxxxxxx>
  • Delivery-date: Tue, 29 Mar 2022 06:27:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 29.03.2022 00:25, Stefano Stabellini wrote:
> On Sat, 26 Mar 2022, Elliott Mitchell wrote:
>> The hypercalls implementation for Linux and FreeBSD have two key headers,
>> hypercall.h and hypervisor.h.  I'm curious why the implementations for
>> x86 and ARM* are so distinct.
>>
>> I found it fairly straightforward to implement ARM* versions of the x86
>> _hypercall#() macros.  Once that is done, most of the wrappers in the x86
>> hypercall.h can be moved to a shared hypervisor.h header.
>>
>> Why does Xen/ARM on Linux still have hypercall.S when merging the
>> headers should reduce maintainance?
>>
>> Was GCC extended inline assembly language for ARM* thought too awful?
>>
>> I'm also curious why these headers are part of the Linux kernel, instead
>> of being maintained by the Xen Project?
> 
> I would have to dig through ancient archives to give you a full answer
> but the reason was that the asm inline on ARM didn't provide enough
> guarantees on ordering and registers it would use and clobber.

While there may be ordering issues (albeit most ought to be taken care
of by marking the asm() volatile and having it have a memory clobber),
registers used / clobbered ought to always be expressable by asm() -
if not by constraints covering just a single register (such frequently
simply don't exist), then by using register variables tied to a
particular register. Of course in all of this there's an assumption of
no bugs in this area in the compilers claimed as being supported ...

Jan




 


Rackspace

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