Re: [PATCH] clear PF_VCPU in kvm_guest_exit()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Avi Kivity
Date: Wednesday, October 17, 2007 - 7:16 am

Laurent Vivier wrote:


Ingo already added this.


Need a barrier() here.  Otherwise the compiler may reorder
"kvm_guest_exit();" and "++vcpu->stats.exits;", making kvm_guest_exit()
right after local_irq_enable().  If it inlines kvm_guest_exit(), and
further encodes it in one instruction (both likely) we get:

         sti
         andl $something, (something_else)

The andl executes in interrupt shadow (that is, interrupts are still
disabled) and the timer tick won't see PF_VCPU.



Please copy kvm-devel on kvm patches.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [RESEND 2][PATCH 4/4] Modify KVM to update guest , Christian Borntraeger, (Mon Oct 15, 4:19 am)
Re: [RESEND 2][PATCH 4/4] Modify KVM to update guest , Christian Borntraeger, (Mon Oct 15, 4:33 am)
Re: [RESEND 2][PATCH 4/4] Modify KVM to update guest time ..., Christian Borntraeger, (Mon Oct 15, 7:39 am)
[PATCH] clear PF_VCPU in kvm_guest_exit(), Laurent Vivier, (Wed Oct 17, 6:08 am)
Re: [PATCH] clear PF_VCPU in kvm_guest_exit(), Christian Borntraeger, (Wed Oct 17, 6:18 am)
Re: [PATCH] clear PF_VCPU in kvm_guest_exit(), Avi Kivity, (Wed Oct 17, 7:16 am)
Re: [PATCH] clear PF_VCPU in kvm_guest_exit(), Laurent Vivier, (Wed Oct 17, 8:09 am)
Use virtual cpu accounting if available for guest times., Christian Borntraeger, (Thu Oct 18, 5:39 am)
[PATCH] move kvm_guest_exit() after local_irq_enable(), Laurent Vivier, (Thu Oct 18, 6:19 am)
Re: [kvm-devel] Use virtual cpu accounting if available fo ..., Hollis Blanchard, (Fri Oct 19, 10:18 am)