explicit saves vs clobbers in paravirt.h

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

 



Zachary Amsden wrote:
> I would actually very much prefer not to have EAX, EDX, ECX clobbered 
> by these calls at all.  There are four performance critical calls that 
> are interrupt related - and we should implement them entirely in 
> assembler, with the hope of inlining them someday.  We go to some 
> effort not to clobber anything except for condition codes in our 
> implementation.

OK.  I was talking about all the calls in general, but the more 
performance-critical ones can definitely get special treatment.

> If I understand correctly, the Xen implementation clobbers ESI?  Why 
> is that?

It needs a temp for address calculation, and it turns out that ESI is 
unused in entry.S (or at least at all the points it's needed).  So 
there's nothing deeply architectural about the choice; we just need a 
scratch register here.  ECX or EDX would work as well (though perhaps it 
would require more work in entry.S), if you can cope with clobbering a 
single register.

> Here's our implementation of CLI/STI/PUSHF/POPF for reference.
[...]

Neat.

> VMI_ENTRY(EnableInterrupts)
>   movb         $(EFLAGS_IF >> 8), %ss:SHARED(interruptFlag)+1
>   testb        $(EFLAGS_IF >> 8), %ss:SHARED(interruptPending)+1
>   jnz          interruptsSlow
>   ret 

So ss:SHARED(foo) is per-CPU data?  Or would you do something else in 
the SMP case?

    J


[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