[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: OS Headers hypercall.h/hypervisor.h
On Tue, Mar 29, 2022 at 08:27:24AM +0200, Jan Beulich wrote: > 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 ... I'm merely been working with recent versions of Clang on FreeBSD, but I've got something which appears to work. I would be somewhat hopeful GCC might have fewer bugs on ARM as registers aren't so precious. Yet that could well be a minefield. -- (\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | ehem+sigmsg@xxxxxxx PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |