explicit saves vs clobbers in paravirt.h

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

 



On Wed, 2006-07-26 at 10:27 -0700, Jeremy Fitzhardinge wrote:
> In your sequences in asm/paravirt.h, you explicitly save the caller-save 
> regs:
> 
> static inline void raw_local_irq_restore(unsigned long f)
> {
> 	__asm__ __volatile__(paravirt_alt("pushl %%ecx; pushl %%edx\n\t"
> 					  "pushl %1; call *%0\n\t"
> 					  "popl %1; popl %%edx; popl %%ecx",
> 					  PARAVIRT_RESTORE_FLAGS)
> 			     : : "m" (paravirt_ops.restore_fl), "a"(f)
> 			     : "memory");
> }
> 
> Wouldn't adding ecx/edx (and maybe eax, where it has no other use) to 
> the asm's clobber list be sufficient?

Absolutely.  I didn't know how much room the replacements would need, so
I chose this "no-clobber" approach which takes 12 bytes.  If it turns
out that is too much, we can change to a clobber.  If it turns out to be
too little, we'll need to noop pad and/or clobber.

For the cases where these are used in asm directly (currently cli and
sti replacement), it was simplest to save all regs to have to same
non-clobber properties as the raw insns.

Hope that clarifies my thinking,
Rusty.
-- 
Help! Save Australia from the worst of the DMCA: http://linux.org.au/law



[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux