From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751511AbdFHLYz (ORCPT ); Thu, 8 Jun 2017 07:24:55 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:37245 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750914AbdFHLYw (ORCPT ); Thu, 8 Jun 2017 07:24:52 -0400 Subject: Re: [PATCH 2/4] KVM: VMX: avoid double list add with VT-d posted interrupts To: Peter Xu Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Longpeng , Huangweidong , Gonglei , wangxin , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= References: <20170606105707.23207-1-pbonzini@redhat.com> <20170606105707.23207-3-pbonzini@redhat.com> <20170608065057.GB3628@pxdev.xzpeter.org> <463359347.7021259.1496905239878.JavaMail.zimbra@redhat.com> <20170608091644.GD3628@pxdev.xzpeter.org> From: Paolo Bonzini Message-ID: <5cfad7aa-9069-5419-b0b3-41df74a4f551@redhat.com> Date: Thu, 8 Jun 2017 13:24:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20170608091644.GD3628@pxdev.xzpeter.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/06/2017 11:16, Peter Xu wrote: >> Oh, I see what you mean: set up the wakeup handler in vmx_vcpu_pi_put >> and rely on PI.ON to wake up the sleeping process immediately. That >> should be feasible, but overall I like the current pre_block/post_block >> structure, and I think it's simpler. The only thing to be careful about >> is leaving the IRTE unmodified when scheduling out a blocked VCPU, which >> is cleaned up and simplified in patch 3. >> >> So I understand that the state may seem a bit too complicated as >> of this patch, but hopefully the next two make it clearer. > After re-read the codes and patches I got the point. Indeed current > way should be clearer since pre/post_block are mostly handling NV/DST > while pi_load/put are for SN bit. Thanks! Almost: pi_load handles NDST too. However, I think with patch 3 it's clearer how pi_load handles the nesting inside pre_block...post_block. Thanks, Paolo