[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Xen-devel] Re: [patch 13/26] Xen-paravirt_ops: Consistently wrap paravirt ops callsites to make them patchable
 
- To: Zachary Amsden <zach@xxxxxxxxxx>
 
- From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
 
- Date: Mon, 19 Mar 2007 22:54:20 -0700
 
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx,	virtualization@xxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx,	Rusty Russell <rusty@xxxxxxxxxxxxxxx>,	linux-kernel@xxxxxxxxxxxxxxx, chrisw@xxxxxxxxxxxx, Andi Kleen <ak@xxxxxx>,	"Eric W. Biederman" <ebiederm@xxxxxxxxxxxx>,	anthony@xxxxxxxxxxxxx, mingo@xxxxxxx,	Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>,	David Miller <davem@xxxxxxxxxxxxx>
 
- Delivery-date: Mon, 19 Mar 2007 22:53:29 -0700
 
- List-id: Xen developer discussion <xen-devel.lists.xensource.com>
 
 
 
Zachary Amsden wrote:
> For VMI, the default clobber was "cc", and you need a way to allow at
> least that, because saving and restoring flags is too expensive on x86.
According to lore (Andi, I think), asm() always clobbers cc. 
> I still don't think this was a good trade.  The primary motivation for
> clobbering %eax was that Xen wanted a free register to use for
> computing the offset into the shared data in the case of SMP
> preemptible kernels.  Xen no longer needs such a register, they can
> use the PDA offset instead.  And it does hurt native performance by
> unconditionally stealing a register in the four most commonly invoked
> paravirt-ops code sequences.
Actually, it still does need a temp register.  The sequence for cli is:
    mov %fs:xen_vcpu, %eax
    movb $1,1(%eax)
At some point I hope to move the vcpu structure directly into the
pda/percpu variables, at which point it will need no temps.
    J
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
 
    
     |