Re: [PATCH v2 09/13] MIPS: Add functions for hypervisor call

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

 



On Wed, May 28, 2014 at 11:52:12PM +0200, Andreas Herrmann wrote:

> +/*
> + * Hypercalls for KVM.
> + *
> + * Hypercall number is passed in v0.
> + * Return value will be placed in v0.
> + * Up to 3 arguments are passed in a0, a1, and a2.
> + */
> +static inline unsigned long kvm_hypercall0(unsigned long num)
> +{
> +	register unsigned long n asm("v0");
> +	register unsigned long r asm("v0");

Btw, is it safe to put two variables in the same register?

The syscall wrappers that used to be in <asm/unistd.h> were occasionally
hitting problems which eventually forced me to stop forcing variables
into particular registers instead using a MOVE instruction to shove
each variable into the right place.

Of course they were being used from non-PIC and PIC code, kernel and userland
so GCC had a much better chance to do evil than in the hypercall wrapper
case - but it made me paranoid ...

  Ralf
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux