Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1372488

Re: [PART1 RFC v3 12/12] svm: Manage vcpu load/unload when enable AVIC

From Radim Krčmář <rkrcmar@redhat.com>
Newsgroups linux.kernel
Subject Re: [PART1 RFC v3 12/12] svm: Manage vcpu load/unload when enable AVIC
Date 2016-04-06 14:40 +0200
Message-ID <rkUUx-3Mo-7@gated-at.bofh.it> (permalink)
References (3 earlier) <riLC2-6ib-25@gated-at.bofh.it> <riLC2-6ib-23@gated-at.bofh.it> <rkACv-5ln-49@gated-at.bofh.it> <rkACv-5ln-47@gated-at.bofh.it> <rkUUx-3Mo-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


2016-04-06 10:40+0700, Suravee Suthikulpanit:
> On 04/05/2016 09:56 PM, Radim Krčmář wrote:
>>I meant to change the place where we remember that is_running must not
>>be true.  Something like
>>
>>   svm_vcpu_blocking(struct kvm_vcpu *vcpu):
>>          vcpu->is_blocking = true;
>>          avic_set_running(vcpu, false);
>>
>>   avic_vcpu_load(struct kvm_vcpu *vcpu, bool is_load):
>>          avic_set_running(vcpu, is_load && !vcpu->is_blocking)
> 
> I assume that you also imply that we would also need:
> 
> 	svm_vcpu_unblocking(struct kvm_vcpu *vcpu) {
> 		avic_set_running(vcpu, false);
> 		vcpu->is_blocking = false;
> 	}

Yes, thought the order should be flipped in order to avoid suboptimal
case when preemption hits us after avic_set_running().

   static void svm_vcpu_unblocking(struct kvm_vcpu *vcpu) {
   	vcpu->is_blocking = false;
   	avic_set_running(vcpu, true);
   }

avic_set_running has barriers that prevent GCC from harmful reordering.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PART1 RFC v3 12/12] svm: Manage vcpu load/unload when enable  AVIC Radim Krčmář <rkrcmar@redhat.com> - 2016-04-05 17:00 +0200
  Re: [PART1 RFC v3 12/12] svm: Manage vcpu load/unload when enable  AVIC Radim Krčmář <rkrcmar@redhat.com> - 2016-04-06 14:40 +0200

csiph-web