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

2016-04-06 Thread Radim Krčmář
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; >>

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

2016-04-06 Thread Radim Krčmář
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; >>

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

2016-04-05 Thread Suravee Suthikulpanit
Radim, 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

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

2016-04-05 Thread Suravee Suthikulpanit
Radim, 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

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

2016-04-05 Thread Radim Krčmář
2016-04-05 17:07+0700, Suravee Suthikulpanit: > On 3/31/16 21:19, Radim Krčmář wrote: >>2016-03-31 15:52+0700, Suravee Suthikulpanit: >>>On 03/19/2016 04:44 AM, Radim Krčmář wrote: 2016-03-18 01:09-0500, Suravee Suthikulpanit: >+ } else { >+ new_entry = READ_ONCE(*entry);

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

2016-04-05 Thread Radim Krčmář
2016-04-05 17:07+0700, Suravee Suthikulpanit: > On 3/31/16 21:19, Radim Krčmář wrote: >>2016-03-31 15:52+0700, Suravee Suthikulpanit: >>>On 03/19/2016 04:44 AM, Radim Krčmář wrote: 2016-03-18 01:09-0500, Suravee Suthikulpanit: >+ } else { >+ new_entry = READ_ONCE(*entry);

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

2016-04-05 Thread Suravee Suthikulpanit
Hi Radim, On 3/31/16 21:19, Radim Krčmář wrote: 2016-03-31 15:52+0700, Suravee Suthikulpanit: On 03/19/2016 04:44 AM, Radim Krčmář wrote: 2016-03-18 01:09-0500, Suravee Suthikulpanit: + } else { + new_entry = READ_ONCE(*entry); + /** +* This

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

2016-04-05 Thread Suravee Suthikulpanit
Hi Radim, On 3/31/16 21:19, Radim Krčmář wrote: 2016-03-31 15:52+0700, Suravee Suthikulpanit: On 03/19/2016 04:44 AM, Radim Krčmář wrote: 2016-03-18 01:09-0500, Suravee Suthikulpanit: + } else { + new_entry = READ_ONCE(*entry); + /** +* This

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

2016-03-31 Thread Radim Krčmář
2016-03-31 15:52+0700, Suravee Suthikulpanit: > On 03/19/2016 04:44 AM, Radim Krčmář wrote: >>2016-03-18 01:09-0500, Suravee Suthikulpanit: >>>+} else { >>>+new_entry = READ_ONCE(*entry); >>>+/** >>>+ * This handles the case when vcpu is scheduled out >>>+

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

2016-03-31 Thread Radim Krčmář
2016-03-31 15:52+0700, Suravee Suthikulpanit: > On 03/19/2016 04:44 AM, Radim Krčmář wrote: >>2016-03-18 01:09-0500, Suravee Suthikulpanit: >>>+} else { >>>+new_entry = READ_ONCE(*entry); >>>+/** >>>+ * This handles the case when vcpu is scheduled out >>>+

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

2016-03-31 Thread Suravee Suthikulpanit
Hi Radim, On 03/19/2016 04:44 AM, Radim Krčmář wrote: 2016-03-18 01:09-0500, Suravee Suthikulpanit: From: Suravee Suthikulpanit + + WRITE_ONCE(*entry, new_entry); This will translate to two writes in 32 bit mode and we need to write physical ID

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

2016-03-31 Thread Suravee Suthikulpanit
Hi Radim, On 03/19/2016 04:44 AM, Radim Krčmář wrote: 2016-03-18 01:09-0500, Suravee Suthikulpanit: From: Suravee Suthikulpanit + + WRITE_ONCE(*entry, new_entry); This will translate to two writes in 32 bit mode and we need to write physical ID first to avoid spurious

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

2016-03-19 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit When a vcpu is loaded/unloaded to a physical core, we need to update host physical APIC ID information in the Physical APIC-ID table accordingly. Also, when vCPU is blocking/un-blocking (due to halt instruction), we need to make sure

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

2016-03-19 Thread Suravee Suthikulpanit
From: Suravee Suthikulpanit When a vcpu is loaded/unloaded to a physical core, we need to update host physical APIC ID information in the Physical APIC-ID table accordingly. Also, when vCPU is blocking/un-blocking (due to halt instruction), we need to make sure that the is-running bit in set

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

2016-03-19 Thread Radim Krčmář
2016-03-18 01:09-0500, Suravee Suthikulpanit: > From: Suravee Suthikulpanit > > When a vcpu is loaded/unloaded to a physical core, we need to update > host physical APIC ID information in the Physical APIC-ID table > accordingly. > > Also, when vCPU is

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

2016-03-19 Thread Radim Krčmář
2016-03-18 01:09-0500, Suravee Suthikulpanit: > From: Suravee Suthikulpanit > > When a vcpu is loaded/unloaded to a physical core, we need to update > host physical APIC ID information in the Physical APIC-ID table > accordingly. > > Also, when vCPU is blocking/un-blocking (due to halt