lkml.org 
[lkml]   [2017]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/4] KVM: VMX: avoid double list add with VT-d posted interrupts
On Fri, Jun 09, 2017 at 09:29:45AM +0200, Paolo Bonzini wrote:
>
>
> On 09/06/2017 04:50, Peter Xu wrote:
> > Even, I'm thinking whether we can unconditionally setup PDST only in
> > pi_load(), then post_block() only needs to handle the NV bit.
>
> No, you can't do that without fiddling with the blocked_vcpu lists in
> pi_load.

Then how about we keep the blocked_vcpu list maintainance in
post_block(), but only let pi_load() handle the PDST?

(I really feel like they are two things - the blocked_vcpu list helps
for the kick when wakeup happens; while PDST makes sure the PI is
always pointing to the correct cpu)

>
> > (PS. since I'm at here... could I ask why in pi_pre_block we need to
> > udpate PDST as well? I guess that decides who will run the
> > wakeup_handler code to kick the vcpu thread, but would that really
> > matter?)
>
> For this one it's a yes. :) I think it's not needed anymore indeed
> after these patches; see this comment:
>
> /*
> * The wakeup_handler expects the VCPU to be on the
> * blocked_vcpu_list that matches ndst.

Actually I was always unclear on what this sentense means: iiuc
blocked_vcpu_list is only a list of vcpus that may need a kick, so why
it has anything to do with PDST after all?

(or say, no matter what PDST is, we just kick the vcpu thread without
doing anything else, do we?)

> Interrupts
> * are disabled so no preemption should happen, but
> * err on the side of safety.
> */
>
> So we could add a WARN.

Thanks,

--
Peter Xu

\
 
 \ /
  Last update: 2017-06-12 01:42    [W:0.198 / U:1.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site