Re: [PATCH] KVM: s390: generate kvm hypercall functions

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

 



On Wed, Jul 14, 2021 at 11:38:43AM +0200, Claudio Imbrenda wrote:
> On Tue, 13 Jul 2021 16:57:13 +0200
> Heiko Carstens <hca@xxxxxxxxxxxxx> wrote:
> 
> [snip]
> 
> > +#define HYPERCALL_ARGS_0
> > +#define HYPERCALL_ARGS_1 , arg1
> > +#define HYPERCALL_ARGS_2 HYPERCALL_ARGS_1, arg2
> > +#define HYPERCALL_ARGS_3 HYPERCALL_ARGS_2, arg3
> > +#define HYPERCALL_ARGS_4 HYPERCALL_ARGS_3, arg4
> > +#define HYPERCALL_ARGS_5 HYPERCALL_ARGS_4, arg5
> > +#define HYPERCALL_ARGS_6 HYPERCALL_ARGS_5, arg6
> > +
> > +#define GENERATE_KVM_HYPERCALL_FUNC(args)
> > 	\ +static inline
> > 			\ +long __kvm_hypercall##args(unsigned long
> > nr HYPERCALL_PARM_##args)	\ +{
> > 					\
> > +	register unsigned long __nr asm("1") = nr;
> > 	\
> > +	register long __rc asm("2");
> > 	\
> 
> didn't we want to get rid of asm register allocations?
> 
> this would have been a nice time to do such a cleanup

I see only two ways to get rid them, both are suboptimal, therefore I
decided to keep them at very few places; one of them this one.

Alternatively to this approach it would be possible to:

a) write the function entirely in assembler (instead of inlining it).

b) pass a structure with all parameters to the inline assembly and
   clobber a large amount of registers, which _might_ even lead to
   compile errors since the compiler might run out of registers when
   allocating registers for the inline asm.

Given that hypercall is slow anyway a) might be an option. But that's
up to you guys. Otherwise I would consider this the "final" solution
until we get compiler support which allows for something better.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux